libSBML C API
5.18.0
|
The base class implements common structures to both gradient classes. Both gradients have an id attribute which is used to reference a gradient within other render extension constructs. The id of a gradient can be used to define the fill style of 2D objects like e.g. rectangles.
Further, both gradient classes have a ListOfGradientStops_t objects which holds the GradientStop_t objects that define the gradient and both classes have an attribute called spreadMethod which defines how a gradient is applied to an object.
Public Member Functions | |
int | GradientBase_addGradientStop (GradientBase_t *gb, const GradientStop_t *gs) |
Adds a copy of the given GradientStop_t to this GradientBase_t. More... | |
GradientBase_t * | GradientBase_clone (const GradientBase_t *gb) |
Creates and returns a deep copy of this GradientBase_t object. More... | |
GradientStop_t * | GradientBase_createGradientStop (GradientBase_t *gb) |
Creates a new GradientStop_t object, adds it to this GradientBase_t object and returns the GradientStop_t object created. More... | |
GradientBase_t * | GradientBase_createLinearGradient (unsigned int level, unsigned int version, unsigned int pkgVersion) |
Creates a new LinearGradient_t (GradientBase_t) using the given SBML Level, Version and “render” package version. More... | |
GradientBase_t * | GradientBase_createRadialGradient (unsigned int level, unsigned int version, unsigned int pkgVersion) |
Creates a new RadialGradient_t (GradientBase_t) using the given SBML Level, Version and “render” package version. More... | |
void | GradientBase_free (GradientBase_t *gb) |
Frees this GradientBase_t object. More... | |
GradientStop_t * | GradientBase_getGradientStop (GradientBase_t *gb, unsigned int n) |
Get a GradientStop_t from the GradientBase_t. More... | |
char * | GradientBase_getId (const GradientBase_t *gb) |
Returns the value of the "id" attribute of this GradientBase_t. More... | |
ListOf_t * | GradientBase_getListOfGradientStops (GradientBase_t *gb) |
Returns a ListOf_t * containing GradientStop_t objects from this GradientBase_t. More... | |
char * | GradientBase_getName (const GradientBase_t *gb) |
Returns the value of the "name" attribute of this GradientBase_t. More... | |
unsigned int | GradientBase_getNumGradientStops (GradientBase_t *gb) |
Get the number of GradientStop_t objects in this GradientBase_t. More... | |
GradientSpreadMethod_t | GradientBase_getSpreadMethod (const GradientBase_t *gb) |
Returns the value of the "spreadMethod" attribute of this GradientBase_t. More... | |
char * | GradientBase_getSpreadMethodAsString (const GradientBase_t *gb) |
Returns the value of the "spreadMethod" attribute of this GradientBase_t. More... | |
int | GradientBase_hasRequiredAttributes (const GradientBase_t *gb) |
Predicate returning 1 (true) if all the required attributes for this GradientBase_t object have been set. More... | |
int | GradientBase_isLinearGradient (const GradientBase_t *gb) |
Predicate returning 1 if this GradientBase_t is of type LinearGradient_t. More... | |
int | GradientBase_isRadialGradient (const GradientBase_t *gb) |
Predicate returning 1 if this GradientBase_t is of type RadialGradient_t. More... | |
int | GradientBase_isSetId (const GradientBase_t *gb) |
Predicate returning 1 (true) if this GradientBase_t's "id" attribute is set. More... | |
int | GradientBase_isSetName (const GradientBase_t *gb) |
Predicate returning 1 (true) if this GradientBase_t's "name" attribute is set. More... | |
int | GradientBase_isSetSpreadMethod (const GradientBase_t *gb) |
Predicate returning 1 (true) if this GradientBase_t's "spreadMethod" attribute is set. More... | |
GradientStop_t * | GradientBase_removeGradientStop (GradientBase_t *gb, unsigned int n) |
Removes the nth GradientStop_t from this GradientBase_t and returns a pointer to it. More... | |
int | GradientBase_setId (GradientBase_t *gb, const char *id) |
Sets the value of the "id" attribute of this GradientBase_t. More... | |
int | GradientBase_setName (GradientBase_t *gb, const char *name) |
Sets the value of the "name" attribute of this GradientBase_t. More... | |
int | GradientBase_setSpreadMethod (GradientBase_t *gb, GradientSpreadMethod_t spreadMethod) |
Sets the value of the "spreadMethod" attribute of this GradientBase_t. More... | |
int | GradientBase_setSpreadMethodAsString (GradientBase_t *gb, const char *spreadMethod) |
Sets the value of the "spreadMethod" attribute of this GradientBase_t. More... | |
int | GradientBase_unsetId (GradientBase_t *gb) |
Unsets the value of the "id" attribute of this GradientBase_t. More... | |
int | GradientBase_unsetName (GradientBase_t *gb) |
Unsets the value of the "name" attribute of this GradientBase_t. More... | |
int | GradientBase_unsetSpreadMethod (GradientBase_t *gb) |
Unsets the value of the "spreadMethod" attribute of this GradientBase_t. More... | |
GradientSpreadMethod_t | GradientSpreadMethod_fromString (const char *code) |
Returns the GradientSpreadMethod_t enumeration corresponding to the given string or GRADIENT_SPREAD_METHOD_INVALID if there is no such match. More... | |
int | GradientSpreadMethod_isValid (GradientSpreadMethod_t gsm) |
Predicate returning 1 (true) or 0 (false) depending on whether the given GradientSpreadMethod_t is valid. More... | |
int | GradientSpreadMethod_isValidString (const char *code) |
Predicate returning 1 (true) or 0 (false) depending on whether the given string is a valid GradientSpreadMethod_t. More... | |
const char * | GradientSpreadMethod_toString (GradientSpreadMethod_t gsm) |
Returns the string version of the provided GradientSpreadMethod_t enumeration. More... | |
int GradientBase_addGradientStop | ( | GradientBase_t * | gb, |
const GradientStop_t * | gs | ||
) |
Adds a copy of the given GradientStop_t to this GradientBase_t.
gb | the GradientBase_t structure to which the GradientStop_t should be added. |
gs | the GradientStop_t object to add. |
GradientBase_t * GradientBase_clone | ( | const GradientBase_t * | gb | ) |
Creates and returns a deep copy of this GradientBase_t object.
gb | the GradientBase_t structure. |
GradientStop_t * GradientBase_createGradientStop | ( | GradientBase_t * | gb | ) |
Creates a new GradientStop_t object, adds it to this GradientBase_t object and returns the GradientStop_t object created.
gb | the GradientBase_t structure to which the GradientStop_t should be added. |
GradientBase_t * GradientBase_createLinearGradient | ( | unsigned int | level, |
unsigned int | version, | ||
unsigned int | pkgVersion | ||
) |
Creates a new LinearGradient_t (GradientBase_t) using the given SBML Level, Version and “render” package version.
level | an unsigned int, the SBML Level to assign to this GradientBase_t. |
version | an unsigned int, the SBML Version to assign to this GradientBase_t. |
pkgVersion | an unsigned int, the SBML Render Version to assign to this GradientBase_t. |
GradientBase_t * GradientBase_createRadialGradient | ( | unsigned int | level, |
unsigned int | version, | ||
unsigned int | pkgVersion | ||
) |
Creates a new RadialGradient_t (GradientBase_t) using the given SBML Level, Version and “render” package version.
level | an unsigned int, the SBML Level to assign to this GradientBase_t. |
version | an unsigned int, the SBML Version to assign to this GradientBase_t. |
pkgVersion | an unsigned int, the SBML Render Version to assign to this GradientBase_t. |
void GradientBase_free | ( | GradientBase_t * | gb | ) |
Frees this GradientBase_t object.
gb | the GradientBase_t structure. |
GradientStop_t * GradientBase_getGradientStop | ( | GradientBase_t * | gb, |
unsigned int | n | ||
) |
Get a GradientStop_t from the GradientBase_t.
gb | the GradientBase_t structure to search. |
n | an unsigned int representing the index of the GradientStop_t to retrieve. |
n
is invalid, NULL
is returned.char * GradientBase_getId | ( | const GradientBase_t * | gb | ) |
Returns the value of the "id" attribute of this GradientBase_t.
gb | the GradientBase_t structure whose id is sought. |
ListOf_t * GradientBase_getListOfGradientStops | ( | GradientBase_t * | gb | ) |
Returns a ListOf_t * containing GradientStop_t objects from this GradientBase_t.
gb | the GradientBase_t structure whose ListOfGradientStops_t is sought. |
char * GradientBase_getName | ( | const GradientBase_t * | gb | ) |
Returns the value of the "name" attribute of this GradientBase_t.
gb | the GradientBase_t structure whose name is sought. |
unsigned int GradientBase_getNumGradientStops | ( | GradientBase_t * | gb | ) |
Get the number of GradientStop_t objects in this GradientBase_t.
gb | the GradientBase_t structure to query. |
GradientSpreadMethod_t GradientBase_getSpreadMethod | ( | const GradientBase_t * | gb | ) |
Returns the value of the "spreadMethod" attribute of this GradientBase_t.
gb | the GradientBase_t structure whose spreadMethod is sought. |
"pad"
, the gradient color at the endpoint of the vector defines how the gradient is continued beyond that point (default value).
"reflect"
, the gradient continues from end to start and then from start to end again and again.
"repeat"
, the gradient pattern is repeated from start to end over and over again.
char * GradientBase_getSpreadMethodAsString | ( | const GradientBase_t * | gb | ) |
Returns the value of the "spreadMethod" attribute of this GradientBase_t.
gb | the GradientBase_t structure whose spreadMethod is sought. |
"pad"
, the gradient color at the endpoint of the vector defines how the gradient is continued beyond that point (default value).
"reflect"
, the gradient continues from end to start and then from start to end again and again.
"repeat"
, the gradient pattern is repeated from start to end over and over again.
"pad"
"reflect"
"repeat"
"invalid"
int GradientBase_hasRequiredAttributes | ( | const GradientBase_t * | gb | ) |
Predicate returning 1
(true) if all the required attributes for this GradientBase_t object have been set.
gb | the GradientBase_t structure. |
1
(true) to indicate that all the required attributes of this GradientBase_t have been set, otherwise 0
(false) is returned.int GradientBase_isLinearGradient | ( | const GradientBase_t * | gb | ) |
Predicate returning 1
if this GradientBase_t is of type LinearGradient_t.
gb | the GradientBase_t structure. |
1
if this GradientBase_t is of type LinearGradient_t, 0
otherwise int GradientBase_isRadialGradient | ( | const GradientBase_t * | gb | ) |
Predicate returning 1
if this GradientBase_t is of type RadialGradient_t.
gb | the GradientBase_t structure. |
1
if this GradientBase_t is of type RadialGradient_t, 0
otherwise int GradientBase_isSetId | ( | const GradientBase_t * | gb | ) |
Predicate returning 1
(true) if this GradientBase_t's "id" attribute is set.
gb | the GradientBase_t structure. |
1
(true) if this GradientBase_t's "id" attribute has been set, otherwise 0
(false) is returned. int GradientBase_isSetName | ( | const GradientBase_t * | gb | ) |
Predicate returning 1
(true) if this GradientBase_t's "name" attribute is set.
gb | the GradientBase_t structure. |
1
(true) if this GradientBase_t's "name" attribute has been set, otherwise 0
(false) is returned. int GradientBase_isSetSpreadMethod | ( | const GradientBase_t * | gb | ) |
Predicate returning 1
(true) if this GradientBase_t's "spreadMethod" attribute is set.
gb | the GradientBase_t structure. |
1
(true) if this GradientBase_t's "spreadMethod" attribute has been set, otherwise 0
(false) is returned."pad"
, the gradient color at the endpoint of the vector defines how the gradient is continued beyond that point (default value).
"reflect"
, the gradient continues from end to start and then from start to end again and again.
"repeat"
, the gradient pattern is repeated from start to end over and over again.
GradientStop_t * GradientBase_removeGradientStop | ( | GradientBase_t * | gb, |
unsigned int | n | ||
) |
Removes the nth GradientStop_t from this GradientBase_t and returns a pointer to it.
gb | the GradientBase_t structure to search. |
n | an unsigned int representing the index of the GradientStop_t to remove. |
int GradientBase_setId | ( | GradientBase_t * | gb, |
const char * | id | ||
) |
Sets the value of the "id" attribute of this GradientBase_t.
gb | the GradientBase_t structure. |
id | const char * value of the "id" attribute to be set. |
id
= NULL
or an empty string is equivalent to calling GradientBase_unsetId(). int GradientBase_setName | ( | GradientBase_t * | gb, |
const char * | name | ||
) |
Sets the value of the "name" attribute of this GradientBase_t.
gb | the GradientBase_t structure. |
name | const char * value of the "name" attribute to be set. |
name
= NULL
or an empty string is equivalent to calling GradientBase_unsetName(). int GradientBase_setSpreadMethod | ( | GradientBase_t * | gb, |
GradientSpreadMethod_t | spreadMethod | ||
) |
Sets the value of the "spreadMethod" attribute of this GradientBase_t.
gb | the GradientBase_t structure. |
spreadMethod | GradientSpreadMethod_t value of the "spreadMethod" attribute to be set. |
"pad"
, the gradient color at the endpoint of the vector defines how the gradient is continued beyond that point (default value).
"reflect"
, the gradient continues from end to start and then from start to end again and again.
"repeat"
, the gradient pattern is repeated from start to end over and over again.
int GradientBase_setSpreadMethodAsString | ( | GradientBase_t * | gb, |
const char * | spreadMethod | ||
) |
Sets the value of the "spreadMethod" attribute of this GradientBase_t.
gb | the GradientBase_t structure. |
spreadMethod | const char * of the "spreadMethod" attribute to be set. |
"pad"
, the gradient color at the endpoint of the vector defines how the gradient is continued beyond that point (default value).
"reflect"
, the gradient continues from end to start and then from start to end again and again.
"repeat"
, the gradient pattern is repeated from start to end over and over again.
int GradientBase_unsetId | ( | GradientBase_t * | gb | ) |
Unsets the value of the "id" attribute of this GradientBase_t.
gb | the GradientBase_t structure. |
int GradientBase_unsetName | ( | GradientBase_t * | gb | ) |
Unsets the value of the "name" attribute of this GradientBase_t.
gb | the GradientBase_t structure. |
int GradientBase_unsetSpreadMethod | ( | GradientBase_t * | gb | ) |
Unsets the value of the "spreadMethod" attribute of this GradientBase_t.
gb | the GradientBase_t structure. |
"pad"
, the gradient color at the endpoint of the vector defines how the gradient is continued beyond that point (default value).
"reflect"
, the gradient continues from end to start and then from start to end again and again.
"repeat"
, the gradient pattern is repeated from start to end over and over again.
GradientSpreadMethod_t GradientSpreadMethod_fromString | ( | const char * | code | ) |
Returns the GradientSpreadMethod_t enumeration corresponding to the given string or GRADIENT_SPREAD_METHOD_INVALID if there is no such match.
code | the string to convert to a GradientSpreadMethod_t. |
int GradientSpreadMethod_isValid | ( | GradientSpreadMethod_t | gsm | ) |
Predicate returning 1
(true) or 0
(false) depending on whether the given GradientSpreadMethod_t is valid.
gsm | the GradientSpreadMethod_t enumeration to query. |
1
(true) if the GradientSpreadMethod_t is GRADIENT_SPREADMETHOD_PAD, GRADIENT_SPREADMETHOD_REFLECT, or GRADIENT_SPREADMETHOD_REPEAT; 0
(false) otherwise (including GRADIENT_SPREAD_METHOD_INVALID). int GradientSpreadMethod_isValidString | ( | const char * | code | ) |
Predicate returning 1
(true) or 0
(false) depending on whether the given string is a valid GradientSpreadMethod_t.
code | the string to query. |
1
(true) if the string is "pad", "reflect", or "repeat"; 0
(false) otherwise.1
(true), but "Pad" will return 0
(false). const char * GradientSpreadMethod_toString | ( | GradientSpreadMethod_t | gsm | ) |
Returns the string version of the provided GradientSpreadMethod_t enumeration.
gsm | the GradientSpreadMethod_t enumeration value to convert. |