Donner
C++20 SVG rendering library
Loading...
Searching...
No Matches
donner::svg::PathSpline::Builder Class Reference

Builder to construct a new PathSpline. More...

#include "donner/svg/core/PathSpline.h"

Public Member Functions

 Builder ()
 Construct a new Builder.
 
BuildermoveTo (const Vector2d &point)
 Move the starting point of the spline to a new point, creating a new subpath.
 
BuilderlineTo (const Vector2d &point)
 Draw a line from the current point to a new point.
 
BuildercurveTo (const Vector2d &point1, const Vector2d &point2, const Vector2d &point3)
 Draw a bézier curve from the current point to point3, using point1 and point2 as anchors.
 
BuilderarcTo (const Vector2d &radius, double rotationRadians, bool largeArcFlag, bool sweepFlag, const Vector2d &endPoint)
 Add an elliptical arc to the path.
 
BuilderclosePath ()
 Close the path.
 
Builderellipse (const Vector2d &center, const Vector2d &radius)
 Draw an ellipse.
 
Buildercircle (const Vector2d &center, double radius)
 Draw a circle.
 
PathSpline build ()
 Construct the PathSpline.
 

Detailed Description

Builder to construct a new PathSpline.

.moveTo({0, 0})
.lineTo({1, 0})
.build();
Builder to construct a new PathSpline.
Definition PathSpline.h:119
Builder & moveTo(const Vector2d &point)
Move the starting point of the spline to a new point, creating a new subpath.
Definition PathSpline.cc:587
PathSpline build()
Construct the PathSpline.
Definition PathSpline.cc:821
Builder & lineTo(const Vector2d &point)
Draw a line from the current point to a new point.
Definition PathSpline.cc:612
Builder & closePath()
Close the path.
Definition PathSpline.cc:774
Container for a spline, which is a series of points connected by lines and curves.
Definition PathSpline.h:23

Member Function Documentation

◆ arcTo()

PathSpline::Builder & donner::svg::PathSpline::Builder::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 to the x-axis of the ellipse formed by the arc.
largeArcFlagfalse for arc length <= 180, true for arc >= 180.
sweepFlagfalse for negative angle, true for positive angle.
endPointEnd point.

◆ circle()

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

Draw a circle.

Parameters
centerCenter of the circle.
radiusRadius.

◆ closePath()

PathSpline::Builder & donner::svg::PathSpline::Builder::closePath ( )

Close the path.

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

◆ curveTo()

PathSpline::Builder & donner::svg::PathSpline::Builder::curveTo ( const Vector2d & point1,
const Vector2d & point2,
const Vector2d & point3 )

Draw a bézier curve from the current point to point3, using point1 and point2 as anchors.

Parameters
point1First control point.
point2Second control point.
point3End point of the curve.

◆ ellipse()

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

Draw an ellipse.

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

◆ lineTo()

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

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

Parameters
pointEnd point of the line.

◆ moveTo()

PathSpline::Builder & donner::svg::PathSpline::Builder::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.

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