Logo Search packages:      
Sourcecode: inkscape version File versions  Download package


Go to the documentation of this file.
/** @file
 * Multi path manipulator - a tool component that edits multiple paths at once
/* Authors:
 *   Krzysztof KosiƄski <tweenk.pl@gmail.com>
 * Copyright (C) 2009 Authors
 * Released under GNU GPL, read the file 'COPYING' for more information


#include <sigc++/connection.h>
#include "display/display-forward.h"
#include "forward.h"
#include "ui/tool/commit-events.h"
#include "ui/tool/manipulator.h"
#include "ui/tool/modifier-tracker.h"
#include "ui/tool/node.h"
#include "ui/tool/node-types.h"
#include "ui/tool/shape-record.h"

struct SPCanvasGroup;

namespace Inkscape {
namespace UI {

class PathManipulator;
class MultiPathManipulator;
struct PathSharedData;

 * Manipulator that manages multiple path manipulators active at the same time.
00036 class MultiPathManipulator : public PointManipulator {
    MultiPathManipulator(PathSharedData &data, sigc::connection &chg);
    virtual ~MultiPathManipulator();
    virtual bool event(GdkEvent *event);

    bool empty() { return _mmap.empty(); }
    unsigned size() { return _mmap.empty(); }
    void setItems(std::set<ShapeRecord> const &);
    void clear() { _mmap.clear(); }
    void cleanup();

    void selectSubpaths();
    void shiftSelection(int dir);
    void invertSelectionInSubpaths();

    void setNodeType(NodeType t);
    void setSegmentType(SegmentType t);

    void insertNodes();
    void duplicateNodes();
    void joinNodes();
    void breakNodes();
    void deleteNodes(bool keep_shape = true);
    void joinSegments();
    void deleteSegments();
    void alignNodes(Geom::Dim2 d);
    void distributeNodes(Geom::Dim2 d);
    void reverseSubpaths();
    void move(Geom::Point const &delta);

    void showOutline(bool show);
    void showHandles(bool show);
    void showPathDirection(bool show);
    void setLiveOutline(bool set);
    void setLiveObjects(bool set);
    void updateOutlineColors();
    sigc::signal<void> signal_coords_changed; /// Emitted whenever the coordinates
        /// shown in the status bar need updating
00077     typedef std::pair<ShapeRecord, boost::shared_ptr<PathManipulator> > MapPair;
    typedef std::map<ShapeRecord, boost::shared_ptr<PathManipulator> > MapType;

    template <typename R>
    void invokeForAll(R (PathManipulator::*method)()) {
        for (MapType::iterator i = _mmap.begin(); i != _mmap.end(); ++i) {
    template <typename R, typename A>
    void invokeForAll(R (PathManipulator::*method)(A), A a) {
        for (MapType::iterator i = _mmap.begin(); i != _mmap.end(); ++i) {
    template <typename R, typename A>
    void invokeForAll(R (PathManipulator::*method)(A const &), A const &a) {
        for (MapType::iterator i = _mmap.begin(); i != _mmap.end(); ++i) {
    template <typename R, typename A, typename B>
    void invokeForAll(R (PathManipulator::*method)(A,B), A a, B b) {
        for (MapType::iterator i = _mmap.begin(); i != _mmap.end(); ++i) {
            ((i->second.get())->*method)(a, b);

    void _commit(CommitEvent cps);
    void _done(gchar const *);
    void _doneWithCleanup(gchar const *);
    guint32 _getOutlineColor(ShapeRole role);

    MapType _mmap;
    PathSharedData const &_path_data;
    sigc::connection &_changed;
    ModifierTracker _tracker;
    bool _show_handles;
    bool _show_outline;
    bool _show_path_direction;
    bool _live_outline;
    bool _live_objects;

    friend class PathManipulator;

} // namespace UI
} // namespace Inkscape


  Local Variables:
  c-file-offsets:((innamespace . 0)(inline-open . 0)(case-label . +))
// vim: filetype=cpp:expandtab:shiftwidth=4:tabstop=8:softtabstop=4:encoding=utf-8:textwidth=99 :

Generated by  Doxygen 1.6.0   Back to index