Inkscape
Vector Graphics Editor
|
Cubic Bezier path command. More...
#include <path-description.h>
Public Member Functions | |
PathDescrCubicTo (Geom::Point const &pp, Geom::Point const &s, Geom::Point const &e) | |
void | dumpSVG (Inkscape::SVGOStringStream &s, Geom::Point const &last) const override |
A virtual function that derived classes will implement. | |
PathDescr * | clone () const override |
A virtual function that derived classes will implement. | |
void | dump (std::ostream &s) const override |
A virtual function that derived classes will implement. | |
![]() | |
PathDescr () | |
PathDescr (int f) | |
virtual | ~PathDescr ()=default |
int | getType () const |
void | setType (int t) |
Public Attributes | |
Geom::Point | p |
Geom::Point | start |
Geom::Point | end |
![]() | |
int | flags |
int | associated |
double | tSt |
double | tEn |
Cubic Bezier path command.
There is something funny about this one. A typical BezierCurve consists of points p0, p1, p2, p3 where p1 and p2 are control points. This is a command so it's quite expected that p0 is not needed. What's interesting is that instead of storing p1 and p2, (p1 - p0) * 3 and (p3 - p2) * 3 are stored in start and end respectively. I can't see a good reason for why this was done. Because of this, there is additional mess required in the formulas for bezier curve splitting.
Definition at line 130 of file path-description.h.
|
inline |
Definition at line 132 of file path-description.h.
|
overridevirtual |
A virtual function that derived classes will implement.
Returns a newly allocated copy of the path description.
Implements PathDescr.
Definition at line 57 of file path-description.cpp.
|
overridevirtual |
A virtual function that derived classes will implement.
Similar to dumpSVG however this prints a simpler path description that's not SVG, only used for debugging purposes.
s | The stream to print to. |
Reimplemented from PathDescr.
Definition at line 62 of file path-description.cpp.
|
overridevirtual |
A virtual function that derived classes will implement.
Dumps the SVG path d attribute for this path description.
s | The stream to put the SVG description in. |
last | The last point before this path description. This is needed for the computation of SVG descriptions of instructions such as Cubic and Arc. |
Reimplemented from PathDescr.
Definition at line 45 of file path-description.cpp.
Geom::Point PathDescrCubicTo::end |
3 * (p3 - p2) where p3 is the final point of the cubic bezier and p2 is the second control point.
Definition at line 142 of file path-description.h.
Referenced by Path::Convert(), Path::ConvertEvenLines(), Path::ConvertPositionsToForced(), Path::ConvertPositionsToMoveTo(), dump(), dumpSVG(), Path::FastBBox(), Path::InsideOutline(), Path::Outline(), Shape::ReFormeCubicTo(), Path::SubPaths(), and Path::SubPathsWithNesting().
Geom::Point PathDescrCubicTo::p |
The final point of the bezier curve.
Definition at line 139 of file path-description.h.
Referenced by Path::Convert(), Path::ConvertEvenLines(), Path::ConvertForcedToMoveTo(), Path::ConvertPositionsToForced(), Path::ConvertPositionsToMoveTo(), DistanceToCubic(), dump(), dumpSVG(), Path::FastBBox(), Path::PrevPoint(), Shape::ReFormeCubicTo(), Path::SubPaths(), and Path::SubPathsWithNesting().
Geom::Point PathDescrCubicTo::start |
3 * (p1 - p0) where p0 is the start point of the cubic bezier and p1 is the first control point.
Definition at line 140 of file path-description.h.
Referenced by Path::Convert(), Path::ConvertEvenLines(), Path::ConvertPositionsToForced(), Path::ConvertPositionsToMoveTo(), dump(), dumpSVG(), Path::FastBBox(), Path::InsideOutline(), Path::Outline(), Shape::ReFormeCubicTo(), Path::SubPaths(), and Path::SubPathsWithNesting().