Donner
C++20 SVG rendering library
Loading...
Searching...
No Matches
Modification

Functions

void donner::svg::PathSpline::moveTo (const Vector2d &point)
 Move the starting point of the spline to a new point, creating a new subpath.
 
void donner::svg::PathSpline::lineTo (const Vector2d &point)
 Draw a line from the current point to a new point.
 
void donner::svg::PathSpline::curveTo (const Vector2d &control1, const Vector2d &control2, const Vector2d &endPoint)
 Draw a cubic Bézier curve from the current point to a new point.
 
void donner::svg::PathSpline::arcTo (const Vector2d &radius, double rotationRadians, bool largeArcFlag, bool sweepFlag, const Vector2d &endPoint)
 Add an elliptical arc to the path.
 
void donner::svg::PathSpline::closePath ()
 Close the path.
 
void donner::svg::PathSpline::ellipse (const Vector2d &center, const Vector2d &radius)
 Draw an ellipse (uses multiple curve segments).
 
void donner::svg::PathSpline::circle (const Vector2d &center, double radius)
 Draw a circle (uses multiple curve segments).
 
void donner::svg::PathSpline::appendJoin (const PathSpline &spline, bool asInternalPath=false)
 Append an existing spline to this spline, joining the two splines together.
 

Detailed Description

Function Documentation

◆ appendJoin()

void donner::svg::PathSpline::appendJoin ( const PathSpline & spline,
bool asInternalPath = false )

Append an existing spline to this spline, joining the two splines together.

This will ignore the moveTo comand at the start of spline.

Parameters
splineSpline to append.
asInternalPathTrue if the spline should be treated as an internal path, which means that markers will not be rendered onto its segments.

◆ arcTo()

void donner::svg::PathSpline::arcTo ( const Vector2d & radius,
double rotationRadians,
bool largeArcFlag,
bool sweepFlag,
const Vector2d & endPoint )

Add an elliptical arc to the path.

Parameters
radiusRadius before rotation.
rotationRadiansRotation of the x-axis of the ellipse.
largeArcFlagFalse for arc length ≤ 180°, true for arc length ≥ 180°.
sweepFlagFalse for negative angle, true for positive angle.
endPointEnd point of the arc.

◆ circle()

void donner::svg::PathSpline::circle ( const Vector2d & center,
double radius )

Draw a circle (uses multiple curve segments).

Parameters
centerCenter of the circle.
radiusRadius.

◆ closePath()

void donner::svg::PathSpline::closePath ( )

Close the path.

An automatic straight line is drawn from the current point back to the initial point of the current subpath.

◆ curveTo()

void donner::svg::PathSpline::curveTo ( const Vector2d & control1,
const Vector2d & control2,
const Vector2d & endPoint )

Draw a cubic Bézier curve from the current point to a new point.

Parameters
control1First control point.
control2Second control point.
endPointEnd point of the curve.

◆ ellipse()

void donner::svg::PathSpline::ellipse ( const Vector2d & center,
const Vector2d & radius )

Draw an ellipse (uses multiple curve segments).

Parameters
centerCenter of the ellipse.
radiusEllipse radius, for both the x and y axis.

◆ lineTo()

void donner::svg::PathSpline::lineTo ( const Vector2d & point)

Draw a line from the current point to a new point.

Parameters
pointEnd point of the line.

◆ moveTo()

void donner::svg::PathSpline::moveTo ( const Vector2d & point)

Move the starting point of the spline to a new point, creating a new subpath.

If this is called multiple times in a row, subsequent calls will replace the previous.

Parameters
pointPoint to move to.