libSBML C API
5.18.0
|
The GraphicalPrimitive2D_t class implements attributes and methods necessary for 2D objects like rectangles, polygons or ellipses. The attributes that are implemented are a fill color and a fill rule that specifies how the fill color is applied.
The GraphicalPrimitive2D_t class is derived from GraphicalPrimitive1D_t and inherits all its methods and attributes.
Public Member Functions | |
GraphicalPrimitive2D_t * | GraphicalPrimitive2D_clone (const GraphicalPrimitive2D_t *gpd) |
Creates and returns a deep copy of this GraphicalPrimitive2D_t object. More... | |
GraphicalPrimitive2D_t * | GraphicalPrimitive2D_createEllipse (unsigned int level, unsigned int version, unsigned int pkgVersion) |
Creates a new Ellipse_t (GraphicalPrimitive2D_t) using the given SBML Level, Version and “render” package version. More... | |
GraphicalPrimitive2D_t * | GraphicalPrimitive2D_createLineEnding (unsigned int level, unsigned int version, unsigned int pkgVersion) |
Creates a new LineEnding_t (GraphicalPrimitive2D_t) using the given SBML Level, Version and “render” package version. More... | |
GraphicalPrimitive2D_t * | GraphicalPrimitive2D_createPolygon (unsigned int level, unsigned int version, unsigned int pkgVersion) |
Creates a new Polygon_t (GraphicalPrimitive2D_t) using the given SBML Level, Version and “render” package version. More... | |
GraphicalPrimitive2D_t * | GraphicalPrimitive2D_createRectangle (unsigned int level, unsigned int version, unsigned int pkgVersion) |
Creates a new Rectangle_t (GraphicalPrimitive2D_t) using the given SBML Level, Version and “render” package version. More... | |
GraphicalPrimitive2D_t * | GraphicalPrimitive2D_createRenderGroup (unsigned int level, unsigned int version, unsigned int pkgVersion) |
Creates a new RenderGroup_t (GraphicalPrimitive2D_t) using the given SBML Level, Version and “render” package version. More... | |
void | GraphicalPrimitive2D_free (GraphicalPrimitive2D_t *gpd) |
Frees this GraphicalPrimitive2D_t object. More... | |
char * | GraphicalPrimitive2D_getFill (const GraphicalPrimitive2D_t *gpd) |
Returns the value of the "fill" attribute of this GraphicalPrimitive2D_t. More... | |
int | GraphicalPrimitive2D_getFillRule (const GraphicalPrimitive2D_t *gpd) |
Returns the value of the "fill-rule" attribute of this GraphicalPrimitive2D_t. More... | |
char * | GraphicalPrimitive2D_getFillRuleAsString (const GraphicalPrimitive2D_t *gpd) |
Returns the value of the "fill-rule" attribute of this GraphicalPrimitive2D_t. More... | |
int | GraphicalPrimitive2D_hasRequiredAttributes (const GraphicalPrimitive2D_t *gpd) |
Predicate returning 1 (true) if all the required attributes for this GraphicalPrimitive2D_t object have been set. More... | |
int | GraphicalPrimitive2D_isEllipse (const GraphicalPrimitive2D_t *gpd) |
Predicate returning 1 if this GraphicalPrimitive2D_t is of type Ellipse_t. More... | |
int | GraphicalPrimitive2D_isLineEnding (const GraphicalPrimitive2D_t *gpd) |
Predicate returning 1 if this GraphicalPrimitive2D_t is of type LineEnding_t. More... | |
int | GraphicalPrimitive2D_isPolygon (const GraphicalPrimitive2D_t *gpd) |
Predicate returning 1 if this GraphicalPrimitive2D_t is of type Polygon_t. More... | |
int | GraphicalPrimitive2D_isRectangle (const GraphicalPrimitive2D_t *gpd) |
Predicate returning 1 if this GraphicalPrimitive2D_t is of type Rectangle_t. More... | |
int | GraphicalPrimitive2D_isRenderGroup (const GraphicalPrimitive2D_t *gpd) |
Predicate returning 1 if this GraphicalPrimitive2D_t is of type RenderGroup_t. More... | |
int | GraphicalPrimitive2D_isSetFill (const GraphicalPrimitive2D_t *gpd) |
Predicate returning 1 (true) if this GraphicalPrimitive2D_t's "fill" attribute is set. More... | |
int | GraphicalPrimitive2D_isSetFillRule (const GraphicalPrimitive2D_t *gpd) |
Predicate returning 1 (true) if this GraphicalPrimitive2D_t's "fill-rule" attribute is set. More... | |
int | GraphicalPrimitive2D_setFill (GraphicalPrimitive2D_t *gpd, const char *fill) |
Sets the value of the "fill" attribute of this GraphicalPrimitive2D_t. More... | |
int | GraphicalPrimitive2D_setFillRule (GraphicalPrimitive2D_t *gpd, FillRule_t fillRule) |
Sets the value of the "fill-rule" attribute of this GraphicalPrimitive2D_t. More... | |
int | GraphicalPrimitive2D_setFillRuleAsString (GraphicalPrimitive2D_t *gpd, const char *fillRule) |
Sets the value of the "fill-rule" attribute of this GraphicalPrimitive2D_t. More... | |
int | GraphicalPrimitive2D_unsetFill (GraphicalPrimitive2D_t *gpd) |
Unsets the value of the "fill" attribute of this GraphicalPrimitive2D_t. More... | |
int | GraphicalPrimitive2D_unsetFillRule (GraphicalPrimitive2D_t *gpd) |
Unsets the value of the "fill-rule" attribute of this GraphicalPrimitive2D_t. More... | |
GraphicalPrimitive2D_t * GraphicalPrimitive2D_clone | ( | const GraphicalPrimitive2D_t * | gpd | ) |
Creates and returns a deep copy of this GraphicalPrimitive2D_t object.
gpd | the GraphicalPrimitive2D_t structure. |
GraphicalPrimitive2D_t * GraphicalPrimitive2D_createEllipse | ( | unsigned int | level, |
unsigned int | version, | ||
unsigned int | pkgVersion | ||
) |
Creates a new Ellipse_t (GraphicalPrimitive2D_t) using the given SBML Level, Version and “render” package version.
level | an unsigned int, the SBML Level to assign to this GraphicalPrimitive2D_t. |
version | an unsigned int, the SBML Version to assign to this GraphicalPrimitive2D_t. |
pkgVersion | an unsigned int, the SBML Render Version to assign to this GraphicalPrimitive2D_t. |
GraphicalPrimitive2D_t * GraphicalPrimitive2D_createLineEnding | ( | unsigned int | level, |
unsigned int | version, | ||
unsigned int | pkgVersion | ||
) |
Creates a new LineEnding_t (GraphicalPrimitive2D_t) using the given SBML Level, Version and “render” package version.
level | an unsigned int, the SBML Level to assign to this GraphicalPrimitive2D_t. |
version | an unsigned int, the SBML Version to assign to this GraphicalPrimitive2D_t. |
pkgVersion | an unsigned int, the SBML Render Version to assign to this GraphicalPrimitive2D_t. |
GraphicalPrimitive2D_t * GraphicalPrimitive2D_createPolygon | ( | unsigned int | level, |
unsigned int | version, | ||
unsigned int | pkgVersion | ||
) |
Creates a new Polygon_t (GraphicalPrimitive2D_t) using the given SBML Level, Version and “render” package version.
level | an unsigned int, the SBML Level to assign to this GraphicalPrimitive2D_t. |
version | an unsigned int, the SBML Version to assign to this GraphicalPrimitive2D_t. |
pkgVersion | an unsigned int, the SBML Render Version to assign to this GraphicalPrimitive2D_t. |
GraphicalPrimitive2D_t * GraphicalPrimitive2D_createRectangle | ( | unsigned int | level, |
unsigned int | version, | ||
unsigned int | pkgVersion | ||
) |
Creates a new Rectangle_t (GraphicalPrimitive2D_t) using the given SBML Level, Version and “render” package version.
level | an unsigned int, the SBML Level to assign to this GraphicalPrimitive2D_t. |
version | an unsigned int, the SBML Version to assign to this GraphicalPrimitive2D_t. |
pkgVersion | an unsigned int, the SBML Render Version to assign to this GraphicalPrimitive2D_t. |
GraphicalPrimitive2D_t * GraphicalPrimitive2D_createRenderGroup | ( | unsigned int | level, |
unsigned int | version, | ||
unsigned int | pkgVersion | ||
) |
Creates a new RenderGroup_t (GraphicalPrimitive2D_t) using the given SBML Level, Version and “render” package version.
level | an unsigned int, the SBML Level to assign to this GraphicalPrimitive2D_t. |
version | an unsigned int, the SBML Version to assign to this GraphicalPrimitive2D_t. |
pkgVersion | an unsigned int, the SBML Render Version to assign to this GraphicalPrimitive2D_t. |
void GraphicalPrimitive2D_free | ( | GraphicalPrimitive2D_t * | gpd | ) |
Frees this GraphicalPrimitive2D_t object.
gpd | the GraphicalPrimitive2D_t structure. |
char * GraphicalPrimitive2D_getFill | ( | const GraphicalPrimitive2D_t * | gpd | ) |
Returns the value of the "fill" attribute of this GraphicalPrimitive2D_t.
gpd | the GraphicalPrimitive2D_t structure whose fill is sought. |
int GraphicalPrimitive2D_getFillRule | ( | const GraphicalPrimitive2D_t * | gpd | ) |
Returns the value of the "fill-rule" attribute of this GraphicalPrimitive2D_t.
"nonzero"
: This value determines the "insideness" of a point in the shape by drawing a ray from that point to infinity in any direction and then examining the places where a segment of the shape crosses the ray. Starting with a count of zero, add one each time a path segment crosses the ray from left to right and subtract one each time a path segment crosses the ray from right to left. After counting the crossings, if the result is zero then the point is outside the path. Otherwise, it is inside.
"evenodd"
: This value determines the "insideness" of a point in the shape by drawing a ray from that point to infinity in any direction and counting the number of path segments from the given shape that the ray crosses. If this number is odd, the point is inside; if even, the point is outside.
"inherit"
: This value declares the "insideness" of a point in the shape by declaring that the property takes the same computed value as the property for the element's parent. The inherited value, which is normally only used as a fallback value, can be clarified by setting 'inherit' explicitly. NOTE: This value is NOT in the Level 3 Version 1 Render specification, but was left out due to an oversight: the value has long been part of the codebase. It is provided here as a convenience. Elements with a fill-rule set to "inherit" actually behave identicaly to elements without a fill-rule attribute at all, since this attribute always takes the value of a parent element if not defined explicitly.
gpd | the GraphicalPrimitive2D_t structure whose fill-rule is sought. |
char * GraphicalPrimitive2D_getFillRuleAsString | ( | const GraphicalPrimitive2D_t * | gpd | ) |
Returns the value of the "fill-rule" attribute of this GraphicalPrimitive2D_t.
gpd | the GraphicalPrimitive2D_t structure whose fill-rule is sought. |
"nonzero"
: This value determines the "insideness" of a point in the shape by drawing a ray from that point to infinity in any direction and then examining the places where a segment of the shape crosses the ray. Starting with a count of zero, add one each time a path segment crosses the ray from left to right and subtract one each time a path segment crosses the ray from right to left. After counting the crossings, if the result is zero then the point is outside the path. Otherwise, it is inside.
"evenodd"
: This value determines the "insideness" of a point in the shape by drawing a ray from that point to infinity in any direction and counting the number of path segments from the given shape that the ray crosses. If this number is odd, the point is inside; if even, the point is outside.
"inherit"
: This value declares the "insideness" of a point in the shape by declaring that the property takes the same computed value as the property for the element's parent. The inherited value, which is normally only used as a fallback value, can be clarified by setting 'inherit' explicitly. NOTE: This value is NOT in the Level 3 Version 1 Render specification, but was left out due to an oversight: the value has long been part of the codebase. It is provided here as a convenience. Elements with a fill-rule set to "inherit" actually behave identicaly to elements without a fill-rule attribute at all, since this attribute always takes the value of a parent element if not defined explicitly.
"nonzero"
"evenodd"
"(Unknown FillRule value)"
int GraphicalPrimitive2D_hasRequiredAttributes | ( | const GraphicalPrimitive2D_t * | gpd | ) |
Predicate returning 1
(true) if all the required attributes for this GraphicalPrimitive2D_t object have been set.
gpd | the GraphicalPrimitive2D_t structure. |
1
(true) to indicate that all the required attributes of this GraphicalPrimitive2D_t have been set, otherwise 0
(false) is returned. int GraphicalPrimitive2D_isEllipse | ( | const GraphicalPrimitive2D_t * | gpd | ) |
Predicate returning 1
if this GraphicalPrimitive2D_t is of type Ellipse_t.
gpd | the GraphicalPrimitive2D_t structure. |
1
if this GraphicalPrimitive2D_t is of type Ellipse_t, 0
otherwise int GraphicalPrimitive2D_isLineEnding | ( | const GraphicalPrimitive2D_t * | gpd | ) |
Predicate returning 1
if this GraphicalPrimitive2D_t is of type LineEnding_t.
gpd | the GraphicalPrimitive2D_t structure. |
1
if this GraphicalPrimitive2D_t is of type LineEnding_t, 0
otherwise int GraphicalPrimitive2D_isPolygon | ( | const GraphicalPrimitive2D_t * | gpd | ) |
Predicate returning 1
if this GraphicalPrimitive2D_t is of type Polygon_t.
gpd | the GraphicalPrimitive2D_t structure. |
1
if this GraphicalPrimitive2D_t is of type Polygon_t, 0
otherwise int GraphicalPrimitive2D_isRectangle | ( | const GraphicalPrimitive2D_t * | gpd | ) |
Predicate returning 1
if this GraphicalPrimitive2D_t is of type Rectangle_t.
gpd | the GraphicalPrimitive2D_t structure. |
1
if this GraphicalPrimitive2D_t is of type Rectangle_t, 0
otherwise int GraphicalPrimitive2D_isRenderGroup | ( | const GraphicalPrimitive2D_t * | gpd | ) |
Predicate returning 1
if this GraphicalPrimitive2D_t is of type RenderGroup_t.
gpd | the GraphicalPrimitive2D_t structure. |
1
if this GraphicalPrimitive2D_t is of type RenderGroup_t, 0
otherwise int GraphicalPrimitive2D_isSetFill | ( | const GraphicalPrimitive2D_t * | gpd | ) |
Predicate returning 1
(true) if this GraphicalPrimitive2D_t's "fill" attribute is set.
gpd | the GraphicalPrimitive2D_t structure. |
1
(true) if this GraphicalPrimitive2D_t's "fill" attribute has been set, otherwise 0
(false) is returned. int GraphicalPrimitive2D_isSetFillRule | ( | const GraphicalPrimitive2D_t * | gpd | ) |
Predicate returning 1
(true) if this GraphicalPrimitive2D_t's "fill-rule" attribute is set.
"nonzero"
: This value determines the "insideness" of a point in the shape by drawing a ray from that point to infinity in any direction and then examining the places where a segment of the shape crosses the ray. Starting with a count of zero, add one each time a path segment crosses the ray from left to right and subtract one each time a path segment crosses the ray from right to left. After counting the crossings, if the result is zero then the point is outside the path. Otherwise, it is inside.
"evenodd"
: This value determines the "insideness" of a point in the shape by drawing a ray from that point to infinity in any direction and counting the number of path segments from the given shape that the ray crosses. If this number is odd, the point is inside; if even, the point is outside.
"inherit"
: This value declares the "insideness" of a point in the shape by declaring that the property takes the same computed value as the property for the element's parent. The inherited value, which is normally only used as a fallback value, can be clarified by setting 'inherit' explicitly. NOTE: This value is NOT in the Level 3 Version 1 Render specification, but was left out due to an oversight: the value has long been part of the codebase. It is provided here as a convenience. Elements with a fill-rule set to "inherit" actually behave identicaly to elements without a fill-rule attribute at all, since this attribute always takes the value of a parent element if not defined explicitly.
gpd | the GraphicalPrimitive2D_t structure. |
1
(true) if this GraphicalPrimitive2D_t's "fill-rule" attribute has been set, otherwise 0
(false) is returned. int GraphicalPrimitive2D_setFill | ( | GraphicalPrimitive2D_t * | gpd, |
const char * | fill | ||
) |
Sets the value of the "fill" attribute of this GraphicalPrimitive2D_t.
gpd | the GraphicalPrimitive2D_t structure. |
fill | const char * value of the "fill" attribute to be set. |
fill
= NULL
or an empty string is equivalent to calling GraphicalPrimitive2D_unsetFill(). int GraphicalPrimitive2D_setFillRule | ( | GraphicalPrimitive2D_t * | gpd, |
FillRule_t | fillRule | ||
) |
Sets the value of the "fill-rule" attribute of this GraphicalPrimitive2D_t.
"nonzero"
: This value determines the "insideness" of a point in the shape by drawing a ray from that point to infinity in any direction and then examining the places where a segment of the shape crosses the ray. Starting with a count of zero, add one each time a path segment crosses the ray from left to right and subtract one each time a path segment crosses the ray from right to left. After counting the crossings, if the result is zero then the point is outside the path. Otherwise, it is inside.
"evenodd"
: This value determines the "insideness" of a point in the shape by drawing a ray from that point to infinity in any direction and counting the number of path segments from the given shape that the ray crosses. If this number is odd, the point is inside; if even, the point is outside.
"inherit"
: This value declares the "insideness" of a point in the shape by declaring that the property takes the same computed value as the property for the element's parent. The inherited value, which is normally only used as a fallback value, can be clarified by setting 'inherit' explicitly. NOTE: This value is NOT in the Level 3 Version 1 Render specification, but was left out due to an oversight: the value has long been part of the codebase. It is provided here as a convenience. Elements with a fill-rule set to "inherit" actually behave identicaly to elements without a fill-rule attribute at all, since this attribute always takes the value of a parent element if not defined explicitly.
gpd | the GraphicalPrimitive2D_t structure. |
fillRule | FillRule_t value of the "fill-rule" attribute to be set. |
int GraphicalPrimitive2D_setFillRuleAsString | ( | GraphicalPrimitive2D_t * | gpd, |
const char * | fillRule | ||
) |
Sets the value of the "fill-rule" attribute of this GraphicalPrimitive2D_t.
"nonzero"
: This value determines the "insideness" of a point in the shape by drawing a ray from that point to infinity in any direction and then examining the places where a segment of the shape crosses the ray. Starting with a count of zero, add one each time a path segment crosses the ray from left to right and subtract one each time a path segment crosses the ray from right to left. After counting the crossings, if the result is zero then the point is outside the path. Otherwise, it is inside.
"evenodd"
: This value determines the "insideness" of a point in the shape by drawing a ray from that point to infinity in any direction and counting the number of path segments from the given shape that the ray crosses. If this number is odd, the point is inside; if even, the point is outside.
"inherit"
: This value declares the "insideness" of a point in the shape by declaring that the property takes the same computed value as the property for the element's parent. The inherited value, which is normally only used as a fallback value, can be clarified by setting 'inherit' explicitly. NOTE: This value is NOT in the Level 3 Version 1 Render specification, but was left out due to an oversight: the value has long been part of the codebase. It is provided here as a convenience. Elements with a fill-rule set to "inherit" actually behave identicaly to elements without a fill-rule attribute at all, since this attribute always takes the value of a parent element if not defined explicitly.
gpd | the GraphicalPrimitive2D_t structure. |
fillRule | const char * of the "fill-rule" attribute to be set. |
int GraphicalPrimitive2D_unsetFill | ( | GraphicalPrimitive2D_t * | gpd | ) |
Unsets the value of the "fill" attribute of this GraphicalPrimitive2D_t.
gpd | the GraphicalPrimitive2D_t structure. |
int GraphicalPrimitive2D_unsetFillRule | ( | GraphicalPrimitive2D_t * | gpd | ) |
Unsets the value of the "fill-rule" attribute of this GraphicalPrimitive2D_t.
"nonzero"
: This value determines the "insideness" of a point in the shape by drawing a ray from that point to infinity in any direction and then examining the places where a segment of the shape crosses the ray. Starting with a count of zero, add one each time a path segment crosses the ray from left to right and subtract one each time a path segment crosses the ray from right to left. After counting the crossings, if the result is zero then the point is outside the path. Otherwise, it is inside.
"evenodd"
: This value determines the "insideness" of a point in the shape by drawing a ray from that point to infinity in any direction and counting the number of path segments from the given shape that the ray crosses. If this number is odd, the point is inside; if even, the point is outside.
"inherit"
: This value declares the "insideness" of a point in the shape by declaring that the property takes the same computed value as the property for the element's parent. The inherited value, which is normally only used as a fallback value, can be clarified by setting 'inherit' explicitly. NOTE: This value is NOT in the Level 3 Version 1 Render specification, but was left out due to an oversight: the value has long been part of the codebase. It is provided here as a convenience. Elements with a fill-rule set to "inherit" actually behave identicaly to elements without a fill-rule attribute at all, since this attribute always takes the value of a parent element if not defined explicitly.
gpd | the GraphicalPrimitive2D_t structure. |