Inkscape
Vector Graphics Editor
|
Store paths to an output iterator. More...
#include <path-sink.h>
Public Member Functions | |
PathIteratorSink (OutputIterator out) | |
void | moveTo (Point const &p) override |
Move to a different point without creating a segment. | |
bool | inPath () const |
Detect if the builder is in a path and thus will NOT create a new moveTo command when given the next line. | |
void | lineTo (Point const &p) override |
Output a line segment. | |
void | quadTo (Point const &c, Point const &p) override |
Output a cubic Bezier segment. | |
void | curveTo (Point const &c0, Point const &c1, Point const &p) override |
Output a quadratic Bezier segment. | |
void | arcTo (Coord rx, Coord ry, Coord angle, bool large_arc, bool sweep, Point const &p) override |
Output an elliptical arc segment. | |
bool | backspace () override |
Undo the last segment. | |
void | append (Path const &other) |
void | closePath () override |
Close the current path with a line segment. | |
void | flush () override |
Flush any internal state of the generator. | |
void | setStitching (bool s) |
void | feed (Path const &other) override |
Output a subpath. | |
virtual void | feed (Curve const &c, bool moveto_initial=true) |
virtual void | feed (Path const &p) |
Output a subpath. | |
virtual void | feed (PathVector const &v) |
Output a path. | |
virtual void | feed (Rect const &) |
Output an axis-aligned rectangle, using moveTo, lineTo and closePath. | |
virtual void | feed (Circle const &e) |
Output a circle as two elliptical arcs. | |
virtual void | feed (Ellipse const &e) |
Output an ellipse as two elliptical arcs. | |
![]() | |
virtual | ~PathSink () |
Protected Attributes | |
bool | _in_path |
OutputIterator | _out |
Path | _path |
Point | _start_p |
Store paths to an output iterator.
Definition at line 116 of file path-sink.h.
|
inlineexplicit |
Definition at line 118 of file path-sink.h.
|
inline |
Definition at line 181 of file path-sink.h.
References Geom::PathIteratorSink< OutputIterator >::_in_path, Geom::PathIteratorSink< OutputIterator >::_path, Geom::Path::append(), Geom::Path::initialPoint(), and Geom::PathIteratorSink< OutputIterator >::moveTo().
Referenced by Inkscape::outline(), Inkscape::LivePathEffect::path_from_piecewise_fix_cusps(), and SPGenericEllipse::set_shape().
|
inlineoverridevirtual |
Output an elliptical arc segment.
See the EllipticalArc class for the documentation of parameters.
Implements Geom::PathSink.
Definition at line 161 of file path-sink.h.
References Geom::PathIteratorSink< OutputIterator >::_in_path, Geom::PathIteratorSink< OutputIterator >::_path, Geom::PathIteratorSink< OutputIterator >::_start_p, and Geom::PathIteratorSink< OutputIterator >::moveTo().
Referenced by Inkscape::LivePathEffect::path_from_piecewise_fix_cusps().
|
inlineoverridevirtual |
Undo the last segment.
This method is optional.
Reimplemented from Geom::PathSink.
Definition at line 172 of file path-sink.h.
References Geom::PathIteratorSink< OutputIterator >::_in_path, Geom::PathIteratorSink< OutputIterator >::_path, Geom::Path::erase_last(), and Geom::Path::size().
Referenced by Inkscape::LivePathEffect::path_from_piecewise_fix_cusps().
|
inlineoverridevirtual |
Close the current path with a line segment.
Implements Geom::PathSink.
Definition at line 189 of file path-sink.h.
References Geom::PathIteratorSink< OutputIterator >::_in_path, Geom::PathIteratorSink< OutputIterator >::_path, Geom::Path::close(), and Geom::PathIteratorSink< OutputIterator >::flush().
Referenced by getPathV(), Inkscape::outline(), Geom::path_from_piecewise(), SPGenericEllipse::set_shape(), and Inkscape::Trace::Autotrace::AutotraceTracingEngine::trace().
|
inlineoverridevirtual |
Output a quadratic Bezier segment.
Implements Geom::PathSink.
Definition at line 153 of file path-sink.h.
References Geom::PathIteratorSink< OutputIterator >::_in_path, Geom::PathIteratorSink< OutputIterator >::_path, Geom::PathIteratorSink< OutputIterator >::_start_p, and Geom::PathIteratorSink< OutputIterator >::moveTo().
Referenced by Geom::build_from_sbasis(), getPathV(), Inkscape::LivePathEffect::path_from_piecewise_fix_cusps(), and Inkscape::Trace::Autotrace::AutotraceTracingEngine::trace().
|
virtual |
Output a circle as two elliptical arcs.
Reimplemented from Geom::PathSink.
Definition at line 106 of file path-sink.cpp.
|
virtual |
Reimplemented from Geom::PathSink.
Definition at line 89 of file path-sink.cpp.
|
virtual |
Output an ellipse as two elliptical arcs.
Reimplemented from Geom::PathSink.
Definition at line 108 of file path-sink.cpp.
|
inlineoverridevirtual |
Output a subpath.
Calls the appropriate segment methods according to the contents of the passed subpath. You can override this function. NOTE: if you override only some of the feed() functions, always write this in the derived class:
Otherwise the remaining methods will be hidden.
Reimplemented from Geom::PathSink.
Definition at line 209 of file path-sink.h.
References Geom::PathIteratorSink< OutputIterator >::_out, and Geom::PathIteratorSink< OutputIterator >::flush().
Referenced by Inkscape::ObjectSnapper::_snapPathsConstrained().
|
virtual |
Output a subpath.
Calls the appropriate segment methods according to the contents of the passed subpath. You can override this function. NOTE: if you override only some of the feed() functions, always write this in the derived class:
Otherwise the remaining methods will be hidden.
Reimplemented from Geom::PathSink.
Definition at line 99 of file path-sink.cpp.
|
virtual |
Output a path.
Calls feed() on each path in the vector. You can override this function.
Reimplemented from Geom::PathSink.
Definition at line 102 of file path-sink.cpp.
|
virtual |
Output an axis-aligned rectangle, using moveTo, lineTo and closePath.
Reimplemented from Geom::PathSink.
Definition at line 104 of file path-sink.cpp.
|
inlineoverridevirtual |
Flush any internal state of the generator.
This call should implicitly finish the current subpath. Calling this method should be idempotent, because the default implementations of path() and pathvector() will call it multiple times in a row.
Implements Geom::PathSink.
Definition at line 196 of file path-sink.h.
References Geom::PathIteratorSink< OutputIterator >::_in_path, Geom::PathIteratorSink< OutputIterator >::_out, Geom::PathIteratorSink< OutputIterator >::_path, and Geom::Path::clear().
Referenced by Inkscape::ObjectSnapper::_snapPathsConstrained(), Geom::PathIteratorSink< OutputIterator >::closePath(), Geom::PathIteratorSink< OutputIterator >::feed(), getPathV(), FontInstance::LoadGlyph(), Geom::PathIteratorSink< OutputIterator >::moveTo(), Inkscape::outline(), Geom::path_from_piecewise(), Inkscape::LivePathEffect::path_from_piecewise_fix_cusps(), Geom::path_from_sbasis(), SPGenericEllipse::set_shape(), and Inkscape::Trace::Autotrace::AutotraceTracingEngine::trace().
|
inline |
Detect if the builder is in a path and thus will NOT create a new moveTo command when given the next line.
Definition at line 133 of file path-sink.h.
References Geom::PathIteratorSink< OutputIterator >::_in_path.
|
inlineoverridevirtual |
Output a line segment.
Implements Geom::PathSink.
Definition at line 137 of file path-sink.h.
References Geom::PathIteratorSink< OutputIterator >::_in_path, Geom::PathIteratorSink< OutputIterator >::_path, Geom::PathIteratorSink< OutputIterator >::_start_p, and Geom::PathIteratorSink< OutputIterator >::moveTo().
Referenced by Geom::build_from_sbasis(), getPathV(), Inkscape::LivePathEffect::path_from_piecewise_fix_cusps(), SPGenericEllipse::set_shape(), and Inkscape::Trace::Autotrace::AutotraceTracingEngine::trace().
|
inlineoverridevirtual |
Move to a different point without creating a segment.
Usually starts a new subpath.
Implements Geom::PathSink.
Definition at line 121 of file path-sink.h.
References Geom::PathIteratorSink< OutputIterator >::_in_path, Geom::PathIteratorSink< OutputIterator >::_path, Geom::PathIteratorSink< OutputIterator >::_start_p, Geom::PathIteratorSink< OutputIterator >::flush(), and Geom::Path::start().
Referenced by Geom::PathIteratorSink< OutputIterator >::append(), Geom::PathIteratorSink< OutputIterator >::arcTo(), Inkscape::LivePathEffect::buildUnitCircle(), Geom::PathIteratorSink< OutputIterator >::curveTo(), getPathV(), Geom::PathIteratorSink< OutputIterator >::lineTo(), Inkscape::outline(), Geom::path_from_piecewise(), Inkscape::LivePathEffect::path_from_piecewise_fix_cusps(), Geom::path_from_sbasis(), Geom::PathIteratorSink< OutputIterator >::quadTo(), and Inkscape::Trace::Autotrace::AutotraceTracingEngine::trace().
|
inlineoverridevirtual |
Output a cubic Bezier segment.
Implements Geom::PathSink.
Definition at line 145 of file path-sink.h.
References Geom::PathIteratorSink< OutputIterator >::_in_path, Geom::PathIteratorSink< OutputIterator >::_path, Geom::PathIteratorSink< OutputIterator >::_start_p, c, and Geom::PathIteratorSink< OutputIterator >::moveTo().
|
inline |
Definition at line 204 of file path-sink.h.
References Geom::PathIteratorSink< OutputIterator >::_path, and Geom::Path::setStitching().
Referenced by Inkscape::LivePathEffect::path_from_piecewise_fix_cusps().
|
protected |
Definition at line 216 of file path-sink.h.
Referenced by Geom::PathIteratorSink< OutputIterator >::append(), Geom::PathIteratorSink< OutputIterator >::arcTo(), Geom::PathIteratorSink< OutputIterator >::backspace(), Geom::PathIteratorSink< OutputIterator >::closePath(), Geom::PathIteratorSink< OutputIterator >::curveTo(), Geom::PathIteratorSink< OutputIterator >::flush(), Geom::PathIteratorSink< OutputIterator >::inPath(), Geom::PathIteratorSink< OutputIterator >::lineTo(), Geom::PathIteratorSink< OutputIterator >::moveTo(), and Geom::PathIteratorSink< OutputIterator >::quadTo().
|
protected |
Definition at line 217 of file path-sink.h.
Referenced by Geom::PathIteratorSink< OutputIterator >::feed(), and Geom::PathIteratorSink< OutputIterator >::flush().
|
protected |
Definition at line 218 of file path-sink.h.
Referenced by Geom::PathIteratorSink< OutputIterator >::append(), Geom::PathIteratorSink< OutputIterator >::arcTo(), Geom::PathIteratorSink< OutputIterator >::backspace(), Geom::PathIteratorSink< OutputIterator >::closePath(), Geom::PathIteratorSink< OutputIterator >::curveTo(), Geom::PathIteratorSink< OutputIterator >::flush(), Geom::PathIteratorSink< OutputIterator >::lineTo(), Geom::PathIteratorSink< OutputIterator >::moveTo(), Geom::PathIteratorSink< OutputIterator >::quadTo(), and Geom::PathIteratorSink< OutputIterator >::setStitching().
|
protected |
Definition at line 219 of file path-sink.h.
Referenced by Geom::PathIteratorSink< OutputIterator >::arcTo(), Geom::PathIteratorSink< OutputIterator >::curveTo(), Geom::PathIteratorSink< OutputIterator >::lineTo(), Geom::PathIteratorSink< OutputIterator >::moveTo(), and Geom::PathIteratorSink< OutputIterator >::quadTo().