libSBML C API
5.18.0
|
In order to be able to represent smooth curves the “layout” package defines the class CubicBezier_t. It represents a Bezier curve, and is readily available in most graphics APIs. The class CubicBezier_t is derived from LineSegment_t. It consists of four elements: the two inherited elements 'start' and 'end', which specify the starting point and the endpoint of the cubic bezier curve, and two elements 'basePoint1' and 'basePoint2', which specify the two additional base points that are needed to describe a cubic bezier curve.
Public Member Functions | |
CubicBezier_t * | CubicBezier_clone (const CubicBezier_t *cb) |
CubicBezier_t * | CubicBezier_create () |
Creates a CubicBezier_t and returns the pointer. More... | |
CubicBezier_t * | CubicBezier_createFrom (const CubicBezier_t *temp) |
Creates a CubicBezier_t structure from a template. More... | |
CubicBezier_t * | CubicBezier_createWithCoordinates (double x1, double y1, double z1, double x2, double y2, double z2, double x3, double y3, double z3, double x4, double y4, double z4) |
Creates a CubicBezier_t with the given points and returns the pointer. More... | |
CubicBezier_t * | CubicBezier_createWithPoints (const Point_t *start, const Point_t *base1, const Point_t *base2, const Point_t *end) |
Creates a CubicBezier_t with the given coordinates and returns the pointer. More... | |
void | CubicBezier_free (CubicBezier_t *cb) |
Frees the memory for the cubic bezier. More... | |
Point_t * | CubicBezier_getBasePoint1 (CubicBezier_t *cb) |
Returns the first base point of the curve (the one closer to the starting point). More... | |
Point_t * | CubicBezier_getBasePoint2 (CubicBezier_t *cb) |
Returns the second base point of the curve (the one closer to the end point). More... | |
Point_t * | CubicBezier_getEnd (CubicBezier_t *cb) |
Returns the endpoint of the curve. More... | |
Point_t * | CubicBezier_getStart (CubicBezier_t *cb) |
Returns the starting point of the curve. More... | |
void | CubicBezier_initDefaults (CubicBezier_t *cb) |
Calls initDefaults from LineSegment_t. More... | |
void | CubicBezier_setBasePoint1 (CubicBezier_t *cb, const Point_t *point) |
Initializes the first base point with a copy of the given point. More... | |
void | CubicBezier_setBasePoint2 (CubicBezier_t *cb, const Point_t *point) |
Initializes second base point with a copy of the given point. More... | |
void | CubicBezier_setEnd (CubicBezier_t *cb, const Point_t *point) |
Initializes end point with a copy of the given point. More... | |
void | CubicBezier_setStart (CubicBezier_t *cb, const Point_t *point) |
Initializes start point with a copy of the given point. More... | |
CubicBezier_t * CubicBezier_clone | ( | const CubicBezier_t * | cb | ) |
cb | the CubicBezier_t structure. |
CubicBezier_t * CubicBezier_create | ( | ) |
Creates a CubicBezier_t and returns the pointer.
CubicBezier_t * CubicBezier_createFrom | ( | const CubicBezier_t * | temp | ) |
Creates a CubicBezier_t structure from a template.
temp | the CubicBezier_t structure to copy. |
CubicBezier_t * CubicBezier_createWithCoordinates | ( | double | x1, |
double | y1, | ||
double | z1, | ||
double | x2, | ||
double | y2, | ||
double | z2, | ||
double | x3, | ||
double | y3, | ||
double | z3, | ||
double | x4, | ||
double | y4, | ||
double | z4 | ||
) |
Creates a CubicBezier_t with the given points and returns the pointer.
x1 | the value of the x coordinate of the start Point_t. |
y1 | the value of the y coordinate of the start Point_t. |
z1 | the value of the z coordinate of the start Point_t. |
x2 | the value of the x coordinate of the base1 Point_t. |
y2 | the value of the y coordinate of the base1 Point_t. |
z2 | the value of the z coordinate of the base1 Point_t. |
x3 | the value of the x coordinate of the base2 Point_t. |
y3 | the value of the y coordinate of the base2 Point_t. |
z3 | the value of the z coordinate of the base2 Point_t. |
x4 | the value of the x coordinate of the end Point_t. |
y4 | the value of the y coordinate of the end Point_t. |
z4 | the value of the z coordinate of the end Point_t. |
CubicBezier_t * CubicBezier_createWithPoints | ( | const Point_t * | start, |
const Point_t * | base1, | ||
const Point_t * | base2, | ||
const Point_t * | end | ||
) |
Creates a CubicBezier_t with the given coordinates and returns the pointer.
void CubicBezier_free | ( | CubicBezier_t * | cb | ) |
Frees the memory for the cubic bezier.
cb | the CubicBezier_t structure. |
Point_t * CubicBezier_getBasePoint1 | ( | CubicBezier_t * | cb | ) |
Returns the first base point of the curve (the one closer to the starting point).
cb | the CubicBezier_t structure. |
Point_t * CubicBezier_getBasePoint2 | ( | CubicBezier_t * | cb | ) |
Returns the second base point of the curve (the one closer to the end point).
cb | the CubicBezier_t structure. |
Point_t * CubicBezier_getEnd | ( | CubicBezier_t * | cb | ) |
Returns the endpoint of the curve.
cb | the CubicBezier_t structure. |
Point_t * CubicBezier_getStart | ( | CubicBezier_t * | cb | ) |
Returns the starting point of the curve.
cb | the CubicBezier_t structure. |
void CubicBezier_initDefaults | ( | CubicBezier_t * | cb | ) |
Calls initDefaults from LineSegment_t.
cb | the CubicBezier_t structure. |
void CubicBezier_setBasePoint1 | ( | CubicBezier_t * | cb, |
const Point_t * | point | ||
) |
Initializes the first base point with a copy of the given point.
cb | the CubicBezier_t structure. |
point | the Point_t structure to use as the base1 point. |
void CubicBezier_setBasePoint2 | ( | CubicBezier_t * | cb, |
const Point_t * | point | ||
) |
Initializes second base point with a copy of the given point.
cb | the CubicBezier_t structure. |
point | the Point_t structure to use as the base2 point. |
void CubicBezier_setEnd | ( | CubicBezier_t * | cb, |
const Point_t * | point | ||
) |
Initializes end point with a copy of the given point.
cb | the CubicBezier_t structure. |
point | the Point_t structure to use as the end point. |
void CubicBezier_setStart | ( | CubicBezier_t * | cb, |
const Point_t * | point | ||
) |
Initializes start point with a copy of the given point.
cb | the CubicBezier_t structure. |
point | the Point_t structure to use as the start point. |