Inkscape
Vector Graphics Editor
|
Sequence of contiguous curves, aka spline. More...
#include <path.h>
Classes | |
class | ClosingSegment |
class | StitchSegment |
Public Types | |
typedef PathInternal::PathData | PathData |
typedef PathInternal::Sequence | Sequence |
typedef PathInternal::BaseIterator< Path > | iterator |
typedef PathInternal::BaseIterator< Path const > | const_iterator |
typedef Sequence::size_type | size_type |
typedef Sequence::difference_type | difference_type |
Public Member Functions | |
Path (Point const &p=Point()) | |
Construct an empty path starting at the specified point. | |
template<typename Iter > | |
Path (Iter first, Iter last, bool closed=false, bool stitch=false) | |
Construct a path containing a range of curves. | |
Path (Rect const &r) | |
Create a path from a rectangle. | |
Path (ConvexHull const &) | |
Create a path from a convex hull. | |
Path (Circle const &c) | |
Create a path from a circle, using two elliptical arcs. | |
Path (Ellipse const &e) | |
Create a path from an ellipse, using two elliptical arcs. | |
virtual | ~Path () |
void | swap (Path &other) noexcept |
Swap contents with another path. | |
Curve const & | operator[] (size_type i) const |
Access a curve by index. | |
Curve const & | at (size_type i) const |
Access a curve by index. | |
Curve const & | front () const |
Access the first curve in the path. | |
Curve const & | initialCurve () const |
Alias for front(). | |
Curve const & | back () const |
Access the last curve in the path. | |
Curve const & | back_open () const |
Curve const & | back_closed () const |
Curve const & | back_default () const |
Curve const & | finalCurve () const |
const_iterator | begin () const |
const_iterator | end () const |
const_iterator | end_default () const |
const_iterator | end_open () const |
const_iterator | end_closed () const |
iterator | begin () |
iterator | end () |
iterator | end_default () |
iterator | end_open () |
iterator | end_closed () |
size_type | size_open () const |
Size without the closing segment, even if the path is closed. | |
size_type | size_closed () const |
Size with the closing segment, if it makes a difference. | |
size_type | size_default () const |
Natural size of the path. | |
size_type | size () const |
Natural size of the path. | |
size_type | max_size () const |
bool | empty () const |
Check whether path is empty. | |
bool | closed () const |
Check whether the path is closed. | |
void | close (bool closed=true) |
Set whether the path is closed. | |
void | clear () |
Remove all curves from the path. | |
OptRect | boundsFast () const |
Get the approximate bounding box. | |
OptRect | boundsExact () const |
Get a tight-fitting bounding box. | |
Piecewise< D2< SBasis > > | toPwSb () const |
bool | operator== (Path const &other) const |
Test paths for exact equality. | |
template<typename T > | |
Path & | operator*= (T const &tr) |
Apply a transform to each curve. | |
Interval | timeRange () const |
Get the allowed range of time values. | |
Curve const & | curveAt (Coord t, Coord *rest=NULL) const |
Get the curve at the specified time value. | |
LineSegment const & | closingSegment () const |
Get the closing segment of the path. | |
Point | pointAt (Coord t) const |
Get the point at the specified time value. | |
Coord | valueAt (Coord t, Dim2 d) const |
Get one coordinate (X or Y) at the specified time value. | |
Curve const & | curveAt (PathTime const &pos) const |
Get the curve at the specified path time. | |
Point | pointAt (PathTime const &pos) const |
Get the point at the specified path time. | |
Coord | valueAt (PathTime const &pos, Dim2 d) const |
Get one coordinate at the specified path time. | |
Point | operator() (Coord t) const |
PathExtrema | extrema (Dim2 d) const |
Find the extrema of the specified coordinate. | |
std::vector< PathTime > | roots (Coord v, Dim2 d) const |
Compute intersections with axis-aligned line. | |
std::vector< PathIntersection > | intersect (Path const &other, Coord precision=EPSILON) const |
Compute intersections with another path. | |
std::vector< PathIntersection > | intersectSelf (Coord precision=EPSILON) const |
Compute intersections of the path with itself. | |
int | winding (Point const &p) const |
Determine the winding number at the specified point. | |
std::vector< Coord > | allNearestTimes (Point const &p, Coord from, Coord to) const |
std::vector< Coord > | allNearestTimes (Point const &p) const |
PathTime | nearestTime (Point const &p, Coord *dist=NULL) const |
std::vector< Coord > | nearestTimePerCurve (Point const &p) const |
std::vector< Point > | nodes () const |
void | appendPortionTo (Path &p, Coord f, Coord t) const |
void | appendPortionTo (Path &p, PathTime const &from, PathTime const &to, bool cross_start=false) const |
Append a subset of this path to another path. | |
void | appendPortionTo (Path &p, PathInterval const &ival) const |
Append a subset of this path to another path. | |
void | appendPortionTo (Path &p, PathInterval const &ival, std::optional< Point > const &p_from, std::optional< Point > const &p_to) const |
Append a subset of this path to another path, specifying endpoints. | |
Path | portion (Coord f, Coord t) const |
Path | portion (Interval const &i) const |
Path | portion (PathTime const &from, PathTime const &to, bool cross_start=false) const |
Get a subset of the current path with full precision. | |
Path | portion (PathInterval const &ival) const |
Get a subset of the current path with full precision. | |
Path | reversed () const |
Obtain a reversed version of the current path. | |
void | insert (iterator pos, Curve const &curve) |
template<typename Iter > | |
void | insert (iterator pos, Iter first, Iter last) |
void | erase (iterator pos) |
void | erase (iterator first, iterator last) |
void | erase_last () |
void | start (Point const &p) |
Point | initialPoint () const |
Get the first point in the path. | |
Point | finalPoint () const |
Get the last point in the path. | |
Point | initialUnitTangent () const |
Get the unit tangent vector at the start of the path, or the zero vector if undefined. | |
Point | finalUnitTangent () const |
Get the unit tangent vector at the end of the path, or the zero vector if undefined. | |
void | setInitial (Point const &p) |
void | setFinal (Point const &p) |
void | append (Curve *curve) |
Add a new curve to the end of the path. | |
void | append (Curve const &curve) |
void | append (D2< SBasis > const &curve) |
void | append (Path const &other) |
void | replace (iterator replaced, Curve const &curve) |
void | replace (iterator first, iterator last, Curve const &curve) |
void | replace (iterator replaced, Path const &path) |
void | replace (iterator first, iterator last, Path const &path) |
template<typename Iter > | |
void | replace (iterator replaced, Iter first, Iter last) |
template<typename Iter > | |
void | replace (iterator first_replaced, iterator last_replaced, Iter first, Iter last) |
template<typename CurveType , typename... Args> | |
void | appendNew (Args &&... args) |
Append a new curve to the path. | |
void | snapEnds (Coord precision=EPSILON) |
Reduce the closing segment to a point if it's shorter than precision. | |
void | stitchTo (Point const &p) |
Append a stitching segment ending at the specified point. | |
Path | withoutDegenerateCurves () const |
Return a copy of the path without degenerate curves, except possibly for a degenerate closing segment. | |
void | checkContinuity () const |
Verify the continuity invariant. | |
void | setStitching (bool x) |
Enable or disable the throwing of exceptions when stitching discontinuities. | |
Private Member Functions | |
bool | _includesClosingSegment () const |
void | _unshare () |
PathTime | _factorTime (Coord t) const |
void | stitch (Sequence::iterator first_replaced, Sequence::iterator last_replaced, Sequence &sequence) |
void | do_update (Sequence::iterator first, Sequence::iterator last, Sequence &source) |
void | do_append (Curve *curve) |
Static Private Member Functions | |
static Sequence::iterator | seq_iter (iterator const &iter) |
static Sequence::const_iterator | seq_iter (const_iterator const &iter) |
Private Attributes | |
std::shared_ptr< PathData > | _data |
ClosingSegment * | _closing_seg |
bool | _closed |
bool | _exception_on_stitch |
Friends | |
template<typename T > | |
Path | operator* (Path const &path, T const &tr) |
Related Symbols | |
(Note that these are not member symbols.) | |
void | swap (Path &a, Path &b) noexcept |
Swap contents of two paths. | |
Sequence of contiguous curves, aka spline.
Path represents a sequence of contiguous curves, also known as a spline. It corresponds to a "subpath" in SVG terminology. It can represent both open and closed subpaths. The final point of each curve is exactly equal to the initial point of the next curve.
The path always contains a linear closing segment that connects the final point of the last "real" curve to the initial point of the first curve. This way the curves form a closed loop even for open paths. If the closing segment has nonzero length and the path is closed, it is considered a normal part of the path data. There are three distinct sets of end iterators one can use to iterate over the segments:
If the final point of the last "real" segment coincides exactly with the initial point of the first segment, the closing segment will be absent from both [begin(), end_open()) and [begin(), end_closed()).
Normally, an exception will be thrown when you try to insert a curve that makes the path non-continuous. If you are working with unsanitized curve data, you can call setStitching(true), which will insert line segments to make the path continuous.
Internally, Path uses copy-on-write data. This is done for two reasons: first, copying a Curve requires calling a virtual function, so it's a little more expensive that normal copying; and second, it reduces the memory cost of copying the path. Therefore you can return Path and PathVector from functions without worrying about temporary copies.
Note that this class cannot represent arbitrary shapes, which may contain holes. To do that, use PathVector, which is more generic.
It's not very convenient to create a Path directly. To construct paths more easily, use PathBuilder.
typedef PathInternal::BaseIterator<Path const> Geom::Path::const_iterator |
typedef Sequence::difference_type Geom::Path::difference_type |
typedef Sequence::size_type Geom::Path::size_type |
Construct an empty path starting at the specified point.
Definition at line 381 of file path.h.
References _closing_seg, and _data.
|
inline |
Construct a path containing a range of curves.
Definition at line 392 of file path.h.
References _closing_seg, and _data.
|
explicit |
Create a path from a rectangle.
Definition at line 257 of file path.cpp.
References _closing_seg, _data, and Geom::GenericRect< C >::corner().
|
explicit |
Create a path from a convex hull.
Definition at line 269 of file path.cpp.
References _closed, _closing_seg, _data, Geom::ConvexHull::back(), Geom::ConvexHull::empty(), Geom::ConvexHull::front(), Geom::BezierCurve::setFinal(), Geom::BezierCurve::setInitial(), and Geom::ConvexHull::size().
|
explicit |
Create a path from a circle, using two elliptical arcs.
Definition at line 294 of file path.cpp.
References _closing_seg, _data, and c.
|
explicit |
Create a path from an ellipse, using two elliptical arcs.
Definition at line 308 of file path.cpp.
References _closing_seg, _data, Geom::Ellipse::pointAt(), Geom::Ellipse::rays(), and Geom::Ellipse::rotationAngle().
Definition at line 1105 of file path.cpp.
References Geom::PathTime::curve_index, size_default(), and Geom::PathTime::t.
|
inlineprivate |
Definition at line 840 of file path.h.
References _closed, _closing_seg, and Geom::BezierCurveN< degree >::isDegenerate().
Referenced by back_default(), reversed(), and size_default().
|
inlineprivate |
Definition at line 843 of file path.h.
References _closing_seg, and _data.
Referenced by append(), append(), append(), appendNew(), clear(), erase(), erase(), insert(), insert(), operator*=(), replace(), replace(), setFinal(), setInitial(), snapEnds(), and stitchTo().
Definition at line 613 of file path.h.
References allNearestTimes(), and size_default().
Definition at line 638 of file path.cpp.
References allNearestTimes(), boundsFast(), closed(), Geom::distanceSq(), pointAt(), size(), and swap.
Referenced by allNearestTimes(), and allNearestTimes().
|
inline |
Add a new curve to the end of the path.
This inserts the new curve right before the closing segment. The path takes ownership of the passed pointer, which should not be freed.
Definition at line 750 of file path.h.
References _unshare(), do_append(), and stitchTo().
Referenced by Inkscape::UI::Tools::PenTool::_redoLastPoint(), SPCurve::append(), Geom::PathIteratorSink< OutputIterator >::append(), SPCurve::append_continuous(), appendPortionTo(), appendPortionTo(), Geom::PlanarGraph< EdgeLabel >::deviatesLeft(), Inkscape::LivePathEffect::LPETaperStroke::doBeforeEffect(), Inkscape::LivePathEffect::LPEAttachPath::doEffect(), Inkscape::LivePathEffect::LPEFillBetweenMany::doEffect(), Inkscape::LivePathEffect::LPEFillBetweenStrokes::doEffect(), Inkscape::LivePathEffect::LPEKnot::doEffect_path(), Inkscape::LivePathEffect::LPECopyRotate::doEffect_path(), Inkscape::LivePathEffect::LPEEmbroderyStitch::doEffect_path(), Inkscape::LivePathEffect::LPEFilletChamfer::doEffect_path(), Inkscape::LivePathEffect::LPEPowerStroke::doEffect_path(), Inkscape::LivePathEffect::LPEPts2Ellipse::gen_axes_paths(), Inkscape::LivePathEffect::LPEPts2Ellipse::gen_perspective_axes_paths(), Inkscape::half_outline(), Geom::Interpolate::CentripetalCatmullRomInterpolator::interpolateToPath(), Inkscape::LivePathEffect::FilletChamferKnotHolderEntity::knot_get(), Inkscape::outline_join(), pathv_to_cubicbezier(), pathv_to_linear(), pathv_to_linear_and_cubic_beziers(), Inkscape::Extension::Internal::PrintEmf::pathv_to_simple_polygon(), plot(), Inkscape::LivePathEffect::return_at_first_cusp(), SPGenericEllipse::set_shape(), Inkscape::LivePathEffect::LPERoughHatches::smoothSnake(), Inkscape::LivePathEffect::sp_bspline_do_effect(), Inkscape::LivePathEffect::LPECopyRotate::split(), TEST_F(), and Inkscape::LivePathEffect::LPEPts2Ellipse::unit_arc_path().
|
inline |
Definition at line 756 of file path.h.
References _unshare(), do_append(), and stitchTo().
Definition at line 761 of file path.h.
References _unshare(), do_append(), stitchTo(), Geom::X, and Geom::Y.
|
inline |
|
inline |
Append a new curve to the path.
This family of methods will automatically use the current final point of the path as the first argument of the new curve's constructor. To call this method, you'll need to write e.g.:
It is important to note that the coordinates passed to appendNew should be finite! If one of the coordinates is infinite, 2geom will throw a ContinuityError exception.
Definition at line 804 of file path.h.
References _unshare(), do_append(), and finalPoint().
Referenced by Inkscape::UI::Tools::PencilTool::_sketchInterpolate(), Inkscape::ObjectSnapper::_snapPathsConstrained(), Inkscape::LivePathEffect::LPECopyRotate::addCanvasIndicators(), Inkscape::LivePathEffect::LPEMirrorSymmetry::addCanvasIndicators(), Inkscape::LivePathEffect::LPESlice::addCanvasIndicators(), Inkscape::LivePathEffect::LPETransform2Pts::addCanvasIndicators(), Inkscape::LivePathEffect::LPEFilletChamfer::addChamferSteps(), Inkscape::LivePathEffect::LPERoughen::addNodesAndJitter(), SPCurve::append(), Inkscape::Text::Layout::baseline(), Inkscape::UI::Tools::MeasureTool::createAngleDisplayCurve(), Inkscape::LivePathEffect::LPEMeasureSegments::createLine(), Spiro::ConverterPath::curveto(), SPCurve::curveto(), Inkscape::LivePathEffect::LPEVonKoch::doBeforeEffect(), Inkscape::LivePathEffect::LPEMeasureSegments::doBeforeEffect(), Inkscape::LivePathEffect::LPETaperStroke::doBeforeEffect(), Inkscape::LivePathEffect::LPEAttachPath::doEffect(), Inkscape::LivePathEffect::LPEFillBetweenMany::doEffect(), Inkscape::LivePathEffect::LPEFillBetweenStrokes::doEffect(), Inkscape::LivePathEffect::LPEConstructGrid::doEffect_path(), Inkscape::LivePathEffect::LPECopyRotate::doEffect_path(), Inkscape::LivePathEffect::LPEFilletChamfer::doEffect_path(), Inkscape::LivePathEffect::LPELineSegment::doEffect_path(), Inkscape::LivePathEffect::LPEMirrorSymmetry::doEffect_path(), Inkscape::LivePathEffect::LPEPowerStroke::doEffect_path(), Inkscape::LivePathEffect::LPEExtrude::doEffect_pwd2(), Inkscape::LivePathEffect::LPETransform2Pts::doEffect_pwd2(), Inkscape::LivePathEffect::LPEShowHandles::drawHandleLine(), Inkscape::LivePathEffect::LPESimplify::drawHandleLine(), Inkscape::UI::Tools::fit_item(), Inkscape::LivePathEffect::LPEPts2Ellipse::gen_iso_frame_paths(), Inkscape::LivePathEffect::LPEPts2Ellipse::gen_perspective_frame_paths(), Geom::Interpolate::Linear::interpolateToPath(), Geom::Interpolate::CubicBezierFit::interpolateToPath(), Geom::Interpolate::CubicBezierJohan::interpolateToPath(), Geom::Interpolate::CubicBezierSmooth::interpolateToPath(), interpolateToPath(), interpolateToPath2(), Spiro::ConverterPath::lineto(), SPCurve::lineto(), Path::MakePathVector(), ordered_fit(), pathv_to_cubicbezier(), Spiro::ConverterPath::quadto(), SPCurve::quadto(), Inkscape::Extension::Internal::PrintMetafile::rect_cutter(), Inkscape::LivePathEffect::LPEBendPath::resetDefaults(), Inkscape::LivePathEffect::LPECurveStitch::resetDefaults(), Inkscape::LivePathEffect::LPEEnvelope::resetDefaults(), Inkscape::LivePathEffect::LPEVonKoch::resetDefaults(), Inkscape::UI::Tools::MeasureTool::setLine(), Inkscape::UI::Tools::MeasureTool::showCanvasItems(), Inkscape::LivePathEffect::LPERoughHatches::smoothSnake(), Inkscape::LivePathEffect::sp_bspline_do_effect(), Inkscape::LivePathEffect::LPESlice::splititem(), TEST_F(), Inkscape::LivePathEffect::LPEPts2Ellipse::unit_arc_path(), and Tracer::worker_helper().
Definition at line 777 of file path.cpp.
References append(), begin(), end(), Geom::inc(), insert(), and size().
Referenced by appendPortionTo(), appendPortionTo(), portion(), portion(), portion(), and TEST_F().
|
inline |
Append a subset of this path to another path.
This version allows you to explicitly pass a PathInterval.
Definition at line 635 of file path.h.
References appendPortionTo().
void Path::appendPortionTo | ( | Path & | p, |
PathInterval const & | ival, | ||
std::optional< Point > const & | p_from, | ||
std::optional< Point > const & | p_to | ||
) | const |
Append a subset of this path to another path, specifying endpoints.
This method is for use in situations where endpoints of the portion segments have to be set exactly, for instance when computing Boolean operations.
Definition at line 815 of file path.cpp.
References append(), c, Geom::PathInterval::crossesStart(), Geom::PathTime::curve_index, Geom::PathInterval::from(), Geom::PathInterval::isDegenerate(), Geom::PathInterval::pathSize(), pointAt(), Geom::Curve::portion(), Geom::PathInterval::reverse(), Geom::reverse(), Geom::Curve::setFinal(), Geom::Curve::setInitial(), size_closed(), stitchTo(), Geom::PathTime::t, and Geom::PathInterval::to().
|
inline |
Append a subset of this path to another path.
An extra stitching segment will be inserted if the start point of the portion and the final point of the target path do not match exactly. The closing segment of the target path will be modified.
Definition at line 628 of file path.h.
References appendPortionTo(), and size_closed().
Access a curve by index.
Definition at line 438 of file path.h.
References _data.
Referenced by Geom::PathVector::at(), Geom::PathVector::at(), curveAt(), Geom::PathVector::curveAt(), curveAt(), Geom::PathVector::curveAt(), Inkscape::LivePathEffect::LPEAttachPath::doEffect(), Inkscape::LivePathEffect::LPEFilletChamfer::doEffect_path(), nearestTime(), Geom::PathVector::pointAt(), pointAt(), Geom::PathVector::pointAt(), Geom::PathVector::valueAt(), valueAt(), and Geom::PathVector::valueAt().
|
inline |
Access the last curve in the path.
Definition at line 447 of file path.h.
References back_default().
Referenced by Geom::PathVector::back(), Geom::PathVector::back(), Inkscape::LivePathEffect::LPEAttachPath::doEffect(), Inkscape::half_outline(), and SPCurve::last_point_additive_move().
|
inline |
Definition at line 452 of file path.h.
References _closing_seg, _data, and Geom::BezierCurveN< degree >::isDegenerate().
Referenced by back_default(), count_path_curves(), count_path_degenerations(), count_path_nodes(), Inkscape::half_outline(), and Inkscape::LivePathEffect::size_nondegenerate().
|
inline |
Definition at line 457 of file path.h.
References _includesClosingSegment(), back_closed(), and back_open().
Referenced by back(), finalCurve(), SPCurve::last_segment(), and SPCurve::penultimate_point().
|
inline |
Definition at line 448 of file path.h.
References _data, and empty().
Referenced by back_default(), SPCurve::closepath_current(), do_update(), and Inkscape::LivePathEffect::sp_bspline_do_effect().
|
inline |
Definition at line 464 of file path.h.
Referenced by Inkscape::ObjectSnapper::_collectPaths(), append(), appendPortionTo(), arc_length_integrating(), arc_length_integrating(), arc_length_subdividing(), boundsExact(), boundsFast(), cairo_curve(), cairo_path(), cairo_path_stitches(), cairo_path_stitches(), count_path_degenerations(), Inkscape::LivePathEffect::LPEGears::doEffect_path(), Geom::PathSink::feed(), feed_path_to_cairo(), feed_path_to_cairo(), finalUnitTangent(), Inkscape::Extension::Internal::PrintEmf::get_pathrect_corner(), Inkscape::half_outline(), nearestTimePerCurve(), pathv_to_cubicbezier(), Inkscape::Extension::Internal::PrintEmf::pathv_to_rect(), replace(), replace(), sp_svg_write_path(), toPwSb(), winding(), and withoutDegenerateCurves().
OptRect Path::boundsExact | ( | ) | const |
Get a tight-fitting bounding box.
This will return the smallest possible axis-aligned rectangle containing all the curves in the path.
Definition at line 372 of file path.cpp.
References begin(), bounds, Geom::Curve::boundsExact(), empty(), end(), front(), and Geom::GenericRect< C >::unionWith().
Referenced by Geom::PathVector::boundsExact(), and wrap_path().
OptRect Path::boundsFast | ( | ) | const |
Get the approximate bounding box.
The rectangle returned by this method will contain all the curves, but it's not guaranteed to be the smallest possible one
Definition at line 348 of file path.cpp.
References _data, begin(), bounds, Geom::Curve::boundsFast(), empty(), end(), front(), and Geom::GenericRect< C >::unionWith().
Referenced by allNearestTimes(), Geom::bounds(), Geom::PathVector::boundsFast(), Inkscape::find_interior_point(), Inkscape::UI::Tools::fit_item(), Inkscape::UI::Tools::NodeTool::select_area(), and wrap_path().
void Path::checkContinuity | ( | ) | const |
Verify the continuity invariant.
If the path is not contiguous, this will throw a CountinuityError.
Definition at line 1090 of file path.cpp.
References _data.
Referenced by do_update(), and TEST_F().
void Path::clear | ( | ) |
Remove all curves from the path.
The initial and final points of the closing segment are set to (0,0). The stitching flag remains unchanged.
Definition at line 337 of file path.cpp.
References _closed, _closing_seg, _data, _unshare(), Geom::BezierCurve::setFinal(), and Geom::BezierCurve::setInitial().
Referenced by Inkscape::Text::Layout::_calculateBaselines(), Inkscape::LivePathEffect::LPEMeasureSegments::createLine(), Inkscape::LivePathEffect::LPEPowerMask::doBeforeEffect(), Geom::PathIteratorSink< OutputIterator >::flush(), Inkscape::half_outline(), Inkscape::LivePathEffect::FilletChamferKnotHolderEntity::knot_get(), Inkscape::LivePathEffect::LPECopyRotate::split(), start(), and wrap_path().
void Path::close | ( | bool | closed = true | ) |
Set whether the path is closed.
When closing a path where the last segment can be represented as a closing segment, the last segment will be removed. When opening a path, the closing segment will be erased. This means that closing and then opening a path will not always give back the original path.
Definition at line 322 of file path.cpp.
References _closed, _closing_seg, _data, c, initialPoint(), and Geom::BezierCurve::setInitial().
Referenced by Geom::PlanarGraph< EdgeLabel >::_reglueTeardrop(), SPCurve::backspace(), SPCurve::closepath(), Geom::PathIteratorSink< OutputIterator >::closePath(), SPCurve::closepath_current(), Spiro::ConverterPath::curveto(), Geom::PlanarGraph< EdgeLabel >::deviatesLeft(), Inkscape::LivePathEffect::LPETaperStroke::doBeforeEffect(), Inkscape::LivePathEffect::LPEFillBetweenMany::doEffect(), Inkscape::LivePathEffect::LPEFillBetweenStrokes::doEffect(), Inkscape::LivePathEffect::LPECopyRotate::doEffect_path(), Inkscape::LivePathEffect::LPEFilletChamfer::doEffect_path(), Inkscape::LivePathEffect::LPEMirrorSymmetry::doEffect_path(), Inkscape::LivePathEffect::LPEPowerStroke::doEffect_path(), Inkscape::UI::Tools::fit_item(), Inkscape::LivePathEffect::LPEPts2Ellipse::gen_iso_frame_paths(), Inkscape::LivePathEffect::LPEPts2Ellipse::gen_perspective_frame_paths(), Inkscape::half_outline(), Spiro::ConverterPath::lineto(), Path::MakePathVector(), pathv_to_cubicbezier(), pathv_to_linear(), pathv_to_linear_and_cubic_beziers(), Inkscape::Extension::Internal::PrintEmf::pathv_to_simple_polygon(), portion(), portion(), portion(), Spiro::ConverterPath::quadto(), Inkscape::Extension::Internal::PrintMetafile::rect_cutter(), Inkscape::LivePathEffect::LPESlice::splititem(), TEST_F(), TEST_F(), Inkscape::LivePathEffect::LPEPts2Ellipse::unit_arc_path(), and wrap_path().
|
inline |
Check whether the path is closed.
Definition at line 503 of file path.h.
References _closed.
Referenced by allNearestTimes(), cairo_path(), cairo_path(), count_path_curves(), count_path_degenerations(), count_path_nodes(), Geom::distance(), Inkscape::LivePathEffect::LPEFillBetweenStrokes::doEffect(), Geom::PathSink::feed(), feed_path_to_cairo(), feed_path_to_cairo(), Geom::find_direction_of_travel(), Inkscape::LivePathEffect::findShadowedTime(), Inkscape::half_outline(), Path::LoadPath(), Inkscape::outline(), Inkscape::LivePathEffect::LPEOffset::sp_get_offset(), sp_svg_write_path(), TEST_F(), TEST_F(), TEST_F(), TEST_F(), and wrap_path().
|
inline |
Get the closing segment of the path.
Definition at line 561 of file path.h.
References _closing_seg.
Get the curve at the specified time value.
t | Time value |
rest | Optional storage for the corresponding time value in the curve |
Definition at line 440 of file path.cpp.
References _factorTime(), at(), Geom::PathTime::curve_index, and Geom::PathTime::t.
Referenced by Inkscape::LivePathEffect::LPEPowerStroke::doEffect_path(), and Geom::find_direction_of_travel().
Get the curve at the specified path time.
Definition at line 459 of file path.cpp.
References at(), and Geom::PathTime::curve_index.
|
private |
Definition at line 1068 of file path.cpp.
References _closed, _closing_seg, _data, c, Geom::BezierCurve::finalPoint(), Geom::BezierCurve::initialPoint(), Geom::BezierCurve::setFinal(), and Geom::BezierCurve::setInitial().
Referenced by append(), append(), append(), appendNew(), and stitchTo().
|
private |
Definition at line 997 of file path.cpp.
References _closed, _closing_seg, _data, _exception_on_stitch, back_open(), checkContinuity(), finalPoint(), front(), initialPoint(), Geom::BezierCurve::initialPoint(), Geom::BezierCurve::setFinal(), Geom::BezierCurve::setInitial(), and size_open().
Referenced by erase(), erase(), insert(), insert(), replace(), and replace().
|
inline |
Check whether path is empty.
The path is empty if it contains only the closing segment, which according to the continuity invariant must be degenerate. Note that unlike standard containers, two empty paths are not necessarily identical, because the degenerate closing segment may be at a different point, affecting the operation of methods such as appendNew().
Definition at line 500 of file path.h.
References _data.
Referenced by Inkscape::UI::Tools::PencilTool::addPowerStrokePencil(), back_open(), SPCurve::backspace(), boundsExact(), boundsFast(), count_path_curves(), count_path_degenerations(), count_path_nodes(), Inkscape::LivePathEffect::LPECopyRotate::doEffect_path(), extrema(), feed_path_to_cairo(), feed_path_to_cairo(), SPCurve::first_segment(), SPCurve::last_segment(), Path::LoadPath(), Geom::parting_point(), Geom::path_direction(), Geom::path_mono_splits(), SPCurve::penultimate_point(), reversed(), SPCurve::second_point(), Inkscape::LivePathEffect::LPECopyRotate::split(), stitchTo(), Inkscape::LivePathEffect::stretch_along(), and wrap_path().
|
inline |
Definition at line 470 of file path.h.
References end_default().
|
inline |
Definition at line 465 of file path.h.
References end_default().
Referenced by Geom::PlanarGraph< EdgeLabel >::_mergeShorterLonger(), append(), appendPortionTo(), arc_length_integrating(), arc_length_integrating(), arc_length_subdividing(), boundsExact(), boundsFast(), cairo_curve(), cairo_path(), cairo_path_stitches(), cairo_path_stitches(), Inkscape::LivePathEffect::LPEGears::doEffect_path(), finalUnitTangent(), SPCurve::last_point_additive_move(), replace(), and replace().
|
inline |
Definition at line 473 of file path.h.
References size_closed().
|
inline |
|
inline |
Definition at line 471 of file path.h.
References size_default().
|
inline |
Definition at line 466 of file path.h.
References size_default().
Referenced by count_path_degenerations(), end(), end(), nearestTimePerCurve(), and toPwSb().
|
inline |
Definition at line 472 of file path.h.
References size_open().
|
inline |
Definition at line 467 of file path.h.
References size_open().
Referenced by append(), count_path_degenerations(), Geom::PathSink::feed(), feed_path_to_cairo(), feed_path_to_cairo(), Inkscape::Extension::Internal::PrintEmf::get_pathrect_corner(), pathv_to_cubicbezier(), Inkscape::Extension::Internal::PrintEmf::pathv_to_rect(), sp_svg_write_path(), and withoutDegenerateCurves().
Definition at line 922 of file path.cpp.
References _unshare(), do_update(), and seq_iter().
void Path::erase | ( | iterator | pos | ) |
Definition at line 913 of file path.cpp.
References _unshare(), do_update(), and seq_iter().
Referenced by erase_last(), and Inkscape::half_outline().
|
inline |
Definition at line 700 of file path.h.
References erase(), and size().
Referenced by SPCurve::backspace(), Geom::PathIteratorSink< OutputIterator >::backspace(), SPCurve::closepath_current(), Inkscape::half_outline(), and wrap_path().
PathExtrema Path::extrema | ( | Dim2 | d | ) | const |
Find the extrema of the specified coordinate.
Returns a PathExtrema struct describing "witness" points on the path where the specified coordinate attains its minimum and maximum values.
A closure to update the current minimum and maximum values.
Definition at line 88 of file path-extrema.cpp.
References _data, Geom::derivative(), empty(), Geom::find_direction_of_travel(), initialPoint(), Geom::PathExtrema::min_point, origin, Geom::other_dimension(), root, and Geom::Bezier::roots().
|
inline |
Definition at line 462 of file path.h.
References back_default().
Referenced by Inkscape::LivePathEffect::LPETransform2Pts::doOnApply().
|
inline |
Get the last point in the path.
If the path is closed, this is always the same as the initial point.
Definition at line 709 of file path.h.
References _closed, and _closing_seg.
Referenced by SPHatchPath::_readHatchPathVector(), SPCurve::append_continuous(), appendNew(), cairo_path(), cairo_path(), do_update(), Inkscape::LivePathEffect::LPETaperStroke::doBeforeEffect(), Inkscape::LivePathEffect::LPEAttachPath::doEffect(), Inkscape::LivePathEffect::LPEFillBetweenMany::doEffect(), Inkscape::LivePathEffect::LPEFillBetweenStrokes::doEffect(), Inkscape::LivePathEffect::LPEFilletChamfer::doEffect_path(), Inkscape::LivePathEffect::LPEPowerStroke::doEffect_path(), Inkscape::LivePathEffect::FilletChamferKnotHolderEntity::knot_get(), SPCurve::last_point(), SPCurve::last_point_additive_move(), Inkscape::outline_join(), Geom::path_mono_splits(), reversed(), SPCurve::second_point(), Inkscape::LivePathEffect::LPECopyRotate::split(), TEST_F(), Tracer::worker_helper(), and wrap_path().
|
inline |
Get the unit tangent vector at the end of the path, or the zero vector if undefined.
Definition at line 724 of file path.h.
References begin(), and end().
Referenced by Geom::PlanarGraph< EdgeLabel >::_mergeShorterLonger(), and Geom::find_direction_of_travel().
|
inline |
Access the first curve in the path.
Since the curve always contains at least a degenerate closing segment, it is always safe to use this method.
Definition at line 443 of file path.h.
References _data.
Referenced by boundsExact(), boundsFast(), do_update(), Inkscape::LivePathEffect::LPEAttachPath::doEffect(), Inkscape::LivePathEffect::LPEFillBetweenMany::doEffect(), Geom::PathSink::feed(), SPCurve::first_segment(), Geom::PathVector::front(), Geom::PathVector::front(), SPShape::get_markers(), Inkscape::half_outline(), Inkscape::outline_join(), reversed(), and Inkscape::LivePathEffect::sp_bspline_do_effect().
|
inline |
|
inline |
Get the first point in the path.
Definition at line 705 of file path.h.
References _closing_seg.
Referenced by Geom::PathIteratorSink< OutputIterator >::append(), bounds_exact_transformed(), cairo_path(), cairo_path(), check_simple_rect(), close(), SPCurve::closepath_current(), Geom::PlanarGraph< EdgeLabel >::deviatesLeft(), do_update(), Inkscape::LivePathEffect::LPETaperStroke::doBeforeEffect(), Inkscape::Extension::Internal::PovOutput::doCurve(), Inkscape::LivePathEffect::LPEAttachPath::doEffect(), Inkscape::LivePathEffect::LPEFillBetweenMany::doEffect(), Inkscape::LivePathEffect::LPEFillBetweenStrokes::doEffect(), Inkscape::LivePathEffect::LPEDashedStroke::doEffect_path(), Inkscape::LivePathEffect::LPEPowerStroke::doEffect_path(), Inkscape::LivePathEffect::LPETransform2Pts::doEffect_pwd2(), extrema(), feed_path_to_cairo(), feed_path_to_cairo(), SPCurve::first_point(), Inkscape::half_outline(), Inkscape::LivePathEffect::FilletChamferKnotHolderEntity::knot_get(), Path::LoadPath(), Inkscape::outline(), Inkscape::outline_join(), Geom::parting_point(), Geom::path_mono_splits(), pathv_to_cubicbezier(), SPCurve::penultimate_point(), reversed(), sp_svg_write_path(), Inkscape::LivePathEffect::LPECopyRotate::split(), TEST_F(), toPwSb(), and wrap_path().
|
inline |
Get the unit tangent vector at the start of the path, or the zero vector if undefined.
Definition at line 713 of file path.h.
Referenced by Geom::PlanarGraph< EdgeLabel >::_mergeShorterLonger(), Geom::PlanarGraph< EdgeLabel >::deviatesLeft(), and Geom::find_direction_of_travel().
Definition at line 904 of file path.cpp.
References _unshare(), do_update(), and seq_iter().
Referenced by appendPortionTo().
|
inline |
Definition at line 686 of file path.h.
References _unshare(), do_update(), and seq_iter().
std::vector< PathIntersection > Path::intersect | ( | Path const & | other, |
Coord | precision = EPSILON |
||
) | const |
Compute intersections with another path.
Definition at line 575 of file path.cpp.
References Geom::Sweeper< SweepSet >::process(), result, and size().
std::vector< PathIntersection > Path::intersectSelf | ( | Coord | precision = EPSILON | ) | const |
Compute intersections of the path with itself.
Definition at line 153 of file self-intersect.cpp.
References Geom::Sweeper< SweepSet >::process(), and result.
|
inline |
Definition at line 733 of file path.cpp.
References _closing_seg, _data, at(), c, Geom::PathTime::curve_index, Geom::distance(), Geom::BezierCurve::initialPoint(), size_default(), and Geom::PathTime::t.
Referenced by Inkscape::do_offset(), and Inkscape::LivePathEffect::LPEAttachPath::doEffect().
Definition at line 723 of file path.cpp.
References begin(), and end_default().
std::vector< Point > Path::nodes | ( | ) | const |
Definition at line 767 of file path.cpp.
References _data, result, and size_closed().
|
inline |
Apply a transform to each curve.
Definition at line 534 of file path.h.
References _data, and _unshare().
bool Path::operator== | ( | Path const & | other | ) | const |
Get the point at the specified time value.
Note that this method has reduced precision with respect to calling pointAt() directly on the curve. If you want high precision results, use the version that takes a PathTime parameter.
Allowed time values range from zero to the number of curves; you can retrieve the allowed range of values with timeRange().
Definition at line 449 of file path.cpp.
References _factorTime(), and pointAt().
Referenced by Inkscape::LivePathEffect::LPEFilletChamfer::addChamferSteps(), Inkscape::LivePathEffect::LPERoughen::addNodesAndJitter(), allNearestTimes(), appendPortionTo(), Inkscape::do_offset(), Inkscape::LivePathEffect::LPEPowerStroke::doEffect_path(), Inkscape::LivePathEffect::LPEVonKoch::doEffect_path(), edges(), Inkscape::find_interior_point(), Geom::mono_pair(), operator()(), Geom::parting_point(), pointAt(), Inkscape::LivePathEffect::LPEOffset::sp_get_offset(), and Inkscape::LivePathEffect::LPECopyRotate::split().
Get the point at the specified path time.
Definition at line 463 of file path.cpp.
References at(), Geom::PathTime::curve_index, Geom::Curve::pointAt(), and Geom::PathTime::t.
Definition at line 645 of file path.h.
References appendPortionTo(), and close().
Referenced by Geom::PlanarGraph< EdgeLabel >::_mergeShorterLonger(), change_endpts(), Inkscape::LivePathEffect::LPEDashedStroke::doEffect_path(), Inkscape::LivePathEffect::LPEPowerStroke::doEffect_path(), Inkscape::LivePathEffect::LPETaperStroke::doEffect_simplePath(), Inkscape::LivePathEffect::FilletChamferKnotHolderEntity::knot_get(), Inkscape::LivePathEffect::path_from_piecewise_fix_cusps(), Inkscape::LivePathEffect::LPECopyRotate::split(), and TEST_F().
Definition at line 652 of file path.h.
References Geom::GenericInterval< C >::max(), Geom::GenericInterval< C >::min(), and portion().
Referenced by portion().
|
inline |
Get a subset of the current path with full precision.
This version allows you to explicitly pass a PathInterval.
Definition at line 669 of file path.h.
References appendPortionTo(), and close().
|
inline |
Get a subset of the current path with full precision.
When from is larger (later in the path) than to, the returned portion will be reversed. If cross_start is true, the portion will be reversed and will cross the initial point of the path. Therefore, when from is larger than to and cross_start is true, the returned portion will not be reversed, but will "wrap around" the end of the path.
Definition at line 660 of file path.h.
References appendPortionTo(), and close().
Definition at line 948 of file path.cpp.
References _unshare(), do_update(), and seq_iter().
|
inline |
Definition at line 781 of file path.h.
References _unshare(), do_update(), and seq_iter().
|
inline |
Path Path::reversed | ( | ) | const |
Obtain a reversed version of the current path.
The final point of the current path will become the initial point of the reversed path, unless it is closed and has a non-degenerate closing segment. In that case, the new initial point will be the final point of the last "real" segment.
Definition at line 866 of file path.cpp.
References _closed, _closing_seg, _data, _includesClosingSegment(), empty(), finalPoint(), front(), initialPoint(), and Geom::Path::ClosingSegment::reverse().
Referenced by Geom::PlanarGraph< EdgeLabel >::_getPathImpl(), Geom::PlanarGraph< EdgeLabel >::_reglueTeardrop(), Geom::PlanarGraph< EdgeLabel >::deviatesLeft(), Inkscape::LivePathEffect::LPEFillBetweenMany::doEffect(), Inkscape::LivePathEffect::LPEFillBetweenStrokes::doEffect(), Inkscape::outline(), Inkscape::LivePathEffect::LPERoughHatches::smoothSnake(), TEST(), and wrap_path().
|
inlinestaticprivate |
Definition at line 835 of file path.h.
References Geom::PathInternal::BaseIterator< P >::index, and Geom::PathInternal::BaseIterator< P >::path.
|
inlinestaticprivate |
Definition at line 832 of file path.h.
References Geom::PathInternal::BaseIterator< P >::index, and Geom::PathInternal::BaseIterator< P >::path.
Referenced by erase(), erase(), insert(), insert(), replace(), and replace().
|
inline |
Definition at line 740 of file path.h.
References _closed, _closing_seg, _data, _unshare(), Geom::BezierCurve::setInitial(), and size_open().
Referenced by Geom::PlanarGraph< EdgeLabel >::_mergeShorterLonger(), SPCurve::closepath_current(), Inkscape::LivePathEffect::LPETaperStroke::doBeforeEffect(), Inkscape::LivePathEffect::LPECopyRotate::doEffect_path(), SPCurve::last_point_additive_move(), SPCurve::move_endpoints(), Inkscape::outline_join(), snapEnds(), Inkscape::LivePathEffect::sp_bspline_do_effect(), and Inkscape::LivePathEffect::LPECopyRotate::split().
|
inline |
Definition at line 734 of file path.h.
References _closed, _closing_seg, _data, _unshare(), and Geom::BezierCurve::setFinal().
Referenced by Geom::PlanarGraph< EdgeLabel >::_mergeShorterLonger(), SPCurve::append_continuous(), Inkscape::LivePathEffect::LPEMeasureSegments::doBeforeEffect(), Inkscape::LivePathEffect::LPEFillBetweenMany::doEffect(), Inkscape::LivePathEffect::LPEFillBetweenStrokes::doEffect(), Inkscape::LivePathEffect::LPEMirrorSymmetry::doEffect_path(), and SPCurve::move_endpoints().
|
inline |
Enable or disable the throwing of exceptions when stitching discontinuities.
Normally stitching will cause exceptions, but when you are working with unsanitized curve data, you can disable these exceptions.
Definition at line 827 of file path.h.
References _exception_on_stitch.
Referenced by Spiro::ConverterPath::ConverterPath(), Geom::PlanarGraph< EdgeLabel >::deviatesLeft(), Inkscape::LivePathEffect::LPEKnot::doEffect_path(), Geom::PathIntersectionGraph::fragments(), Inkscape::LivePathEffect::LPEPts2Ellipse::gen_iso_frame_paths(), Inkscape::LivePathEffect::LPEPts2Ellipse::gen_perspective_frame_paths(), Inkscape::half_outline(), SPCurve::moveto(), pathv_to_linear_and_cubic_beziers(), plot(), Geom::PathIteratorSink< OutputIterator >::setStitching(), Inkscape::LivePathEffect::LPERoughHatches::smoothSnake(), TEST_F(), and Inkscape::LivePathEffect::LPEPts2Ellipse::unit_arc_path().
|
inline |
Natural size of the path.
Definition at line 490 of file path.h.
References size_default().
Referenced by Geom::PlanarGraph< EdgeLabel >::_pathEnd(), Geom::PlanarGraph< EdgeLabel >::_reversePathTime(), allNearestTimes(), appendPortionTo(), arc_length_integrating(), Geom::are_near(), Geom::PathIteratorSink< OutputIterator >::backspace(), cairo_path(), cairo_path(), SPCurve::closepath_current(), Geom::curve_sweep(), Geom::distance(), Inkscape::LivePathEffect::LPETaperStroke::doBeforeEffect(), Inkscape::LivePathEffect::LPEAttachPath::doEffect(), Inkscape::LivePathEffect::LPEVonKoch::doEffect_path(), Inkscape::LivePathEffect::LPETaperStroke::doEffect_simplePath(), erase_last(), Geom::find_direction_of_travel(), Inkscape::half_outline(), Geom::Interpolate::CubicBezierFit::interpolateToPath(), Geom::Interpolate::SpiroInterpolator::interpolateToPath(), Geom::Interpolate::CentripetalCatmullRomInterpolator::interpolateToPath(), intersect(), main(), main(), ordered_fit(), Inkscape::outline(), Inkscape::outline_join(), Inkscape::LivePathEffect::VonKochRefPathParam::param_readSVGValue(), Geom::parting_point(), Geom::path_mono_splits(), Inkscape::UI::Tools::PencilTool::powerStrokeInterpolate(), Inkscape::LivePathEffect::return_at_first_cusp(), roots(), Inkscape::LivePathEffect::sp_pathvector_boolop_slice_intersect(), TEST_F(), TEST_F(), TEST_F(), and withoutDegenerateCurves().
|
inline |
Size with the closing segment, if it makes a difference.
If the closing segment is degenerate, i.e. its initial and final points are exactly equal, then it is not included in this size.
Definition at line 481 of file path.h.
References _closing_seg, _data, and Geom::BezierCurveN< degree >::isDegenerate().
Referenced by appendPortionTo(), appendPortionTo(), end_closed(), end_closed(), nodes(), and size_default().
|
inline |
Natural size of the path.
Definition at line 486 of file path.h.
References _includesClosingSegment(), size_closed(), and size_open().
Referenced by _factorTime(), allNearestTimes(), Geom::bounds(), count_path_curves(), count_path_nodes(), end_default(), end_default(), Inkscape::UI::Tools::MarkerTool::get_marker_transform(), SPShape::get_markers(), Inkscape::half_outline(), nearestTime(), path_getitem(), size(), Inkscape::LivePathEffect::size_nondegenerate(), and timeRange().
|
inline |
Size without the closing segment, even if the path is closed.
Definition at line 476 of file path.h.
References _data.
Referenced by do_update(), Inkscape::LivePathEffect::LPEPowerStroke::doEffect_path(), end_open(), end_open(), Inkscape::half_outline(), Inkscape::LivePathEffect::path_from_piecewise_fix_cusps(), setFinal(), size_default(), and Inkscape::LivePathEffect::size_nondegenerate().
Reduce the closing segment to a point if it's shorter than precision.
Do this by moving the final point.
Definition at line 969 of file path.cpp.
References _closed, _closing_seg, _data, _unshare(), Geom::are_near(), Geom::BezierCurve::finalPoint(), Geom::BezierCurve::length(), setFinal(), and Geom::BezierCurve::setInitial().
Referenced by Inkscape::LivePathEffect::LPEFillBetweenMany::doEffect(), and Inkscape::LivePathEffect::LPEFillBetweenStrokes::doEffect().
void Path::start | ( | Point const & | p | ) |
Definition at line 426 of file path.cpp.
References _closing_seg, _data, clear(), Geom::BezierCurve::setFinal(), and Geom::BezierCurve::setInitial().
Referenced by Geom::PlanarGraph< EdgeLabel >::_mergeShorterLonger(), Inkscape::ObjectSnapper::_snapPathsConstrained(), Inkscape::LivePathEffect::LPECopyRotate::addCanvasIndicators(), Inkscape::LivePathEffect::LPEMirrorSymmetry::addCanvasIndicators(), Inkscape::LivePathEffect::LPESlice::addCanvasIndicators(), Inkscape::LivePathEffect::LPETransform2Pts::addCanvasIndicators(), Inkscape::Text::Layout::baseline(), Inkscape::UI::Tools::MeasureTool::createAngleDisplayCurve(), Inkscape::LivePathEffect::LPEMeasureSegments::createLine(), Inkscape::LivePathEffect::LPEFilletChamfer::doEffect_path(), Inkscape::LivePathEffect::LPETransform2Pts::doEffect_pwd2(), Inkscape::LivePathEffect::LPEShowHandles::drawHandleLine(), Inkscape::LivePathEffect::LPESimplify::drawHandleLine(), Inkscape::UI::Tools::fit_item(), Inkscape::half_outline(), Geom::Interpolate::Linear::interpolateToPath(), Geom::Interpolate::CubicBezierFit::interpolateToPath(), Geom::Interpolate::CubicBezierJohan::interpolateToPath(), Geom::Interpolate::CubicBezierSmooth::interpolateToPath(), interpolateToPath(), interpolateToPath2(), Path::MakePathVector(), Spiro::ConverterPath::moveto(), Geom::PathIteratorSink< OutputIterator >::moveTo(), pathv_to_cubicbezier(), pathv_to_linear(), pathv_to_linear_and_cubic_beziers(), Inkscape::Extension::Internal::PrintEmf::pathv_to_simple_polygon(), Inkscape::Extension::Internal::PrintMetafile::rect_cutter(), Inkscape::LivePathEffect::LPEBendPath::resetDefaults(), Inkscape::LivePathEffect::LPECurveStitch::resetDefaults(), Inkscape::LivePathEffect::LPEEnvelope::resetDefaults(), Inkscape::UI::Tools::MeasureTool::setLine(), Inkscape::UI::Tools::MeasureTool::showCanvasItems(), TEST_F(), and wrap_path().
|
private |
void Path::stitchTo | ( | Point const & | p | ) |
Append a stitching segment ending at the specified point.
Definition at line 932 of file path.cpp.
References _closing_seg, _exception_on_stitch, _unshare(), do_append(), empty(), and Geom::BezierCurve::initialPoint().
Referenced by append(), append(), append(), and appendPortionTo().
|
inlinenoexcept |
Swap contents with another path.
Definition at line 424 of file path.h.
References _closed, _closing_seg, _data, _exception_on_stitch, and swap.
Interval Path::timeRange | ( | ) | const |
Get the allowed range of time values.
Definition at line 434 of file path.cpp.
References size_default().
Referenced by Geom::parting_point().
Definition at line 388 of file path.cpp.
References begin(), end_default(), initialPoint(), Geom::Piecewise< T >::push(), and Geom::Piecewise< T >::push_cut().
Referenced by Inkscape::UI::Tools::PencilTool::_sketchInterpolate(), Geom::PlanarGraph< EdgeLabel >::closedPathArea(), Inkscape::LivePathEffect::LPEPowerStroke::doEffect_path(), Inkscape::LivePathEffect::LPEExtrude::doEffect_pwd2(), Inkscape::is_path_empty(), Geom::path_direction(), Inkscape::LivePathEffect::LPEBendPath::resetDefaults(), Inkscape::LivePathEffect::LPECurveStitch::resetDefaults(), Inkscape::LivePathEffect::LPEEnvelope::resetDefaults(), Inkscape::LivePathEffect::LPERoughHatches::smoothSnake(), Inkscape::LivePathEffect::stretch_along(), SPCurve::stretch_endpoints(), Inkscape::LivePathEffect::LPEDashedStroke::timeAtLength(), and wrap_path().
Get one coordinate (X or Y) at the specified time value.
Definition at line 454 of file path.cpp.
References _factorTime(), and valueAt().
Referenced by Geom::path_mono_splits(), TEST_F(), and valueAt().
Get one coordinate at the specified path time.
Definition at line 467 of file path.cpp.
References at(), Geom::PathTime::curve_index, Geom::PathTime::t, and Geom::Curve::valueAt().
int Path::winding | ( | Point const & | p | ) | const |
Determine the winding number at the specified point.
The winding number is the number of full turns made by a ray that connects the passed point and the path's value (i.e. the result of the pointAt() method) as the time increases from 0 to the maximum valid value. Positive numbers indicate turns in the direction of increasing angles.
Winding numbers are often used as the definition of what is considered "inside" the shape. Typically points with either nonzero winding or odd winding are considered to be inside the path.
Definition at line 595 of file path.cpp.
References begin(), bounds, end_closed(), Geom::GenericRect< C >::height(), Geom::GenericRect< C >::left(), Geom::GenericRect< C >::right(), Geom::X, and Geom::Y.
Referenced by Inkscape::find_interior_point(), Inkscape::UI::ControlPointSelection::selectArea(), TEST_F(), and Geom::winding().
Path Path::withoutDegenerateCurves | ( | ) | const |
Swap contents of two paths.
Definition at line 433 of file path.h.
Referenced by allNearestTimes(), and swap().
|
private |
Definition at line 862 of file path.h.
Referenced by _includesClosingSegment(), clear(), close(), closed(), do_append(), do_update(), finalPoint(), operator==(), Path(), reversed(), setFinal(), setInitial(), snapEnds(), swap(), and withoutDegenerateCurves().
|
private |
Definition at line 861 of file path.h.
Referenced by _includesClosingSegment(), _unshare(), back_closed(), clear(), close(), closingSegment(), do_append(), do_update(), finalPoint(), initialPoint(), nearestTime(), Path(), Path(), Path(), Path(), Path(), Path(), reversed(), setFinal(), setInitial(), size_closed(), snapEnds(), start(), stitchTo(), and swap().
|
private |
Definition at line 860 of file path.h.
Referenced by _unshare(), at(), back_closed(), back_open(), boundsFast(), checkContinuity(), clear(), close(), do_append(), do_update(), empty(), extrema(), front(), initialCurve(), max_size(), nearestTime(), nodes(), operator*=(), operator==(), operator[](), Path(), Path(), Path(), Path(), Path(), Path(), reversed(), setFinal(), setInitial(), size_closed(), size_open(), snapEnds(), start(), and swap().
|
private |
Definition at line 863 of file path.h.
Referenced by do_update(), setStitching(), stitchTo(), and swap().