Inkscape
Vector Graphics Editor
Loading...
Searching...
No Matches
Geom::PathIteratorSink< OutputIterator > Class Template Reference

Store paths to an output iterator. More...

#include <path-sink.h>

Inheritance diagram for Geom::PathIteratorSink< OutputIterator >:
Geom::PathSink

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.
 
- Public Member Functions inherited from Geom::PathSink
virtual ~PathSink ()
 

Protected Attributes

bool _in_path
 
OutputIterator _out
 
Path _path
 
Point _start_p
 

Detailed Description

template<typename OutputIterator>
class Geom::PathIteratorSink< OutputIterator >

Store paths to an output iterator.

Definition at line 116 of file path-sink.h.

Constructor & Destructor Documentation

◆ PathIteratorSink()

template<typename OutputIterator >
Geom::PathIteratorSink< OutputIterator >::PathIteratorSink ( OutputIterator  out)
inlineexplicit

Definition at line 118 of file path-sink.h.

Member Function Documentation

◆ append()

◆ arcTo()

template<typename OutputIterator >
void Geom::PathIteratorSink< OutputIterator >::arcTo ( Coord  rx,
Coord  ry,
Coord  angle,
bool  large_arc,
bool  sweep,
Point const &  p 
)
inlineoverridevirtual

◆ backspace()

template<typename OutputIterator >
bool Geom::PathIteratorSink< OutputIterator >::backspace ( )
inlineoverridevirtual

Undo the last segment.

This method is optional.

Returns
true true if a segment was erased, false otherwise.

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().

◆ closePath()

◆ curveTo()

◆ feed() [1/7]

template<typename OutputIterator >
void Geom::PathSink::feed ( Circle const &  e)
virtual

Output a circle as two elliptical arcs.

Reimplemented from Geom::PathSink.

Definition at line 106 of file path-sink.cpp.

◆ feed() [2/7]

template<typename OutputIterator >
void Geom::PathSink::feed ( Curve const &  c,
bool  moveto_initial = true 
)
virtual

Reimplemented from Geom::PathSink.

Definition at line 89 of file path-sink.cpp.

◆ feed() [3/7]

template<typename OutputIterator >
void Geom::PathSink::feed ( Ellipse const &  e)
virtual

Output an ellipse as two elliptical arcs.

Reimplemented from Geom::PathSink.

Definition at line 108 of file path-sink.cpp.

◆ feed() [4/7]

template<typename OutputIterator >
void Geom::PathIteratorSink< OutputIterator >::feed ( Path const &  p)
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:

virtual void feed(Curve const &c, bool moveto_initial=true)
Definition path-sink.cpp:39

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().

◆ feed() [5/7]

template<typename OutputIterator >
void Geom::PathSink::feed ( Path const &  p)
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.

◆ feed() [6/7]

template<typename OutputIterator >
void Geom::PathSink::feed ( PathVector const &  v)
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.

◆ feed() [7/7]

template<typename OutputIterator >
void Geom::PathSink::feed ( Rect const &  r)
virtual

Output an axis-aligned rectangle, using moveTo, lineTo and closePath.

Reimplemented from Geom::PathSink.

Definition at line 104 of file path-sink.cpp.

◆ flush()

template<typename OutputIterator >
void Geom::PathIteratorSink< OutputIterator >::flush ( )
inlineoverridevirtual

◆ inPath()

template<typename OutputIterator >
bool Geom::PathIteratorSink< OutputIterator >::inPath ( ) const
inline

Detect if the builder is in a path and thus will NOT create a new moveTo command when given the next line.

Returns
true if the builder is inside a subpath.

Definition at line 133 of file path-sink.h.

References Geom::PathIteratorSink< OutputIterator >::_in_path.

◆ lineTo()

◆ moveTo()

◆ quadTo()

template<typename OutputIterator >
void Geom::PathIteratorSink< OutputIterator >::quadTo ( Point const &  c,
Point const &  p 
)
inlineoverridevirtual

◆ setStitching()

template<typename OutputIterator >
void Geom::PathIteratorSink< OutputIterator >::setStitching ( bool  s)
inline

Member Data Documentation

◆ _in_path

◆ _out

template<typename OutputIterator >
OutputIterator Geom::PathIteratorSink< OutputIterator >::_out
protected

◆ _path

◆ _start_p


The documentation for this class was generated from the following file: