Inkscape
Vector Graphics Editor
|
Manipulator that edits a single path using nodes with handles. More...
#include <path-manipulator.h>
Public Types | |
using | ItemType = SPPath * |
![]() | |
enum | ExtremumType { EXTR_MIN_X , EXTR_MAX_X , EXTR_MIN_Y , EXTR_MAX_Y } |
Type of extremum points to add in PathManipulator::insertNodeAtExtremum. More... | |
Public Member Functions | |
PathManipulator (MultiPathManipulator &mpm, SPObject *path, Geom::Affine const &edit_trans, uint32_t outline_color, Glib::ustring lpe_key) | |
~PathManipulator () override | |
bool | event (Inkscape::UI::Tools::ToolBase *tool, CanvasEvent const &event) override |
Handle motion events to update the position of the curve drag point. | |
bool | empty () |
Check whether the manipulator has any nodes. | |
void | writeXML () |
Store the changes to the path in XML. | |
void | update (bool alert_LPE=false) |
Update the display and the outline of the path. | |
void | clear () |
Remove all nodes from the path. | |
SPObject const * | item () const |
SPObject * | item () |
void | selectSubpaths () |
Select all nodes in subpaths that have something selected. | |
void | invertSelectionInSubpaths () |
Invert selection in the selected subpaths. | |
void | insertNodeAtExtremum (ExtremumType extremum) |
Insert a new node at the extremum of the selected segments. | |
void | insertNodes () |
Insert a new node in the middle of each selected segment. | |
void | insertNode (Geom::Point) |
void | insertNode (NodeList::iterator first, double t, bool take_selection) |
void | duplicateNodes () |
Insert new nodes exactly at the positions of selected nodes while preserving shape. | |
void | copySelectedPath (Geom::PathBuilder *builder) |
Copy the selected nodes using the PathBuilder. | |
void | weldNodes (NodeList::iterator preserve_pos=NodeList::iterator()) |
Replace contiguous selections of nodes in each subpath with one node. | |
void | weldSegments () |
Remove nodes in the middle of selected segments. | |
void | breakNodes () |
void | breakNodes (bool new_nodes) |
Break the subpath at selected nodes. | |
void | deleteNodes (NodeDeleteMode mode) |
Delete selected nodes in the path, optionally substituting deleted segments with bezier curves in a way that attempts to preserve the original shape of the curve. | |
void | deleteSegments () |
void | reverseSubpaths (bool selected_only) |
Reverse subpaths of the path. | |
void | setSegmentType (SegmentType) |
Make selected segments curves / lines. | |
void | scaleHandle (Node *n, int which, int dir, bool pixel) |
void | rotateHandle (Node *n, int which, int dir, bool pixel) |
void | showOutline (bool show) |
Set the visibility of outline. | |
void | showHandles (bool show) |
Set the visibility of handles. | |
void | showPathDirection (bool show) |
void | setLiveOutline (bool set) |
void | setLiveObjects (bool set) |
void | updateHandles () |
void | updatePath () |
void | setControlsTransform (Geom::Affine const &) |
void | hideDragPoint () |
Hide the curve drag point until the next motion event. | |
MultiPathManipulator & | mpm () |
NodeList::iterator | subdivideSegment (NodeList::iterator after, double t) |
Insert a node in the segment beginning with the supplied iterator, at the given time value. | |
NodeList::iterator | extremeNode (NodeList::iterator origin, bool search_selected, bool search_unselected, bool closest) |
Find the node that is closest/farthest from the origin. | |
int | _bsplineGetSteps () const |
SubpathList & | subpathList () |
![]() | |
PointManipulator (SPDesktop *d, ControlPointSelection &sel) | |
![]() | |
Manipulator (SPDesktop *d) | |
virtual | ~Manipulator ()=default |
Static Public Member Functions | |
static bool | is_item_type (void *item) |
Private Types | |
using | Subpath = NodeList |
using | SubpathPtr = std::shared_ptr< NodeList > |
Private Member Functions | |
void | _createControlPointsFromGeometry () |
Create nodes and handles based on the XML of the edited path. | |
void | _deleteSegments (bool delete_singles) |
Removes selected segments. | |
void | _recalculateIsBSpline () |
bool | _isBSpline () const |
double | _bsplineHandlePosition (Handle *h, bool check_other=true) |
Geom::Point | _bsplineHandleReposition (Handle *h, bool check_other=true) |
Geom::Point | _bsplineHandleReposition (Handle *h, double pos) |
void | _createGeometryFromControlPoints (bool alert_LPE=false) |
Construct the geometric representation of nodes and handles, update the outline and display. | |
unsigned | _deleteStretch (NodeList::iterator first, NodeList::iterator last, NodeDeleteMode mode) |
Delete nodes between the two iterators. | |
std::string | _createTypeString () |
Construct a node type string to store in the sodipodi:nodetypes attribute. | |
void | _updateOutline () |
Update the path outline. | |
void | _getGeometry () |
Retrieve the geometry of the edited object from the object tree. | |
void | _setGeometry () |
Set the geometry of the edited object in the object tree, but do not commit to XML. | |
Glib::ustring | _nodetypesKey () |
Figure out in what attribute to store the nodetype string. | |
Inkscape::XML::Node * | _getXMLNode () |
Return the XML node we are editing. | |
Geom::Affine | _getTransform () const |
void | _selectionChangedM (std::vector< SelectableControlPoint * > pvec, bool selected) |
void | _selectionChanged (SelectableControlPoint *p, bool selected) |
bool | _nodeClicked (Node *, ButtonReleaseEvent const &) |
void | _handleGrabbed () |
bool | _handleClicked (Handle *, ButtonReleaseEvent const &) |
void | _handleUngrabbed () |
void | _externalChange (unsigned type) |
Called by the XML observer when something else than us modifies the path. | |
void | _removeNodesFromSelection () |
Removes all nodes belonging to this manipulator from the control point selection. | |
void | _commit (Glib::ustring const &annotation) |
Update the XML representation and put the specified annotation on the undo stack. | |
void | _commit (Glib::ustring const &annotation, gchar const *key) |
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. | |
void | _updateOutlineOnZoomChange () |
This is called on zoom change to update the direction arrows. | |
double | _getStrokeTolerance () |
Compute the radius from the edge of the path where clicks should initiate a curve drag or segment selection, in window coordinates. | |
Handle * | _chooseHandle (Node *n, int which) |
Private Attributes | |
SubpathList | _subpaths |
MultiPathManipulator & | _multi_path_manipulator |
SPObject * | _path |
can be an SPPath or an Inkscape::LivePathEffect::Effect !!! | |
Geom::PathVector | _spcurve |
CanvasItemPtr< Inkscape::CanvasItemBpath > | _outline |
CurveDragPoint * | _dragpoint |
PathManipulatorObserver * | _observer |
Geom::Affine | _d2i_transform |
desktop-to-item transform | |
Geom::Affine | _i2d_transform |
item-to-desktop transform, inverse of _d2i_transform | |
Geom::Affine | _edit_transform |
additional transform to apply to editing controls | |
bool | _show_handles = true |
bool | _show_outline = false |
bool | _show_path_direction = false |
bool | _live_outline = true |
bool | _live_objects = true |
bool | _is_bspline = false |
Glib::ustring | _lpe_key |
Friends | |
class | PathManipulatorObserver |
class | CurveDragPoint |
class | Node |
class | Handle |
Related Symbols | |
(Note that these are not member symbols.) | |
void | build_segment (Geom::PathBuilder &builder, Node *prev_node, Node *cur_node) |
Build one segment of the geometric representation. | |
Additional Inherited Members | |
![]() | |
SPDesktop *const | _desktop |
![]() | |
ControlPointSelection & | _selection |
Manipulator that edits a single path using nodes with handles.
Currently only cubic bezier and linear segments are supported, but this might change some time in the future.
Definition at line 64 of file path-manipulator.h.
Definition at line 67 of file path-manipulator.h.
|
private |
Definition at line 125 of file path-manipulator.h.
|
private |
Definition at line 126 of file path-manipulator.h.
Inkscape::UI::PathManipulator::PathManipulator | ( | MultiPathManipulator & | mpm, |
SPObject * | path, | ||
Geom::Affine const & | edit_trans, | ||
uint32_t | outline_color, | ||
Glib::ustring | lpe_key | ||
) |
Definition at line 108 of file path-manipulator.cpp.
References _createControlPointsFromGeometry(), _d2i_transform, Inkscape::UI::Manipulator::_desktop, _dragpoint, _getGeometry(), _i2d_transform, _multi_path_manipulator, _outline, _path, Inkscape::UI::MultiPathManipulator::_path_data, _recalculateIsBSpline(), Inkscape::UI::PointManipulator::_selection, _selectionChangedM(), _updateOutlineOnZoomChange(), Geom::identity(), Geom::Affine::inverse(), Inkscape::UI::PathSharedData::outline_group, Inkscape::UI::ControlPoint::setVisible(), Inkscape::UI::ControlPointSelection::signal_selection_changed, Inkscape::UI::ControlPointSelection::signal_update, SPDesktop::signal_zoom_changed, SP_WIND_RULE_NONZERO, and update().
|
override |
Definition at line 148 of file path-manipulator.cpp.
References _dragpoint, _observer, _outline, and clear().
int Inkscape::UI::PathManipulator::_bsplineGetSteps | ( | ) | const |
Definition at line 1356 of file path-manipulator.cpp.
References _path, Inkscape::LivePathEffect::BSPLINE, LivePathEffectObject::get_lpe(), Inkscape::LivePathEffect::Effect::getLPEObj(), and Inkscape::LivePathEffect::LPEBSpline::steps.
|
private |
Definition at line 1396 of file path-manipulator.cpp.
References _bsplineHandlePosition(), Geom::are_near(), Inkscape::UI::BSPLINE_TOL, Geom::nearest_time(), Inkscape::UI::NO_POWER, Inkscape::UI::Handle::other(), Inkscape::UI::Handle::parent(), Inkscape::UI::ControlPoint::position(), and Inkscape::XML::Node::position().
Referenced by _bsplineHandlePosition(), _bsplineHandleReposition(), _deleteStretch(), Inkscape::UI::Node::_getTip(), Inkscape::UI::Handle::_update_bspline_handles(), Inkscape::UI::Node::move(), and Inkscape::UI::Node::transform().
|
private |
Definition at line 1412 of file path-manipulator.cpp.
References _bsplineHandlePosition(), and _bsplineHandleReposition().
Referenced by _bsplineHandleReposition(), and _deleteStretch().
|
private |
Definition at line 1419 of file path-manipulator.cpp.
References Geom::are_near(), Inkscape::UI::BSPLINE_TOL, Inkscape::UI::NO_POWER, Inkscape::UI::Handle::parent(), Inkscape::UI::ControlPoint::position(), and Inkscape::XML::Node::position().
Definition at line 994 of file path-manipulator.cpp.
References Inkscape::UI::NodeList::get_iterator(), Inkscape::UI::NodeIterator< N >::next(), Inkscape::UI::ControlPoint::position(), Inkscape::UI::NodeIterator< N >::prev(), Inkscape::UI::NodeIterator< N >::ptr(), and Geom::X.
Referenced by rotateHandle(), and scaleHandle().
|
private |
Update the XML representation and put the specified annotation on the undo stack.
Definition at line 1767 of file path-manipulator.cpp.
References Inkscape::UI::Manipulator::_desktop, Inkscape::DocumentUndo::done(), SPDesktop::getDocument(), and writeXML().
Referenced by Inkscape::UI::Handle::_eventHandler(), _handleClicked(), _handleUngrabbed(), _nodeClicked(), Inkscape::UI::CurveDragPoint::doubleclicked(), insertNode(), rotateHandle(), scaleHandle(), and Inkscape::UI::CurveDragPoint::ungrabbed().
|
private |
Definition at line 1775 of file path-manipulator.cpp.
References Inkscape::UI::Manipulator::_desktop, SPDesktop::getDocument(), key, Inkscape::DocumentUndo::maybeDone(), and writeXML().
|
private |
Create nodes and handles based on the XML of the edited path.
Definition at line 1257 of file path-manipulator.cpp.
References _getTransform(), _is_bspline, _multi_path_manipulator, _nodetypesKey(), _path, Inkscape::UI::MultiPathManipulator::_path_data, _spcurve, _subpaths, Inkscape::XML::Node::attribute(), Inkscape::UI::Node::back(), Geom::PathVector::begin(), clear(), Geom::PathVector::empty(), Geom::PathVector::end(), Geom::PathVector::erase(), SPObject::getRepr(), Node, Inkscape::UI::PathSharedData::node_data, Geom::BezierCurve::order(), Inkscape::UI::Node::parse_nodetype(), pathv_to_cubicbezier(), pathv_to_linear_and_cubic_beziers(), Inkscape::UI::Handle::setPosition(), and Inkscape::XML::Node::setPosition().
Referenced by _externalChange(), and PathManipulator().
|
private |
Construct the geometric representation of nodes and handles, update the outline and display.
alert_LPE | if true, first the LPE is warned what the new path is going to be before updating it |
Definition at line 1439 of file path-manipulator.cpp.
References _getTransform(), _live_objects, _live_outline, _path, _recalculateIsBSpline(), _setGeometry(), _spcurve, _subpaths, _updateOutline(), Inkscape::LivePathEffect::LPEPowerStroke::adjustForNewPath(), Geom::PathVector::begin(), build_segment(), builder, Geom::PathVector::empty(), Geom::PathVector::end(), Geom::PathVector::erase(), Geom::Affine::inverse(), Inkscape::LivePathEffect::POWERSTROKE, and Inkscape::UI::NodeIterator< N >::ptr().
Referenced by setControlsTransform(), and update().
|
private |
Construct a node type string to store in the sodipodi:nodetypes attribute.
Definition at line 1526 of file path-manipulator.cpp.
References _subpaths.
Referenced by writeXML().
|
private |
Removes selected segments.
Definition at line 817 of file path-manipulator.cpp.
References Inkscape::UI::PointManipulator::_selection, _subpaths, Inkscape::UI::ControlPointSelection::empty(), hideDragPoint(), Inkscape::UI::NodeIterator< N >::next(), Inkscape::UI::NODE_CUSP, and Inkscape::UI::NodeIterator< N >::prev().
Referenced by deleteNodes(), and deleteSegments().
|
private |
Delete nodes between the two iterators.
The given range can cross the beginning of the subpath in closed subpaths.
start | Beginning of the range to delete |
end | End of the range |
mode | Various delete methods, see NodeDeleteMode enum |
Definition at line 706 of file path-manipulator.cpp.
References _bsplineHandlePosition(), _bsplineHandleReposition(), _isBSpline(), Inkscape::UI::automatic, bezier_fit(), Inkscape::UI::curve_fit, Geom::distance(), Inkscape::UI::end, Inkscape::UI::NodeList::erase(), Inkscape::Preferences::get(), Inkscape::UI::get_angle(), Inkscape::Preferences::getDoubleLimited(), Inkscape::UI::inverse_auto, Inkscape::UI::line_segment, mode, Inkscape::UI::NodeIterator< N >::next(), Inkscape::UI::NODE_CUSP, Inkscape::UI::NodeIterator< N >::prev(), result, and Inkscape::UI::start.
Referenced by _nodeClicked(), and deleteNodes().
|
private |
Called by the XML observer when something else than us modifies the path.
Definition at line 1201 of file path-manipulator.cpp.
References _createControlPointsFromGeometry(), _d2i_transform, _getGeometry(), _i2d_transform, _path, Inkscape::UI::PointManipulator::_selection, _subpaths, _updateOutline(), hideDragPoint(), Inkscape::UI::ControlPointSelection::insert(), Geom::Affine::inverse(), and Inkscape::size.
Referenced by updatePath().
|
private |
Retrieve the geometry of the edited object from the object tree.
Definition at line 1574 of file path-manipulator.cpp.
References _lpe_key, _path, _spcurve, Inkscape::LivePathEffect::PathParam::get_pathvector(), and Inkscape::LivePathEffect::Effect::getParameter().
Referenced by _externalChange(), and PathManipulator().
|
private |
Compute the radius from the edge of the path where clicks should initiate a curve drag or segment selection, in window coordinates.
Definition at line 1837 of file path-manipulator.cpp.
References Inkscape::UI::Manipulator::_desktop, _getTransform(), _path, SPDesktop::current_zoom(), Geom::Affine::descrim(), Inkscape::Preferences::get(), Inkscape::Preferences::getIntLimited(), SPStyle::stroke, SPStyle::stroke_width, and SPObject::style.
Referenced by _updateDragPoint().
|
private |
Definition at line 1251 of file path-manipulator.cpp.
References _edit_transform, and _i2d_transform.
Referenced by _createControlPointsFromGeometry(), _createGeometryFromControlPoints(), _getStrokeTolerance(), _updateDragPoint(), and _updateOutline().
|
private |
Return the XML node we are editing.
This method is wrong but necessary at the moment.
Definition at line 1641 of file path-manipulator.cpp.
References _path, and SPObject::getRepr().
Referenced by writeXML().
|
private |
Definition at line 1699 of file path-manipulator.cpp.
References _commit(), event(), Inkscape::mod_alt(), Inkscape::UI::Handle::move(), Inkscape::UI::Handle::parent(), Inkscape::UI::ControlPoint::position(), and update().
|
private |
Definition at line 1688 of file path-manipulator.cpp.
References Inkscape::UI::PointManipulator::_selection, and Inkscape::UI::ControlPointSelection::hideTransformHandles().
|
private |
Definition at line 1693 of file path-manipulator.cpp.
References _commit(), Inkscape::UI::PointManipulator::_selection, and Inkscape::UI::ControlPointSelection::restoreTransformHandles().
|
private |
Definition at line 1391 of file path-manipulator.cpp.
References _is_bspline.
Referenced by _deleteStretch(), Inkscape::UI::CurveDragPoint::_getTip(), Inkscape::UI::Node::_getTip(), Inkscape::UI::Node::_setState(), Inkscape::UI::CurveDragPoint::dragged(), Inkscape::UI::CurveDragPoint::grabbed(), and subdivideSegment().
|
private |
Definition at line 1651 of file path-manipulator.cpp.
References _commit(), _deleteStretch(), Inkscape::UI::MultiPathManipulator::_doneWithCleanup(), _multi_path_manipulator, Inkscape::UI::NodeList::closed(), Inkscape::UI::curve_fit, empty(), event(), Inkscape::UI::NodeList::get_iterator(), hideDragPoint(), Inkscape::UI::NodeList::kill(), Inkscape::mod_alt(), Inkscape::mod_ctrl(), Inkscape::UI::NodeIterator< N >::next(), Inkscape::UI::NODE_LAST_REAL_TYPE, Inkscape::UI::NodeList::size(), and update().
|
private |
Figure out in what attribute to store the nodetype string.
Definition at line 1629 of file path-manipulator.cpp.
References _lpe_key, and _path.
Referenced by _createControlPointsFromGeometry(), and writeXML().
|
private |
Definition at line 1378 of file path-manipulator.cpp.
References _is_bspline, _path, and Inkscape::LivePathEffect::BSPLINE.
Referenced by _createGeometryFromControlPoints(), and PathManipulator().
|
private |
Removes all nodes belonging to this manipulator from the control point selection.
Definition at line 1756 of file path-manipulator.cpp.
References Inkscape::UI::PointManipulator::_selection, _subpaths, and Inkscape::UI::ControlPointSelection::erase().
|
private |
Definition at line 1717 of file path-manipulator.cpp.
References _show_handles, Inkscape::UI::NodeList::get_iterator(), Inkscape::UI::NodeIterator< N >::next(), node, and Inkscape::UI::NodeIterator< N >::prev().
Referenced by _selectionChangedM(), and duplicateNodes().
|
private |
Definition at line 1711 of file path-manipulator.cpp.
References _selectionChanged().
Referenced by PathManipulator().
|
private |
Set the geometry of the edited object in the object tree, but do not commit to XML.
Definition at line 1595 of file path-manipulator.cpp.
References _lpe_key, _path, _spcurve, empty(), Inkscape::LivePathEffect::PathParam::get_pathvector(), Inkscape::LivePathEffect::Effect::getParameter(), Inkscape::LivePathEffect::PathParam::set_new_value(), and sp_lpe_item_update_patheffect().
Referenced by _createGeometryFromControlPoints(), and writeXML().
|
private |
Update the position of the curve drag point such that it is over the nearest point of the path.
Definition at line 1783 of file path-manipulator.cpp.
References Inkscape::UI::Manipulator::_desktop, _dragpoint, _getStrokeTolerance(), _getTransform(), _spcurve, _subpaths, SPDesktop::d2w(), Geom::distance(), SPDesktop::getNamedView(), Inkscape::SnappedPoint::getPoint(), Geom::Affine::inverse(), Geom::PathVector::nearestTime(), Inkscape::UI::NodeIterator< N >::next(), Geom::PathVector::pointAt(), Inkscape::UI::CurveDragPoint::setIterator(), Inkscape::UI::ControlPoint::setPosition(), Inkscape::UI::CurveDragPoint::setSize(), Inkscape::UI::CurveDragPoint::setTimeValue(), SnapManager::setup(), Inkscape::UI::ControlPoint::setVisible(), SPNamedView::snap_manager, Inkscape::SNAPSOURCE_OTHER_HANDLE, and SPDesktop::w2d().
Referenced by Inkscape::UI::CurveDragPoint::doubleclicked(), event(), insertNode(), and Inkscape::UI::CurveDragPoint::ungrabbed().
|
private |
Update the path outline.
Definition at line 1541 of file path-manipulator.cpp.
References Inkscape::UI::Manipulator::_desktop, _getTransform(), _outline, _show_outline, _show_path_direction, _spcurve, Geom::PathVector::begin(), SPDesktop::d2w(), Geom::PathVector::end(), Geom::PathVector::push_back(), Geom::unit_vector(), and SPDesktop::w2d().
Referenced by _createGeometryFromControlPoints(), _externalChange(), _updateOutlineOnZoomChange(), showOutline(), showPathDirection(), and writeXML().
|
private |
This is called on zoom change to update the direction arrows.
Definition at line 1830 of file path-manipulator.cpp.
References _show_path_direction, and _updateOutline().
Referenced by PathManipulator().
|
inline |
Definition at line 93 of file path-manipulator.h.
References breakNodes().
Referenced by Inkscape::UI::MultiPathManipulator::breakNodes(), breakNodes(), and deleteNodes().
void Inkscape::UI::PathManipulator::breakNodes | ( | bool | new_nodes | ) |
Break the subpath at selected nodes.
It also works for single node closed paths.
Definition at line 576 of file path-manipulator.cpp.
References _multi_path_manipulator, Inkscape::UI::MultiPathManipulator::_path_data, _subpaths, Inkscape::UI::end, Node, Inkscape::UI::NODE_CUSP, and Inkscape::UI::PathSharedData::node_data.
void Inkscape::UI::PathManipulator::clear | ( | ) |
Remove all nodes from the path.
Definition at line 218 of file path-manipulator.cpp.
References _subpaths.
Referenced by _createControlPointsFromGeometry(), and ~PathManipulator().
void Inkscape::UI::PathManipulator::copySelectedPath | ( | Geom::PathBuilder * | builder | ) |
Copy the selected nodes using the PathBuilder.
builder[out] | Selected nodes will be appended to this Path builder in pixel coordinates with all transforms applied. |
Definition at line 404 of file path-manipulator.cpp.
References _path, _subpaths, build_segment(), builder, Inkscape::UI::Node::front(), Inkscape::UI::Handle::isDegenerate(), node, and Inkscape::XML::Node::position().
Referenced by Inkscape::UI::MultiPathManipulator::copySelectedPath().
void Inkscape::UI::PathManipulator::deleteNodes | ( | NodeDeleteMode | mode | ) |
Delete selected nodes in the path, optionally substituting deleted segments with bezier curves in a way that attempts to preserve the original shape of the curve.
Definition at line 629 of file path-manipulator.cpp.
References _deleteSegments(), _deleteStretch(), Inkscape::UI::PointManipulator::_selection, _subpaths, breakNodes(), Inkscape::UI::ControlPointSelection::empty(), Inkscape::UI::gap_lines, Inkscape::UI::gap_nodes, hideDragPoint(), and Inkscape::UI::NodeIterator< N >::next().
Referenced by Inkscape::UI::MultiPathManipulator::deleteNodes().
void Inkscape::UI::PathManipulator::deleteSegments | ( | ) |
Definition at line 811 of file path-manipulator.cpp.
References _deleteSegments().
Referenced by Inkscape::UI::MultiPathManipulator::deleteSegments(), and Inkscape::UI::CurveDragPoint::doubleclicked().
void Inkscape::UI::PathManipulator::duplicateNodes | ( | ) |
Insert new nodes exactly at the positions of selected nodes while preserving shape.
This is equivalent to breaking, except that it doesn't split into subpaths.
Definition at line 358 of file path-manipulator.cpp.
References _multi_path_manipulator, Inkscape::UI::MultiPathManipulator::_path_data, Inkscape::UI::PointManipulator::_selection, _selectionChanged(), _subpaths, Inkscape::UI::ControlPointSelection::empty(), Inkscape::UI::ControlPointSelection::erase(), Inkscape::UI::ControlPointSelection::insert(), Inkscape::UI::NodeIterator< N >::next(), Node, Inkscape::UI::NODE_CUSP, and Inkscape::UI::PathSharedData::node_data.
Referenced by Inkscape::UI::MultiPathManipulator::duplicateNodes().
bool Inkscape::UI::PathManipulator::empty | ( | ) |
Check whether the manipulator has any nodes.
Definition at line 174 of file path-manipulator.cpp.
References _path, and _subpaths.
Referenced by Inkscape::UI::CurveDragPoint::_eventHandler(), Inkscape::UI::CurveDragPoint::_getTip(), _nodeClicked(), _setGeometry(), event(), and writeXML().
|
overridevirtual |
Handle motion events to update the position of the curve drag point.
Implements Inkscape::UI::Manipulator.
Definition at line 157 of file path-manipulator.cpp.
References _updateDragPoint(), empty(), event(), and Inkscape::inspect_event().
Referenced by _handleClicked(), _nodeClicked(), and event().
NodeList::iterator Inkscape::UI::PathManipulator::extremeNode | ( | NodeList::iterator | origin, |
bool | search_selected, | ||
bool | search_unselected, | ||
bool | closest | ||
) |
Find the node that is closest/farthest from the origin.
origin | Point of reference |
search_selected | Consider selected nodes |
search_unselected | Consider unselected nodes |
closest | If true, return closest node, if false, return farthest |
Definition at line 1169 of file path-manipulator.cpp.
References Inkscape::UI::PointManipulator::_selection, _subpaths, Geom::distance(), Inkscape::UI::ControlPointSelection::empty(), and origin.
void Inkscape::UI::PathManipulator::hideDragPoint | ( | ) |
Hide the curve drag point until the next motion event.
This should be called at the beginning of every method that can delete nodes. Otherwise the invalidated iterator in the dragpoint can cause crashes.
Definition at line 1092 of file path-manipulator.cpp.
References _dragpoint, Inkscape::UI::CurveDragPoint::setIterator(), and Inkscape::UI::ControlPoint::setVisible().
Referenced by _deleteSegments(), _externalChange(), _nodeClicked(), deleteNodes(), Inkscape::UI::MultiPathManipulator::joinNodes(), weldNodes(), and weldSegments().
void Inkscape::UI::PathManipulator::insertNode | ( | Geom::Point | pt | ) |
Definition at line 276 of file path-manipulator.cpp.
References _dragpoint, _updateDragPoint(), Inkscape::UI::CurveDragPoint::getIterator(), Inkscape::UI::CurveDragPoint::getTimeValue(), and insertNode().
Referenced by Inkscape::UI::CurveDragPoint::_insertNode(), Inkscape::UI::MultiPathManipulator::insertNode(), and insertNode().
void Inkscape::UI::PathManipulator::insertNode | ( | NodeList::iterator | first, |
double | t, | ||
bool | take_selection | ||
) |
Definition at line 284 of file path-manipulator.cpp.
References _commit(), Inkscape::UI::PointManipulator::_selection, Inkscape::UI::ControlPointSelection::clear(), Inkscape::UI::ControlPointSelection::insert(), Inkscape::UI::NodeIterator< N >::ptr(), subdivideSegment(), and update().
void Inkscape::UI::PathManipulator::insertNodeAtExtremum | ( | ExtremumType | extremum | ) |
Insert a new node at the extremum of the selected segments.
Definition at line 312 of file path-manipulator.cpp.
References Inkscape::UI::PointManipulator::_selection, _subpaths, Inkscape::UI::add_or_replace_if_extremum(), Geom::are_near(), Inkscape::UI::PointManipulator::EXTR_MAX_X, Inkscape::UI::PointManipulator::EXTR_MIN_X, Inkscape::UI::PointManipulator::EXTR_MIN_Y, Geom::infinity(), Inkscape::UI::ControlPointSelection::insert(), Inkscape::UI::NodeIterator< N >::next(), Inkscape::UI::NodeIterator< N >::ptr(), Geom::Bezier::roots(), rs, sign(), Inkscape::UI::ControlPointSelection::size(), subdivideSegment(), Geom::Bezier::valueAt(), Geom::X, and Geom::Y.
Referenced by Inkscape::UI::MultiPathManipulator::insertNodesAtExtrema().
void Inkscape::UI::PathManipulator::insertNodes | ( | ) |
Insert a new node in the middle of each selected segment.
Definition at line 261 of file path-manipulator.cpp.
References Inkscape::UI::PointManipulator::_selection, _subpaths, Inkscape::UI::ControlPointSelection::insert(), Inkscape::UI::NodeIterator< N >::next(), Inkscape::UI::ControlPointSelection::size(), and subdivideSegment().
Referenced by Inkscape::UI::MultiPathManipulator::insertNodes().
void Inkscape::UI::PathManipulator::invertSelectionInSubpaths | ( | ) |
Invert selection in the selected subpaths.
Definition at line 243 of file path-manipulator.cpp.
References Inkscape::UI::PointManipulator::_selection, _subpaths, Inkscape::UI::ControlPointSelection::erase(), and Inkscape::UI::ControlPointSelection::insert().
Referenced by Inkscape::UI::MultiPathManipulator::invertSelectionInSubpaths().
|
static |
|
inline |
Definition at line 80 of file path-manipulator.h.
References _path.
|
inline |
Definition at line 79 of file path-manipulator.h.
References _path.
|
inline |
Definition at line 112 of file path-manipulator.h.
References _multi_path_manipulator.
void Inkscape::UI::PathManipulator::reverseSubpaths | ( | bool | selected_only | ) |
Reverse subpaths of the path.
selected_only | If true, only paths that have at least one selected node will be reversed. Otherwise all subpaths will be reversed. |
Definition at line 894 of file path-manipulator.cpp.
References _subpaths.
Referenced by Inkscape::UI::MultiPathManipulator::reverseSubpaths().
void Inkscape::UI::PathManipulator::rotateHandle | ( | Node * | n, |
int | which, | ||
int | dir, | ||
bool | pixel | ||
) |
Definition at line 970 of file path-manipulator.cpp.
References _chooseHandle(), _commit(), Inkscape::UI::Manipulator::_desktop, SPDesktop::current_zoom(), Inkscape::Preferences::get(), Inkscape::Preferences::getIntLimited(), Inkscape::UI::Handle::isDegenerate(), key, Inkscape::UI::Handle::length(), Inkscape::UI::NODE_CUSP, Inkscape::UI::Handle::relativePos(), Inkscape::UI::Handle::setRelativePos(), and update().
void Inkscape::UI::PathManipulator::scaleHandle | ( | Node * | n, |
int | which, | ||
int | dir, | ||
bool | pixel | ||
) |
Definition at line 937 of file path-manipulator.cpp.
References _chooseHandle(), _commit(), Inkscape::UI::Manipulator::_desktop, SPDesktop::current_zoom(), Inkscape::Preferences::get(), Inkscape::Preferences::getDoubleLimited(), Inkscape::UI::Handle::isDegenerate(), key, Geom::Point::length(), Inkscape::UI::NODE_AUTO, Inkscape::UI::NODE_SMOOTH, Inkscape::UI::NODE_SYMMETRIC, Inkscape::UI::ControlPoint::position(), Inkscape::UI::Handle::relativePos(), Inkscape::UI::Handle::setRelativePos(), Geom::unit_vector(), and update().
void Inkscape::UI::PathManipulator::selectSubpaths | ( | ) |
Select all nodes in subpaths that have something selected.
Definition at line 226 of file path-manipulator.cpp.
References Inkscape::UI::PointManipulator::_selection, _subpaths, and Inkscape::UI::ControlPointSelection::insert().
Referenced by Inkscape::UI::MultiPathManipulator::selectSubpaths().
void Inkscape::UI::PathManipulator::setControlsTransform | ( | Geom::Affine const & | tnew | ) |
Definition at line 1077 of file path-manipulator.cpp.
References _createGeometryFromControlPoints(), _edit_transform, _i2d_transform, _subpaths, delta, and Geom::Affine::inverse().
void Inkscape::UI::PathManipulator::setLiveObjects | ( | bool | set | ) |
Definition at line 1063 of file path-manipulator.cpp.
References _live_objects, and set.
Referenced by Inkscape::UI::MultiPathManipulator::setLiveObjects().
void Inkscape::UI::PathManipulator::setLiveOutline | ( | bool | set | ) |
Definition at line 1058 of file path-manipulator.cpp.
References _live_outline, and set.
Referenced by Inkscape::UI::MultiPathManipulator::setLiveOutline().
void Inkscape::UI::PathManipulator::setSegmentType | ( | SegmentType | type | ) |
Make selected segments curves / lines.
Definition at line 911 of file path-manipulator.cpp.
References Inkscape::UI::PointManipulator::_selection, _subpaths, Inkscape::UI::ControlPointSelection::empty(), Inkscape::UI::NodeIterator< N >::next(), Inkscape::UI::SEGMENT_CUBIC_BEZIER, and Inkscape::UI::SEGMENT_STRAIGHT.
Referenced by Inkscape::UI::CurveDragPoint::doubleclicked(), and Inkscape::UI::MultiPathManipulator::setSegmentType().
void Inkscape::UI::PathManipulator::showHandles | ( | bool | show | ) |
Set the visibility of handles.
Definition at line 1021 of file path-manipulator.cpp.
References _show_handles, and _subpaths.
Referenced by Inkscape::UI::MultiPathManipulator::showHandles().
void Inkscape::UI::PathManipulator::showOutline | ( | bool | show | ) |
Set the visibility of outline.
Definition at line 1044 of file path-manipulator.cpp.
References _show_outline, and _updateOutline().
void Inkscape::UI::PathManipulator::showPathDirection | ( | bool | show | ) |
Definition at line 1051 of file path-manipulator.cpp.
References _show_path_direction, and _updateOutline().
Referenced by Inkscape::UI::MultiPathManipulator::showPathDirection().
NodeList::iterator Inkscape::UI::PathManipulator::subdivideSegment | ( | NodeList::iterator | after, |
double | t | ||
) |
Insert a node in the segment beginning with the supplied iterator, at the given time value.
Definition at line 1100 of file path-manipulator.cpp.
References _isBSpline(), _multi_path_manipulator, Inkscape::UI::MultiPathManipulator::_path_data, Inkscape::UI::DEFAULT_START_POWER, Inkscape::UI::NodeList::get(), Inkscape::UI::NodeList::insert(), Geom::lerp(), Inkscape::UI::NodeIterator< N >::next(), Node, Inkscape::UI::NODE_CUSP, Inkscape::UI::PathSharedData::node_data, Inkscape::UI::NODE_SMOOTH, Inkscape::UI::NODE_SYMMETRIC, and Geom::BezierCurveN< degree >::subdivide().
Referenced by insertNode(), insertNodeAtExtremum(), and insertNodes().
|
inline |
Definition at line 120 of file path-manipulator.h.
References _subpaths.
void Inkscape::UI::PathManipulator::update | ( | bool | alert_LPE = false | ) |
Update the display and the outline of the path.
alert_LPE | if true, alerts an applied LPE to what the path is going to be changed to, so it can adjust its parameters for nicer user interfacing |
Definition at line 181 of file path-manipulator.cpp.
References _createGeometryFromControlPoints(), and _observer.
Referenced by Inkscape::UI::MultiPathManipulator::_done(), Inkscape::UI::Handle::_eventHandler(), _handleClicked(), _nodeClicked(), Inkscape::UI::Handle::_update_bspline_handles(), Inkscape::UI::CurveDragPoint::doubleclicked(), Inkscape::UI::CurveDragPoint::dragged(), Inkscape::UI::CurveDragPoint::grabbed(), insertNode(), PathManipulator(), rotateHandle(), and scaleHandle().
void Inkscape::UI::PathManipulator::updateHandles | ( | ) |
Definition at line 1068 of file path-manipulator.cpp.
References _subpaths.
Referenced by Inkscape::UI::MultiPathManipulator::updateHandles().
void Inkscape::UI::PathManipulator::updatePath | ( | ) |
Definition at line 1195 of file path-manipulator.cpp.
References _externalChange().
Referenced by Inkscape::UI::MultiPathManipulator::updatePaths().
void Inkscape::UI::PathManipulator::weldNodes | ( | NodeList::iterator | preserve_pos = NodeList::iterator() | ) |
Replace contiguous selections of nodes in each subpath with one node.
Definition at line 441 of file path-manipulator.cpp.
References Inkscape::UI::PointManipulator::_selection, _subpaths, hideDragPoint(), Geom::middle_point(), Inkscape::UI::NodeIterator< N >::next(), Inkscape::UI::NODE_CUSP, and Inkscape::UI::ControlPointSelection::size().
Referenced by Inkscape::UI::MultiPathManipulator::joinNodes().
void Inkscape::UI::PathManipulator::weldSegments | ( | ) |
Remove nodes in the middle of selected segments.
Definition at line 516 of file path-manipulator.cpp.
References Inkscape::UI::PointManipulator::_selection, _subpaths, hideDragPoint(), Inkscape::UI::NodeIterator< N >::next(), Inkscape::UI::NodeIterator< N >::prev(), and Inkscape::UI::ControlPointSelection::size().
Referenced by Inkscape::UI::MultiPathManipulator::joinSegments().
void Inkscape::UI::PathManipulator::writeXML | ( | ) |
Store the changes to the path in XML.
Definition at line 189 of file path-manipulator.cpp.
References _createTypeString(), _getXMLNode(), _live_outline, _nodetypesKey(), _observer, _path, _setGeometry(), _updateOutline(), SPObject::deleteObject(), empty(), node, Inkscape::XML::Node::removeObserver(), Inkscape::XML::Node::setAttribute(), and SPObject::updateRepr().
Referenced by Inkscape::UI::MultiPathManipulator::_commit(), _commit(), _commit(), and Inkscape::UI::MultiPathManipulator::_done().
|
related |
Build one segment of the geometric representation.
Definition at line 1509 of file path-manipulator.cpp.
References Inkscape::UI::Node::back(), builder, Inkscape::UI::Node::front(), Inkscape::UI::Handle::isDegenerate(), and Inkscape::UI::ControlPoint::position().
Referenced by _createGeometryFromControlPoints(), and copySelectedPath().
|
friend |
Definition at line 182 of file path-manipulator.h.
|
friend |
Definition at line 184 of file path-manipulator.h.
|
friend |
Definition at line 183 of file path-manipulator.h.
Referenced by _createControlPointsFromGeometry(), breakNodes(), duplicateNodes(), and subdivideSegment().
|
friend |
Definition at line 181 of file path-manipulator.h.
|
private |
desktop-to-item transform
Definition at line 170 of file path-manipulator.h.
Referenced by _externalChange(), and PathManipulator().
|
private |
Definition at line 168 of file path-manipulator.h.
Referenced by _updateDragPoint(), hideDragPoint(), insertNode(), PathManipulator(), and ~PathManipulator().
|
private |
additional transform to apply to editing controls
Definition at line 172 of file path-manipulator.h.
Referenced by _getTransform(), and setControlsTransform().
|
private |
item-to-desktop transform, inverse of _d2i_transform
Definition at line 171 of file path-manipulator.h.
Referenced by _externalChange(), _getTransform(), PathManipulator(), and setControlsTransform().
|
private |
Definition at line 178 of file path-manipulator.h.
Referenced by _createControlPointsFromGeometry(), _isBSpline(), and _recalculateIsBSpline().
|
private |
Definition at line 177 of file path-manipulator.h.
Referenced by _createGeometryFromControlPoints(), and setLiveObjects().
|
private |
Definition at line 176 of file path-manipulator.h.
Referenced by _createGeometryFromControlPoints(), setLiveOutline(), and writeXML().
|
private |
Definition at line 179 of file path-manipulator.h.
Referenced by _getGeometry(), _nodetypesKey(), and _setGeometry().
|
private |
Definition at line 164 of file path-manipulator.h.
Referenced by _createControlPointsFromGeometry(), _nodeClicked(), breakNodes(), duplicateNodes(), mpm(), PathManipulator(), and subdivideSegment().
|
private |
Definition at line 169 of file path-manipulator.h.
Referenced by update(), writeXML(), and ~PathManipulator().
|
private |
Definition at line 167 of file path-manipulator.h.
Referenced by _updateOutline(), PathManipulator(), and ~PathManipulator().
|
private |
can be an SPPath or an Inkscape::LivePathEffect::Effect !!!
Definition at line 165 of file path-manipulator.h.
Referenced by _bsplineGetSteps(), _createControlPointsFromGeometry(), _createGeometryFromControlPoints(), _externalChange(), _getGeometry(), _getStrokeTolerance(), _getXMLNode(), _nodetypesKey(), _recalculateIsBSpline(), _setGeometry(), copySelectedPath(), Inkscape::UI::CurveDragPoint::dragged(), empty(), item(), item(), PathManipulator(), and writeXML().
|
private |
Definition at line 173 of file path-manipulator.h.
Referenced by _selectionChanged(), and showHandles().
|
private |
Definition at line 174 of file path-manipulator.h.
Referenced by _updateOutline(), and showOutline().
|
private |
Definition at line 175 of file path-manipulator.h.
Referenced by _updateOutline(), _updateOutlineOnZoomChange(), and showPathDirection().
|
private |
Definition at line 166 of file path-manipulator.h.
Referenced by _createControlPointsFromGeometry(), _createGeometryFromControlPoints(), _getGeometry(), _setGeometry(), _updateDragPoint(), and _updateOutline().
|
private |
Definition at line 163 of file path-manipulator.h.
Referenced by _createControlPointsFromGeometry(), _createGeometryFromControlPoints(), _createTypeString(), _deleteSegments(), _externalChange(), _removeNodesFromSelection(), _updateDragPoint(), breakNodes(), clear(), copySelectedPath(), deleteNodes(), duplicateNodes(), empty(), extremeNode(), insertNodeAtExtremum(), insertNodes(), invertSelectionInSubpaths(), reverseSubpaths(), selectSubpaths(), setControlsTransform(), setSegmentType(), showHandles(), subpathList(), updateHandles(), weldNodes(), and weldSegments().