12#ifndef INKSCAPE_UI_TOOL_PATH_MANIPULATOR_H
13#define INKSCAPE_UI_TOOL_PATH_MANIPULATOR_H
29namespace XML {
class Node; }
34class ControlPointSelection;
35class PathManipulatorObserver;
37class PathCanvasGroups;
38class MultiPathManipulator;
70 uint32_t outline_color, Glib::ustring lpe_key);
76 void update(
bool alert_LPE =
false);
116 bool search_unselected,
bool closest);
156 void _commit(Glib::ustring
const &annotation);
157 void _commit(Glib::ustring
const &annotation, gchar
const *
key);
3x3 affine transformation matrix.
std::unique_ptr< T, CanvasItemUnlinkDeleter > CanvasItemPtr
Smart pointer used to hold CanvasItems, like std::unique_ptr.
3x3 matrix representing an affine transformation.
Store paths to a PathVector.
Two-dimensional point that doubles as a vector.
An invisible point used to drag curves.
Manipulator that manages multiple path manipulators active at the same time.
Manipulator that edits a single path using nodes with handles.
void _updateOutline()
Update the path outline.
CanvasItemPtr< Inkscape::CanvasItemBpath > _outline
void update(bool alert_LPE=false)
Update the display and the outline of the path.
Inkscape::XML::Node * _getXMLNode()
Return the XML node we are editing.
std::string _createTypeString()
Construct a node type string to store in the sodipodi:nodetypes attribute.
void _createGeometryFromControlPoints(bool alert_LPE=false)
Construct the geometric representation of nodes and handles, update the outline and display.
Glib::ustring _nodetypesKey()
Figure out in what attribute to store the nodetype string.
void setSegmentType(SegmentType)
Make selected segments curves / lines.
void hideDragPoint()
Hide the curve drag point until the next motion event.
void _selectionChanged(SelectableControlPoint *p, bool selected)
void setLiveOutline(bool set)
void insertNodeAtExtremum(ExtremumType extremum)
Insert a new node at the extremum of the selected segments.
Geom::Coord _updateDragPoint(Geom::Point const &)
Update the position of the curve drag point such that it is over the nearest point of the path.
~PathManipulator() override
std::shared_ptr< NodeList > SubpathPtr
void _commit(Glib::ustring const &annotation)
Update the XML representation and put the specified annotation on the undo stack.
Geom::Point _bsplineHandleReposition(Handle *h, bool check_other=true)
void rotateHandle(Node *n, int which, int dir, bool pixel)
void _externalChange(unsigned type)
Called by the XML observer when something else than us modifies the path.
void reverseSubpaths(bool selected_only)
Reverse subpaths of the path.
Geom::PathVector _spcurve
void _removeNodesFromSelection()
Removes all nodes belonging to this manipulator from the control point selection.
void _getGeometry()
Retrieve the geometry of the edited object from the object tree.
bool _nodeClicked(Node *, ButtonReleaseEvent const &)
void _updateOutlineOnZoomChange()
This is called on zoom change to update the direction arrows.
void _deleteSegments(bool delete_singles)
Removes selected segments.
bool _handleClicked(Handle *, ButtonReleaseEvent const &)
void showHandles(bool show)
Set the visibility of handles.
double _getStrokeTolerance()
Compute the radius from the edge of the path where clicks should initiate a curve drag or segment sel...
void weldNodes(NodeList::iterator preserve_pos=NodeList::iterator())
Replace contiguous selections of nodes in each subpath with one node.
void selectSubpaths()
Select all nodes in subpaths that have something selected.
MultiPathManipulator & mpm()
void setControlsTransform(Geom::Affine const &)
SPObject const * item() const
void setLiveObjects(bool set)
void _recalculateIsBSpline()
bool empty()
Check whether the manipulator has any nodes.
void showPathDirection(bool show)
void showOutline(bool show)
Set the visibility of outline.
static bool is_item_type(void *item)
void invertSelectionInSubpaths()
Invert selection in the selected subpaths.
bool _show_path_direction
unsigned _deleteStretch(NodeList::iterator first, NodeList::iterator last, NodeDeleteMode mode)
Delete nodes between the two iterators.
void duplicateNodes()
Insert new nodes exactly at the positions of selected nodes while preserving shape.
void clear()
Remove all nodes from the path.
Geom::Affine _getTransform() const
void _setGeometry()
Set the geometry of the edited object in the object tree, but do not commit to XML.
Geom::Affine _i2d_transform
item-to-desktop transform, inverse of _d2i_transform
Geom::Affine _edit_transform
additional transform to apply to editing controls
bool event(Inkscape::UI::Tools::ToolBase *tool, CanvasEvent const &event) override
Handle motion events to update the position of the curve drag point.
Geom::Affine _d2i_transform
desktop-to-item transform
PathManipulatorObserver * _observer
void deleteNodes(NodeDeleteMode mode)
Delete selected nodes in the path, optionally substituting deleted segments with bezier curves in a w...
SubpathList & subpathList()
void insertNodes()
Insert a new node in the middle of each selected segment.
void scaleHandle(Node *n, int which, int dir, bool pixel)
CurveDragPoint * _dragpoint
void weldSegments()
Remove nodes in the middle of selected segments.
void insertNode(Geom::Point)
Handle * _chooseHandle(Node *n, int which)
NodeList::iterator extremeNode(NodeList::iterator origin, bool search_selected, bool search_unselected, bool closest)
Find the node that is closest/farthest from the origin.
friend class PathManipulatorObserver
MultiPathManipulator & _multi_path_manipulator
void writeXML()
Store the changes to the path in XML.
void _selectionChangedM(std::vector< SelectableControlPoint * > pvec, bool selected)
NodeList::iterator subdivideSegment(NodeList::iterator after, double t)
Insert a node in the segment beginning with the supplied iterator, at the given time value.
int _bsplineGetSteps() const
void _createControlPointsFromGeometry()
Create nodes and handles based on the XML of the edited path.
void copySelectedPath(Geom::PathBuilder *builder)
Copy the selected nodes using the PathBuilder.
SPObject * _path
can be an SPPath or an Inkscape::LivePathEffect::Effect !!!
double _bsplineHandlePosition(Handle *h, bool check_other=true)
Tool component that edits something on the canvas using selectable control points.
ExtremumType
Type of extremum points to add in PathManipulator::insertNodeAtExtremum.
Desktop-bound selectable control object.
Interface for refcounted XML nodes.
SPObject is an abstract base class of all of the document nodes at the SVG document level.
SVG <path> implementation.
double Coord
Floating point type used to store coordinates.
Manipulator - edits something on-canvas.
SegmentType
Types of segments supported in the node tool.
Helper class to stream background task notifications as a series of messages.
static cairo_user_data_key_t key
callback interface for SVG path data
PathVector - a sequence of subpaths.
Abstract base class for events.
Inkscape::CanvasItemGroup * outline_group
Inkscape::CanvasItemGroup * dragpoint_group
Glib::RefPtr< Gtk::Builder > builder