Inkscape
Vector Graphics Editor
Loading...
Searching...
No Matches
PathDescrCubicTo Struct Reference

Cubic Bezier path command. More...

#include <path-description.h>

Inheritance diagram for PathDescrCubicTo:
PathDescr

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.
 
PathDescrclone () 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.
 
- Public Member Functions inherited from PathDescr
 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
 
- Public Attributes inherited from PathDescr
int flags
 
int associated
 
double tSt
 
double tEn
 

Detailed Description

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.

Constructor & Destructor Documentation

◆ PathDescrCubicTo()

PathDescrCubicTo::PathDescrCubicTo ( Geom::Point const &  pp,
Geom::Point const &  s,
Geom::Point const &  e 
)
inline

Definition at line 132 of file path-description.h.

Member Function Documentation

◆ clone()

PathDescr * PathDescrCubicTo::clone ( ) const
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.

◆ dump()

void PathDescrCubicTo::dump ( std::ostream &  ) const
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.

Parameters
sThe stream to print to.

Reimplemented from PathDescr.

Definition at line 62 of file path-description.cpp.

References end, p, start, Geom::X, and Geom::Y.

◆ dumpSVG()

void PathDescrCubicTo::dumpSVG ( Inkscape::SVGOStringStream ,
Geom::Point const &   
) const
overridevirtual

A virtual function that derived classes will implement.

Dumps the SVG path d attribute for this path description.

Parameters
sThe stream to put the SVG description in.
lastThe 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.

References end, p, start, Geom::X, and Geom::Y.

Member Data Documentation

◆ end

Geom::Point PathDescrCubicTo::end

◆ p

◆ start

Geom::Point PathDescrCubicTo::start

The documentation for this struct was generated from the following files: