A Path represents a collection of PathContour objects.
More...
#include <path.hpp>
|
class | arc |
| Wraps the data to specify an arc. More...
|
|
class | contour_close |
| Tag class to mark the close of a contour. More...
|
|
class | contour_close_arc |
| Tag class to mark the close of an contour with an arc. More...
|
|
class | contour_end |
| Tag class to mark the end of a contour without adding a closing edge of the contour and start a new contour. More...
|
|
class | contour_start |
| Indicates to end the existing contour with adding a closing edge of the contour and start a new contour. More...
|
|
class | control_point |
| Class that wraps a vec2 to mark a point as a control point for a Bezier curve. More...
|
|
|
| Path (void) |
|
Path & | add_contour (const reference_counted_ptr< const PathContour > &contour) |
|
Path & | add_contours (const Path &path) |
|
bool | approximate_bounding_box (Rect *out_bb) const |
|
Path & | arc_to (float angle, const vec2 &pt, enum PathEnums::edge_type_t etp=PathEnums::starts_new_edge) |
|
void | clear (void) |
|
Path & | close_contour (enum PathEnums::edge_type_t etp=PathEnums::starts_new_edge) |
|
Path & | close_contour_arc (float angle, enum PathEnums::edge_type_t etp=PathEnums::starts_new_edge) |
|
Path & | close_contour_cubic (const vec2 &ct1, const vec2 &ct2, enum PathEnums::edge_type_t etp=PathEnums::starts_new_edge) |
|
Path & | close_contour_quadratic (const vec2 &ct, enum PathEnums::edge_type_t etp=PathEnums::starts_new_edge) |
|
reference_counted_ptr< const PathContour > | contour (unsigned int i) const |
|
Path & | cubic_to (const vec2 &ct1, const vec2 &ct2, const vec2 &pt, enum PathEnums::edge_type_t etp=PathEnums::starts_new_edge) |
|
PathContour & | current_contour (void) |
|
Path & | end_contour (void) |
|
bool | is_flat (void) const |
|
Path & | line_to (const vec2 &pt, enum PathEnums::edge_type_t etp=PathEnums::starts_new_edge) |
|
Path & | move (const vec2 &pt) |
|
unsigned int | number_contours (void) const |
|
Path & | operator<< (const vec2 &pt) |
|
Path & | operator<< (const control_point &pt) |
|
Path & | operator<< (const arc &a) |
|
Path & | operator<< (contour_close) |
|
Path & | operator<< (contour_end) |
|
Path & | operator<< (contour_close_arc a) |
|
Path & | operator<< (const contour_start &st) |
|
Path & | operator<< (enum PathEnums::edge_type_t etp) |
|
Path & | quadratic_to (const vec2 &ct, const vec2 &pt, enum PathEnums::edge_type_t etp=PathEnums::starts_new_edge) |
|
const ShaderFilledPath & | shader_filled_path (void) const |
|
void | swap (Path &obj) |
|
const TessellatedPath & | tessellation (float thresh) const |
|
const TessellatedPath & | tessellation (void) const |
|
A Path represents a collection of PathContour objects.
Definition at line 668 of file path.hpp.
◆ Path()
fastuidraw::Path::Path |
( |
void |
| ) |
|
|
explicit |
◆ add_contour()
Adds a PathContour to this Path. The current contour remains as the current contour though.
- Parameters
-
◆ add_contours()
Path& fastuidraw::Path::add_contours |
( |
const Path & |
path | ) |
|
◆ approximate_bounding_box()
bool fastuidraw::Path::approximate_bounding_box |
( |
Rect * |
out_bb | ) |
const |
Returns an approximation of the bounding box for this Path. Returns false if the Path is empty.
- Parameters
-
out_bb | (output) location to which to write the bounding box value |
◆ arc_degrees()
static arc fastuidraw::Path::arc_degrees |
( |
float |
angle, |
|
|
const vec2 & |
pt |
|
) |
| |
|
inlinestatic |
Create an arc but specify the angle in degrees.
- Parameters
-
angle | angle of arc in degrees |
pt | point to which to arc |
Definition at line 829 of file path.hpp.
◆ arc_to()
Append an arc curve to the current contour.
- Parameters
-
angle | gives the angle of the arc in radians. For a coordinate system where y increases upwards and x increases to the right, a positive value indicates counter-clockwise and a negative value indicates clockwise |
pt | point to which the arc curve goes |
etp | the edge type of the new arc made; if this is the first edge of the current contour, the value of etp is ignored and the value PathEnums::starts_new_edge is used. |
◆ clear()
void fastuidraw::Path::clear |
( |
void |
| ) |
|
Clear the path, i.e. remove all PathContour's from the path
◆ close_contour()
Close the current contour with a line segment.
- Parameters
-
etp | the edge type of the closing edge made. |
◆ close_contour_arc()
Close the current contour in an arc
- Parameters
-
angle | gives the angle of the arc in radians. For a coordinate system where y increases upwards and x increases to the right, a positive value indicates counter-clockwise and a negative value indicates clockwise |
etp | the edge type of the closing edge made. |
◆ close_contour_cubic()
Close the current contour in a cubic Bezier curve
- Parameters
-
ct1 | first control point of the cubic Bezier curve |
ct2 | second control point of the cubic Bezier curve |
etp | the edge type of the closing edge made. |
◆ close_contour_quadratic()
Close the current contour in a quadratic Bezier curve
- Parameters
-
ct | control point of the quadratic Bezier curve |
etp | the edge type of the closing edge made. |
◆ contour()
Returns the named contour
- Parameters
-
◆ contour_close_arc_degrees()
Create an contour_close_arc but specify the angle in degrees.
- Parameters
-
angle | angle or arc in degrees |
Definition at line 840 of file path.hpp.
◆ cubic_to()
Append a cubic Bezier curve to the current contour.
- Parameters
-
ct1 | first control point of the cubic Bezier curve |
ct2 | second control point of the cubic Bezier curve |
pt | point to which the cubic Bezier curve goes |
etp | the edge type of the new cubic made; if this is the first edge of the current contour, the value of etp is ignored and the value PathEnums::starts_new_edge is used. |
◆ current_contour()
PathContour& fastuidraw::Path::current_contour |
( |
void |
| ) |
|
◆ end_contour()
Path& fastuidraw::Path::end_contour |
( |
void |
| ) |
|
End the current contour without adding a closing edge.
◆ is_flat()
bool fastuidraw::Path::is_flat |
( |
void |
| ) |
const |
◆ line_to()
Append a line to the current contour.
- Parameters
-
pt | point to which the line goes |
etp | the edge type of the new line made; if this is the first edge of the current contour, the value of etp is ignored and the value PathEnums::starts_new_edge is used. |
◆ move()
Path& fastuidraw::Path::move |
( |
const vec2 & |
pt | ) |
|
Begin a new contour.
- Parameters
-
pt | point at which the contour begins |
◆ number_contours()
unsigned int fastuidraw::Path::number_contours |
( |
void |
| ) |
const |
Returns the number of contours of the Path.
◆ operator<<() [1/8]
Path& fastuidraw::Path::operator<< |
( |
const vec2 & |
pt | ) |
|
Operator overload to add a point of the current contour in the Path.
- Parameters
-
◆ operator<<() [2/8]
Operator overload to add a control point of the current contour in the Path.
- Parameters
-
◆ operator<<() [3/8]
Path& fastuidraw::Path::operator<< |
( |
const arc & |
a | ) |
|
Operator overload to add an arc to the current contour in the Path.
- Parameters
-
◆ operator<<() [4/8]
Operator overload to close the current contour
◆ operator<<() [5/8]
Operator overload to end the current contour
◆ operator<<() [6/8]
Operator overload to close the current contour
- Parameters
-
a | specifies the angle of the arc for closing the current contour |
◆ operator<<() [7/8]
Operator overload to start a new contour without closing the current contour.
- Parameters
-
st | specifies the starting point of the new contour |
Definition at line 895 of file path.hpp.
◆ operator<<() [8/8]
Operator overload to control PathEnums::edge_type_t of the next edge made via operator overloads. If no edge is yet present on the current contour, then the value is ignored. The tag is reset back to PathEnums::starts_new_edge after an edge is added.
- Parameters
-
◆ quadratic_to()
Append a quadratic Bezier curve to the current contour.
- Parameters
-
ct | control point of the quadratic Bezier curve |
pt | point to which the quadratic Bezier curve goes |
etp | the edge type of the new quadratic made; if this is the first edge of the current contour, the value of etp is ignored and the value PathEnums::starts_new_edge is used. |
◆ shader_filled_path()
Returns the ShaderFilledPath coming from this Path. The returned reference will be null if the Path contains anything besides line segments, quadratic Bezier curves or cubic Bezier curves.
◆ swap()
void fastuidraw::Path::swap |
( |
Path & |
obj | ) |
|
Swap contents of Path with another Path
- Parameters
-
obj | Path with which to swap |
◆ tessellation() [1/2]
const TessellatedPath& fastuidraw::Path::tessellation |
( |
float |
thresh | ) |
const |
Return the tessellation of this Path at a specific level of detail. The TessellatedPath is constructed lazily. Additionally, if this Path changes its geometry, then a new TessellatedPath will be contructed on the next call to tessellation().
- Parameters
-
thresh | the returned tessellated path will be so that TessellatedPath::max_distance() is no more than thresh. A non-positive value will return the lowest level of detail tessellation. |
◆ tessellation() [2/2]
Provided as a conveniance, returns the starting point tessellation. Equivalent to
The documentation for this class was generated from the following file:
- /home/kevin/fastuidraw.krogueintel/inc/fastuidraw/path.hpp