#include <Path.hpp>
Represents a path of beziers
Definition at line 47 of file Path.hpp.
◆ Path() [1/5]
Creates a new empty path
Definition at line 28 of file Path.cpp.
◆ Path() [2/5]
Creates a path with a size with all points at 0
- Parameters
-
Definition at line 36 of file Path.cpp.
◆ Path() [3/5]
Path::Path |
( |
const std::vector< CubicBezier > & | beziers | ) |
|
Creates a path given beziers
- Parameters
-
Definition at line 44 of file Path.cpp.
◆ Path() [4/5]
Path::Path |
( |
const std::vector< Vector2f > & | lines, |
|
|
float | cornerRadius ) |
Creates a path given a closed shape made of lines and a corner radius to use to round each corner of the shape
- Parameters
-
lines | A vector of the lines, each element has a line drawn to the next and the last element has a line drawn to the first |
cornerRadius | The corner radius to use to round the corners of the shape |
Definition at line 53 of file Path.cpp.
◆ Path() [5/5]
Path::Path |
( |
const std::vector< std::pair< Vector2f, float > > & | lines | ) |
|
Creates a path given a closed shape of lines, and a corner radius to use to round each corner of the shape
- Parameters
-
lines | A vector of the lines, each element has a line drawn to the next and the last element has a line drawn to the first. The second item in the pair is the corner radius to the corner created by the specific point, you can use a negative number or 0 to denote no corner rounding. |
Definition at line 67 of file Path.cpp.
◆ arcTo()
Creates an arc (a segment of a circle's circumference) to a point given a center
- Note
- Do not add beziers manually when using path modification methods
- Parameters
-
end | The ending point where the arc ends |
center | The center of the circle of which the arc is drawn to |
clockwise | Whether or not to draw the arc clockwise or counter clockwise to the ending position |
Definition at line 230 of file Path.cpp.
◆ bezierTo()
Moves the path to a new position while drawing a cubic bezier curve to the new position.
- Note
- Do not add beziers manually when using path modification methods
- Parameters
-
controlPoint1 | The first control point of the bezier |
controlPoint2 | The second control point of the bezier |
end | The ending point of the bezier |
Definition at line 216 of file Path.cpp.
◆ closePath()
Closes the path allowing for rendering
- Note
- Do not add beziers manually when using path modification methods, this method closes off the path making it suitable for rendering
Definition at line 272 of file Path.cpp.
◆ getBoundingBox()
Rect Path::getBoundingBox |
( |
| ) |
const |
Gets the bounding box for this path
- Returns
- The bounding box
Definition at line 141 of file Path.cpp.
◆ lineTo()
Moves the path to a new position while drawing a line to the new position.
- Note
- Do not add beziers manually when using path modification methods
- Parameters
-
pos | The position to draw a line to |
Definition at line 202 of file Path.cpp.
◆ moveTo()
Moves the starting point of the path to a certain point.
- Note
- This function must be used when there are no beziers in the path, and other path modification methods must be used directly after.
- Parameters
-
pos | The position to move to |
Definition at line 192 of file Path.cpp.
◆ operator*()
Path Path::operator* |
( |
float | value | ) |
const |
Multiplies this path's points by a value
- Parameters
-
Definition at line 175 of file Path.cpp.
◆ operator+=()
void Path::operator+= |
( |
const Path & | other | ) |
|
Adds another path to this
- Parameters
-
other | The path to add to this |
Definition at line 161 of file Path.cpp.
◆ roundCorners()
void Path::roundCorners |
( |
const std::vector< std::pair< Vector2f, float > > & | lines | ) |
|
|
private |
Creates a path with rounded corners
- Parameters
-
lines | The lines to create the path from |
Definition at line 75 of file Path.cpp.
◆ beziers
The beziers held in this path
Definition at line 61 of file Path.hpp.
The documentation for this class was generated from the following files: