diff options
| author | bulia byak <buliabyak@gmail.com> | 2007-10-12 05:37:13 +0000 |
|---|---|---|
| committer | buliabyak <buliabyak@users.sourceforge.net> | 2007-10-12 05:37:13 +0000 |
| commit | 1a2367e69bb20d2b368063c2b7f4b544c3f9fc85 (patch) | |
| tree | f2ef5dd03813fe9fbf8240babba497bccf11119a /src | |
| parent | gradient tool update (diff) | |
| download | inkscape-1a2367e69bb20d2b368063c2b7f4b544c3f9fc85.tar.gz inkscape-1a2367e69bb20d2b368063c2b7f4b544c3f9fc85.zip | |
rearrange, a couple utility methods for node selection
(bzr r3889)
Diffstat (limited to 'src')
| -rw-r--r-- | src/nodepath.h | 115 |
1 files changed, 59 insertions, 56 deletions
diff --git a/src/nodepath.h b/src/nodepath.h index 29d34addd..8c6c4ff8b 100644 --- a/src/nodepath.h +++ b/src/nodepath.h @@ -96,62 +96,6 @@ class NodeSide; */ class Node; -/** - * This is a collection of subpaths which contain nodes - * - * In the following data model. Nodepaths are made up of subpaths which - * are comprised of nodes. - * - * Nodes are linked thus: - * \verbatim - n other - node -----> nodeside ------> node \endverbatim - */ -class Path { - public: -/** Pointer to the current desktop, for reporting purposes */ - SPDesktop * desktop; -/** The parent path of this nodepath */ - SPObject * object; -/** The context which created this nodepath. Important if this nodepath is deleted */ - ShapeEditor *shape_editor; -/** The subpaths which comprise this NodePath */ - GList * subpaths; -/** A list of nodes which are currently selected */ - GList * selected; -/** Transforms (userspace <---> virtual space? someone please describe ) - njh: I'd be guessing that these are item <-> desktop transforms.*/ - NR::Matrix i2d, d2i; -/** The DOM node which describes this NodePath */ - Inkscape::XML::Node *repr; - gchar *repr_key; - gchar *repr_nodetypes_key; - //STL compliant method to get the selected nodes - void selection(std::list<Node *> &l); - - /// livarot library is used for "point on path" and "nearest position on path", so we need to maintain its path representation as well - ::Path *livarot_path; - - /// draw a "sketch" of the path by using these variables - SPCanvasItem *helper_path; - SPCurve *curve; - bool show_helperpath; - - /// true if we changed repr, to tell this change from an external one such as from undo, simplify, or another desktop - unsigned int local_change; - - /// true if we're showing selected nodes' handles - bool show_handles; - - /// true if the path cannot contain curves, just straight lines - bool straight_path; - - /// active_node points to the node that is currently mouseovered (= NULL if - /// there isn't any); we also consider the node mouseovered if it is covered - /// by one of its handles and the latter is mouseovered - static Node *active_node; -}; - /** * This is the lowest list item, a simple list of nodes. @@ -247,6 +191,65 @@ class Node { guint is_dragging : 1; }; +/** + * This is a collection of subpaths which contain nodes + * + * In the following data model. Nodepaths are made up of subpaths which + * are comprised of nodes. + * + * Nodes are linked thus: + * \verbatim + n other + node -----> nodeside ------> node \endverbatim + */ +class Path { + public: +/** Pointer to the current desktop, for reporting purposes */ + SPDesktop * desktop; +/** The parent path of this nodepath */ + SPObject * object; +/** The context which created this nodepath. Important if this nodepath is deleted */ + ShapeEditor *shape_editor; +/** The subpaths which comprise this NodePath */ + GList * subpaths; +/** A list of nodes which are currently selected */ + GList * selected; +/** Transforms (userspace <---> virtual space? someone please describe ) + njh: I'd be guessing that these are item <-> desktop transforms.*/ + NR::Matrix i2d, d2i; +/** The DOM node which describes this NodePath */ + Inkscape::XML::Node *repr; + gchar *repr_key; + gchar *repr_nodetypes_key; + //STL compliant method to get the selected nodes + void selection(std::list<Node *> &l); + + guint numSelected() {return (selected? g_list_length(selected) : 0);} + NR::Point& singleSelectedCoords() {return (((Node *) selected->data)->pos);} + + /// livarot library is used for "point on path" and "nearest position on path", so we need to maintain its path representation as well + ::Path *livarot_path; + + /// draw a "sketch" of the path by using these variables + SPCanvasItem *helper_path; + SPCurve *curve; + bool show_helperpath; + + /// true if we changed repr, to tell this change from an external one such as from undo, simplify, or another desktop + unsigned int local_change; + + /// true if we're showing selected nodes' handles + bool show_handles; + + /// true if the path cannot contain curves, just straight lines + bool straight_path; + + /// active_node points to the node that is currently mouseovered (= NULL if + /// there isn't any); we also consider the node mouseovered if it is covered + /// by one of its handles and the latter is mouseovered + static Node *active_node; +}; + } // namespace NodePath } // namespace Inkscape |
