libSBML C API  5.18.0
CubicBezier_t Class Reference

Detailed Description

layout A Cubic Bézier smooth curve.

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_tCubicBezier_clone (const CubicBezier_t *cb)
 
CubicBezier_tCubicBezier_create ()
 Creates a CubicBezier_t and returns the pointer. More...
 
CubicBezier_tCubicBezier_createFrom (const CubicBezier_t *temp)
 Creates a CubicBezier_t structure from a template. More...
 
CubicBezier_tCubicBezier_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_tCubicBezier_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_tCubicBezier_getBasePoint1 (CubicBezier_t *cb)
 Returns the first base point of the curve (the one closer to the starting point). More...
 
Point_tCubicBezier_getBasePoint2 (CubicBezier_t *cb)
 Returns the second base point of the curve (the one closer to the end point). More...
 
Point_tCubicBezier_getEnd (CubicBezier_t *cb)
 Returns the endpoint of the curve. More...
 
Point_tCubicBezier_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...
 

Member Function Documentation

CubicBezier_t * CubicBezier_clone ( const CubicBezier_t cb)
Returns
a (deep) copy of this CubicBezier_t.
Parameters
cbthe 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.

Parameters
tempthe 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.

Parameters
x1the value of the x coordinate of the start Point_t.
y1the value of the y coordinate of the start Point_t.
z1the value of the z coordinate of the start Point_t.
x2the value of the x coordinate of the base1 Point_t.
y2the value of the y coordinate of the base1 Point_t.
z2the value of the z coordinate of the base1 Point_t.
x3the value of the x coordinate of the base2 Point_t.
y3the value of the y coordinate of the base2 Point_t.
z3the value of the z coordinate of the base2 Point_t.
x4the value of the x coordinate of the end Point_t.
y4the value of the y coordinate of the end Point_t.
z4the 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.

Parameters
startthe value of the 'start' Point_t.
base1the value of the 'base1' Point_t.
base2the value of the 'base2' Point_t.
endthe value of the 'end' Point_t.
void CubicBezier_free ( CubicBezier_t cb)

Frees the memory for the cubic bezier.

Parameters
cbthe 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).

Parameters
cbthe 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).

Parameters
cbthe CubicBezier_t structure.
Point_t * CubicBezier_getEnd ( CubicBezier_t cb)

Returns the endpoint of the curve.

Parameters
cbthe CubicBezier_t structure.
Point_t * CubicBezier_getStart ( CubicBezier_t cb)

Returns the starting point of the curve.

Parameters
cbthe CubicBezier_t structure.
void CubicBezier_initDefaults ( CubicBezier_t cb)

Calls initDefaults from LineSegment_t.

Parameters
cbthe 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.

Parameters
cbthe CubicBezier_t structure.
pointthe 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.

Parameters
cbthe CubicBezier_t structure.
pointthe 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.

Parameters
cbthe CubicBezier_t structure.
pointthe 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.

Parameters
cbthe CubicBezier_t structure.
pointthe Point_t structure to use as the start point.