cairomm 1.19.0
|
A single element of a path. More...
#include <cairomm/path.h>
Classes | |
struct | Point |
A simple structure for holding an X and Y coordinate pair. More... | |
Public Types | |
using | cobject = cairo_path_data_t |
The base C cairo type. | |
Public Member Functions | |
Element (cobject *pData) | |
cobject * | cobj () |
Get a pointer to the base cairo type. | |
const cobject * | cobj () const |
Get a const pointer to the base cairo type. | |
Point | operator[] (unsigned int idx) const |
You can access the datapoints that make up a path Element by using array notation. | |
unsigned int | size () const |
Get the number of points in this path element. | |
ElementType | type () const |
Gets the type of element for this path element. | |
Protected Attributes | |
cobject * | m_cobject |
A single element of a path.
Each element has a 'type', which determines how many Points are contained in this element. Use the subscript operator[] to access the sub-points.
Most people will rarely need access to the underlying path data, so this will not be needed very often.
The base C cairo type.
Cairo::Path::Element::Element | ( | cobject * | pData | ) |
|
inline |
Get a pointer to the base cairo type.
Get a const pointer to the base cairo type.
You can access the datapoints that make up a path Element by using array notation.
The index is zero-based, so element[0] gives you the first point.
std::out_of_range | on invalid idx |
Get the number of points in this path element.
This is tightly coupled with the type of Path Element that it is. MOVE_TO and LINE_TO both have a single data point, CURVE_TO has three data points, and CLOSE_PATH has none.
|
inline |
Gets the type of element for this path element.
|
protected |