libSBML C API
5.18.0
|
The Polygon_t is very similar to the RenderCurve_t class. The only difference is that in the polygon the end point of the last element in the curve segment list is automatically connected to the start point of the first element.
Since a polygon is a closed shape and doesn't really have a start or an end, it does not get decorations as the RenderCurve_t does. So, a polygon is always closed and can therefore have a fill style and fill style related attributes. Those attributes are inherited from the Polygon_t base class GraphicalPrimitive2D_t.
Public Member Functions | |
int | Polygon_addElement (Polygon_t *p, const RenderPoint_t *rp) |
Adds a copy of the given RenderPoint_t to this Polygon_t. More... | |
Polygon_t * | Polygon_clone (const Polygon_t *p) |
Creates and returns a deep copy of this Polygon_t object. More... | |
Polygon_t * | Polygon_create (unsigned int level, unsigned int version, unsigned int pkgVersion) |
Creates a new Polygon_t using the given SBML Level, Version and “render” package version. More... | |
RenderCubicBezier_t * | Polygon_createCubicBezier (Polygon_t *p) |
Creates a new RenderCubicBezier_t object, adds it to this Polygon_t object and returns the RenderCubicBezier_t object created. More... | |
RenderPoint_t * | Polygon_createPoint (Polygon_t *p) |
Creates a new RenderPoint_t object, adds it to this Polygon_t object and returns the RenderPoint_t object created. More... | |
void | Polygon_free (Polygon_t *p) |
Frees this Polygon_t object. More... | |
RenderPoint_t * | Polygon_getElement (Polygon_t *p, unsigned int n) |
Get a RenderPoint_t from the Polygon_t. More... | |
ListOf_t * | Polygon_getListOfElements (Polygon_t *p) |
Returns a ListOf_t * containing RenderPoint_t objects from this Polygon_t. More... | |
unsigned int | Polygon_getNumElements (Polygon_t *p) |
Get the number of RenderPoint_t objects in this Polygon_t. More... | |
int | Polygon_hasRequiredAttributes (const Polygon_t *p) |
Predicate returning 1 (true) if all the required attributes for this Polygon_t object have been set. More... | |
int | Polygon_hasRequiredElements (const Polygon_t *p) |
Predicate returning 1 (true) if all the required elements for this Polygon_t object have been set. More... | |
RenderPoint_t * | Polygon_removeElement (Polygon_t *p, unsigned int n) |
Removes the nth RenderPoint_t from this Polygon_t and returns a pointer to it. More... | |
int Polygon_addElement | ( | Polygon_t * | p, |
const RenderPoint_t * | rp | ||
) |
Adds a copy of the given RenderPoint_t to this Polygon_t.
p | the Polygon_t structure to which the RenderPoint_t should be added. |
rp | the RenderPoint_t object to add. |
Creates and returns a deep copy of this Polygon_t object.
p | the Polygon_t structure. |
Polygon_t * Polygon_create | ( | unsigned int | level, |
unsigned int | version, | ||
unsigned int | pkgVersion | ||
) |
Creates a new Polygon_t using the given SBML Level, Version and “render” package version.
level | an unsigned int, the SBML Level to assign to this Polygon_t. |
version | an unsigned int, the SBML Version to assign to this Polygon_t. |
pkgVersion | an unsigned int, the SBML Render Version to assign to this Polygon_t. |
RenderCubicBezier_t * Polygon_createCubicBezier | ( | Polygon_t * | p | ) |
Creates a new RenderCubicBezier_t object, adds it to this Polygon_t object and returns the RenderCubicBezier_t object created.
p | the Polygon_t structure to which the RenderCubicBezier_t should be added. |
RenderPoint_t * Polygon_createPoint | ( | Polygon_t * | p | ) |
Creates a new RenderPoint_t object, adds it to this Polygon_t object and returns the RenderPoint_t object created.
p | the Polygon_t structure to which the RenderPoint_t should be added. |
void Polygon_free | ( | Polygon_t * | p | ) |
RenderPoint_t * Polygon_getElement | ( | Polygon_t * | p, |
unsigned int | n | ||
) |
Get a RenderPoint_t from the Polygon_t.
p | the Polygon_t structure to search. |
n | an unsigned int representing the index of the RenderPoint_t to retrieve. |
NULL
if no such object exists.Returns a ListOf_t * containing RenderPoint_t objects from this Polygon_t.
p | the Polygon_t structure whose ListOfCurveElements_t is sought. |
unsigned int Polygon_getNumElements | ( | Polygon_t * | p | ) |
Get the number of RenderPoint_t objects in this Polygon_t.
p | the Polygon_t structure to query. |
int Polygon_hasRequiredAttributes | ( | const Polygon_t * | p | ) |
int Polygon_hasRequiredElements | ( | const Polygon_t * | p | ) |
Predicate returning 1
(true) if all the required elements for this Polygon_t object have been set.
p | the Polygon_t structure. |
1
(true) to indicate that all the required elements of this Polygon_t have been set, otherwise 0
(false) is returned.RenderPoint_t * Polygon_removeElement | ( | Polygon_t * | p, |
unsigned int | n | ||
) |
Removes the nth RenderPoint_t from this Polygon_t and returns a pointer to it.
p | the Polygon_t structure to search. |
n | an unsigned int representing the index of the RenderPoint_t to remove. |