An PathContour represents a single contour within a Path.
More...
#include <path.hpp>
An PathContour represents a single contour within a Path.
Closeing a contour (see close(), close_generic() and close_arc()) means to specify the edge from the last point of the PathContour to the first point.
Definition at line 49 of file path.hpp.
◆ PathContour()
fastuidraw::PathContour::PathContour |
( |
void |
| ) |
|
|
explicit |
◆ add_control_point()
void fastuidraw::PathContour::add_control_point |
( |
const vec2 & |
pt | ) |
|
Add a control point. Will fail if close() was called
- Parameters
-
pt | location of new control point |
◆ approximate_bounding_box()
bool fastuidraw::PathContour::approximate_bounding_box |
( |
Rect * |
out_bb | ) |
const |
Returns an approximation of the bounding box for this PathContour WITHOUT relying on tessellating the interpolator_base objects of this PathContour. Returns false if the box is empty.
- Parameters
-
out_bb | (output) location to which to write the bounding box value |
◆ clear_control_points()
void fastuidraw::PathContour::clear_control_points |
( |
void |
| ) |
|
Clear any current control points.
◆ close()
Closes with the Bezier curve defined by the current control points added by add_control_point().
- Parameters
-
etp | the edge type of the new edge made. |
◆ close_arc()
Closes with an arc.
- Parameters
-
angle | angle of arc in radians |
etp | the edge type of the new edge made. |
◆ close_generic()
void fastuidraw::PathContour::close_generic |
( |
void |
| ) |
|
◆ closed()
bool fastuidraw::PathContour::closed |
( |
void |
| ) |
const |
◆ deep_copy()
◆ end()
void fastuidraw::PathContour::end |
( |
void |
| ) |
|
◆ ended()
bool fastuidraw::PathContour::ended |
( |
void |
| ) |
const |
Returns true if the PathContour is ended, and thus no additional interpolator may be added.
◆ interpolator()
Returns the interpolator of this PathContour that interpolates from the I'th point to the (I + 1)'th point. When the closed() is true, if I is number_points() - 1, then returns the interpolator from the last point to the first point. When closed() is false, if I has value number_points() - 1, then returns a null reference.
◆ is_flat()
bool fastuidraw::PathContour::is_flat |
( |
void |
| ) |
const |
Returns true if each interpolator of the PathContour is flat.
◆ number_interpolators()
unsigned int fastuidraw::PathContour::number_interpolators |
( |
void |
| ) |
const |
◆ number_points()
unsigned int fastuidraw::PathContour::number_points |
( |
void |
| ) |
const |
◆ point()
const vec2& fastuidraw::PathContour::point |
( |
unsigned int |
I | ) |
const |
Return the I'th point of this PathContour. For I = 0, returns the value passed to start().
- Parameters
-
◆ prev_interpolator()
Returns the last interpolator added to this PathContour. If no contours have been added, returns a null reference.
◆ start()
void fastuidraw::PathContour::start |
( |
const vec2 & |
pt | ) |
|
◆ to_arc()
Will fail if close() was called of if add_control_point() has been called more recently than to_point().
- Parameters
-
angle | angle of arc in radians |
pt | point where arc ends (and next edge starts) |
etp | the edge type of the new edge made; if this is the first edge of the contour, the value of etp is ignored and the value PathEnums::starts_new_edge is used. |
◆ to_point()
Close the current edge.
- Parameters
-
pt | point location of end of edge (and thus start of new edge) |
etp | the edge type of the new edge made; if this is the first edge of the contour, the value of etp is ignored and the value PathEnums::starts_new_edge is used. |
The documentation for this class was generated from the following file:
- /home/kevin/fastuidraw.krogueintel/inc/fastuidraw/path.hpp