libSBML C API  5.18.0
Style_t Class Reference

Detailed Description

render Abstract base class for local and global styles.

Local and global styles in the SBML Level 3 Render package have many attributes and methods in common. These have been implemented in the abstract base class Style_t.

A style is a graphical representation for certain layout objects. The assignment of styles to individual layout objects can either be done through layout object ids (local styles only), layout object types (SPECIES, COMPARTMENT, etc.) or layout object roles.

Public Member Functions

Style_tStyle_clone (const Style_t *s)
 Creates and returns a deep copy of this Style_t object. More...
 
Style_tStyle_createGlobalStyle (unsigned int level, unsigned int version, unsigned int pkgVersion)
 Creates a new GlobalStyle_t (Style_t) using the given SBML Level, Version and “render” package version. More...
 
RenderGroup_tStyle_createGroup (Style_t *s)
 Creates a new RenderGroup_t object, adds it to this Style_t object and returns the RenderGroup_t object created. More...
 
Style_tStyle_createLocalStyle (unsigned int level, unsigned int version, unsigned int pkgVersion)
 Creates a new LocalStyle_t (Style_t) using the given SBML Level, Version and “render” package version. More...
 
void Style_free (Style_t *s)
 Frees this Style_t object. More...
 
const RenderGroup_tStyle_getGroup (const Style_t *s)
 Returns the value of the "group" element of this Style_t. More...
 
char * Style_getId (const Style_t *s)
 Returns the value of the "id" attribute of this Style_t. More...
 
char * Style_getName (const Style_t *s)
 Returns the value of the "name" attribute of this Style_t. More...
 
int Style_hasRequiredAttributes (const Style_t *s)
 Predicate returning 1 (true) if all the required attributes for this Style_t object have been set. More...
 
int Style_isGlobalStyle (const Style_t *s)
 Predicate returning 1 if this Style_t is of type GlobalStyle_t. More...
 
int Style_isLocalStyle (const Style_t *s)
 Predicate returning 1 if this Style_t is of type LocalStyle_t. More...
 
int Style_isSetGroup (const Style_t *s)
 Predicate returning 1 (true) if this Style_t's "group" element is set. More...
 
int Style_isSetId (const Style_t *s)
 Returns the value of the "roleList" attribute of this Style_t. More...
 
int Style_isSetName (const Style_t *s)
 Predicate returning 1 (true) if this Style_t's "name" attribute is set. More...
 
int Style_setGroup (Style_t *s, const RenderGroup_t *group)
 Sets the value of the "group" element of this Style_t. More...
 
int Style_setId (Style_t *s, const char *id)
 Sets the value of the "id" attribute of this Style_t. More...
 
int Style_setName (Style_t *s, const char *name)
 Sets the value of the "name" attribute of this Style_t. More...
 
int Style_setRoleList (Style_t *s, const char *roleList)
 Sets the value of the "roleList" attribute of this Style_t. More...
 
int Style_setTypeList (Style_t *s, const char *typeList)
 Sets the value of the "typeList" attribute of this Style_t. More...
 
int Style_unsetGroup (Style_t *s)
 Unsets the value of the "group" element of this Style_t. More...
 
int Style_unsetId (Style_t *s)
 Unsets the value of the "id" attribute of this Style_t. More...
 
int Style_unsetName (Style_t *s)
 Unsets the value of the "name" attribute of this Style_t. More...
 
int Style_unsetRoleList (Style_t *s)
 Unsets the value of the "roleList" attribute of this Style_t. More...
 
int Style_unsetTypeList (Style_t *s)
 Unsets the value of the "typeList" attribute of this Style_t. More...
 

Member Function Documentation

Style_t * Style_clone ( const Style_t s)

Creates and returns a deep copy of this Style_t object.

Parameters
sthe Style_t structure.
Returns
a (deep) copy of this Style_t object.
Warning
The pointer that is returned by this function is owned by the caller, who is responsible for deleting it. Any changes made to the element will not be reflected in any resulting SBML document unless the element is added to an SBML Document. Even in this case, the element's deletion is still the responsibility of the caller with two exceptions: if it is used as the "disownedItem" in the ListOf_appendAndOwn() or ListOf_insertAndOwn() functions. All other functions in libsbml add a copy of the element, and do not transfer ownership of the pointer.
Style_t * Style_createGlobalStyle ( unsigned int  level,
unsigned int  version,
unsigned int  pkgVersion 
)

Creates a new GlobalStyle_t (Style_t) using the given SBML Level, Version and “render” package version.

Parameters
levelan unsigned int, the SBML Level to assign to this Style_t.
versionan unsigned int, the SBML Version to assign to this Style_t.
pkgVersionan unsigned int, the SBML Render Version to assign to this Style_t.
Note
Attempting to add an object to an SBMLDocument_t having a different combination of SBML Level, Version and XML namespaces than the object itself will result in an error at the time a caller attempts to make the addition. A parent object must have compatible Level, Version and XML namespaces. (Strictly speaking, a parent may also have more XML namespaces than a child, but the reverse is not permitted.) The restriction is necessary to ensure that an SBML model has a consistent overall structure. This requires callers to manage their objects carefully, but the benefit is increased flexibility in how models can be created by permitting callers to create objects bottom-up if desired. In situations where objects are not yet attached to parents (e.g., SBMLDocument_t), knowledge of the intented SBML Level and Version help libSBML determine such things as whether it is valid to assign a particular value to an attribute. For packages, this means that the parent object to which this package element is being added must have been created with the package namespace, or that the package namespace was added to it, even if that parent is not a package object itself.
Warning
The pointer that is returned by this function is owned by the caller, who is responsible for deleting it. Any changes made to the element will not be reflected in any resulting SBML document unless the element is added to an SBML Document. Even in this case, the element's deletion is still the responsibility of the caller with two exceptions: if it is used as the "disownedItem" in the ListOf_appendAndOwn() or ListOf_insertAndOwn() functions. All other functions in libsbml add a copy of the element, and do not transfer ownership of the pointer.
RenderGroup_t * Style_createGroup ( Style_t s)

Creates a new RenderGroup_t object, adds it to this Style_t object and returns the RenderGroup_t object created.

Parameters
sthe Style_t structure to which the RenderGroup_t should be added.
Returns
a new RenderGroup_t object instance.
Style_t * Style_createLocalStyle ( unsigned int  level,
unsigned int  version,
unsigned int  pkgVersion 
)

Creates a new LocalStyle_t (Style_t) using the given SBML Level, Version and “render” package version.

Parameters
levelan unsigned int, the SBML Level to assign to this Style_t.
versionan unsigned int, the SBML Version to assign to this Style_t.
pkgVersionan unsigned int, the SBML Render Version to assign to this Style_t.
Note
Attempting to add an object to an SBMLDocument_t having a different combination of SBML Level, Version and XML namespaces than the object itself will result in an error at the time a caller attempts to make the addition. A parent object must have compatible Level, Version and XML namespaces. (Strictly speaking, a parent may also have more XML namespaces than a child, but the reverse is not permitted.) The restriction is necessary to ensure that an SBML model has a consistent overall structure. This requires callers to manage their objects carefully, but the benefit is increased flexibility in how models can be created by permitting callers to create objects bottom-up if desired. In situations where objects are not yet attached to parents (e.g., SBMLDocument_t), knowledge of the intented SBML Level and Version help libSBML determine such things as whether it is valid to assign a particular value to an attribute. For packages, this means that the parent object to which this package element is being added must have been created with the package namespace, or that the package namespace was added to it, even if that parent is not a package object itself.
Warning
The pointer that is returned by this function is owned by the caller, who is responsible for deleting it. Any changes made to the element will not be reflected in any resulting SBML document unless the element is added to an SBML Document. Even in this case, the element's deletion is still the responsibility of the caller with two exceptions: if it is used as the "disownedItem" in the ListOf_appendAndOwn() or ListOf_insertAndOwn() functions. All other functions in libsbml add a copy of the element, and do not transfer ownership of the pointer.
void Style_free ( Style_t s)

Frees this Style_t object.

Parameters
sthe Style_t structure.
const RenderGroup_t * Style_getGroup ( const Style_t s)

Returns the value of the "group" element of this Style_t.

Parameters
sthe Style_t structure whose group is sought.
Returns
the value of the "group" element of this Style_t as a RenderGroup_t.
char * Style_getId ( const Style_t s)

Returns the value of the "id" attribute of this Style_t.

Parameters
sthe Style_t structure whose id is sought.
Returns
the value of the "id" attribute of this Style_t as a pointer to a string.
Warning
The string returned by this function is owned by the caller, who is responsible for deleting it. Any changes made to the string will not be reflected in any resulting SBML document unless the string is added to an SBML Document. Even in this case, the string should be deleted, as adding a string to an SBML Document adds a copy of the string, and does not transfer ownership of that string.
char * Style_getName ( const Style_t s)

Returns the value of the "name" attribute of this Style_t.

Parameters
sthe Style_t structure whose name is sought.
Returns
the value of the "name" attribute of this Style_t as a pointer to a string.
Warning
The string returned by this function is owned by the caller, who is responsible for deleting it. Any changes made to the string will not be reflected in any resulting SBML document unless the string is added to an SBML Document. Even in this case, the string should be deleted, as adding a string to an SBML Document adds a copy of the string, and does not transfer ownership of that string.
int Style_hasRequiredAttributes ( const Style_t s)

Predicate returning 1 (true) if all the required attributes for this Style_t object have been set.

Parameters
sthe Style_t structure.
Returns
1 (true) to indicate that all the required attributes of this Style_t have been set, otherwise 0 (false) is returned.
int Style_isGlobalStyle ( const Style_t s)

Predicate returning 1 if this Style_t is of type GlobalStyle_t.

Parameters
sthe Style_t structure.
Returns
1 if this Style_t is of type GlobalStyle_t, 0 otherwise
int Style_isLocalStyle ( const Style_t s)

Predicate returning 1 if this Style_t is of type LocalStyle_t.

Parameters
sthe Style_t structure.
Returns
1 if this Style_t is of type LocalStyle_t, 0 otherwise
int Style_isSetGroup ( const Style_t s)

Predicate returning 1 (true) if this Style_t's "group" element is set.

Parameters
sthe Style_t structure.
Returns
1 (true) if this Style_t's "group" element has been set, otherwise 0 (false) is returned.
int Style_isSetId ( const Style_t s)

Returns the value of the "roleList" attribute of this Style_t.

Parameters
sthe Style_t structure whose roleList is sought.
Returns
the value of the "roleList" attribute of this Style_t as a pointer to a string.
Warning
The string returned by this function is owned by the caller, who is responsible for deleting it. Any changes made to the string will not be reflected in any resulting SBML document unless the string is added to an SBML Document. Even in this case, the string should be deleted, as adding a string to an SBML Document adds a copy of the string, and does not transfer ownership of that string. Returns the value of the "typeList" attribute of this Style_t.
Parameters
sthe Style_t structure whose typeList is sought.
Returns
the value of the "typeList" attribute of this Style_t as a pointer to a string.
Warning
The string returned by this function is owned by the caller, who is responsible for deleting it. Any changes made to the string will not be reflected in any resulting SBML document unless the string is added to an SBML Document. Even in this case, the string should be deleted, as adding a string to an SBML Document adds a copy of the string, and does not transfer ownership of that string. Predicate returning 1 (true) if this Style_t's "id" attribute is set.
Parameters
sthe Style_t structure.
Returns
1 (true) if this Style_t's "id" attribute has been set, otherwise 0 (false) is returned.
int Style_isSetName ( const Style_t s)

Predicate returning 1 (true) if this Style_t's "name" attribute is set.

Parameters
sthe Style_t structure.
Returns
1 (true) if this Style_t's "name" attribute has been set, otherwise 0 (false) is returned.
int Style_setGroup ( Style_t s,
const RenderGroup_t group 
)

Sets the value of the "group" element of this Style_t.

Parameters
sthe Style_t structure.
groupRenderGroup_t value of the "group" element to be set.
Returns
integer value indicating success/failure of the function. The value is drawn from the enumeration OperationReturnValues_t. The possible values returned by this function are:
int Style_setId ( Style_t s,
const char *  id 
)

Sets the value of the "id" attribute of this Style_t.

Parameters
sthe Style_t structure.
idconst char * value of the "id" attribute to be set.
Returns
integer value indicating success/failure of the function. The value is drawn from the enumeration OperationReturnValues_t. The possible values returned by this function are: Calling this function with id = NULL or an empty string is equivalent to calling Style_unsetId().
int Style_setName ( Style_t s,
const char *  name 
)

Sets the value of the "name" attribute of this Style_t.

Parameters
sthe Style_t structure.
nameconst char * value of the "name" attribute to be set.
Returns
integer value indicating success/failure of the function. The value is drawn from the enumeration OperationReturnValues_t. The possible values returned by this function are: Calling this function with name = NULL or an empty string is equivalent to calling Style_unsetName().
int Style_setRoleList ( Style_t s,
const char *  roleList 
)

Sets the value of the "roleList" attribute of this Style_t.

Parameters
sthe Style_t structure.
roleListconst char * value of the "roleList" attribute to be set.
Returns
integer value indicating success/failure of the function. The value is drawn from the enumeration OperationReturnValues_t. The possible values returned by this function are: Calling this function with roleList = NULL or an empty string is equivalent to calling Style_unsetRoleList().
int Style_setTypeList ( Style_t s,
const char *  typeList 
)

Sets the value of the "typeList" attribute of this Style_t.

Parameters
sthe Style_t structure.
typeListconst char * value of the "typeList" attribute to be set.
The attribute "typeList" for LocalStyle_t and GlobalStyle_t objects contains a list of StyleType entries that describe what sorts of object to apply the style to. In the SBML Level 3 Version 1 Render specification, the following are the allowable entries in a whitespace-separated "typeList":
  • "COMPARTMENTGLYPH": The style is to be applied to all compartment glyphs.

  • "SPECIESGLYPH": The style is to be applied to all species glyphs.

  • "REACTIONGLYPH": The style is to be applied to all reaction glyphs.

  • "SPECIESREFERENCEGLYPH": The style is to be applied to all species reference glyphs.

  • "TEXTGLYPH": The style is to be applied to all text glyphs.

  • "GENERALGLYPH": The style is to be applied to all general glyphs.

  • "GRAPHICALOBJECT": The style is to be applied to all graphical objects.

  • "ANY": The style is to be applied to any and all glyphs and graphical objects. Equivalent to explicitly listing all other keywords.

Returns
integer value indicating success/failure of the function. The value is drawn from the enumeration OperationReturnValues_t. The possible values returned by this function are: Calling this function with typeList = NULL or an empty string is equivalent to calling Style_unsetTypeList().
int Style_unsetGroup ( Style_t s)

Unsets the value of the "group" element of this Style_t.

Parameters
sthe Style_t structure.
Returns
integer value indicating success/failure of the function. The value is drawn from the enumeration OperationReturnValues_t. The possible values returned by this function are:
int Style_unsetId ( Style_t s)

Unsets the value of the "id" attribute of this Style_t.

Parameters
sthe Style_t structure.
Returns
integer value indicating success/failure of the function. The value is drawn from the enumeration OperationReturnValues_t. The possible values returned by this function are:
int Style_unsetName ( Style_t s)

Unsets the value of the "name" attribute of this Style_t.

Parameters
sthe Style_t structure.
Returns
integer value indicating success/failure of the function. The value is drawn from the enumeration OperationReturnValues_t. The possible values returned by this function are:
int Style_unsetRoleList ( Style_t s)

Unsets the value of the "roleList" attribute of this Style_t.

Parameters
sthe Style_t structure.
Returns
integer value indicating success/failure of the function. The value is drawn from the enumeration OperationReturnValues_t. The possible values returned by this function are:
int Style_unsetTypeList ( Style_t s)

Unsets the value of the "typeList" attribute of this Style_t.

Parameters
sthe Style_t structure.
The attribute "typeList" for LocalStyle_t and GlobalStyle_t objects contains a list of StyleType entries that describe what sorts of object to apply the style to. In the SBML Level 3 Version 1 Render specification, the following are the allowable entries in a whitespace-separated "typeList":
  • "COMPARTMENTGLYPH": The style is to be applied to all compartment glyphs.

  • "SPECIESGLYPH": The style is to be applied to all species glyphs.

  • "REACTIONGLYPH": The style is to be applied to all reaction glyphs.

  • "SPECIESREFERENCEGLYPH": The style is to be applied to all species reference glyphs.

  • "TEXTGLYPH": The style is to be applied to all text glyphs.

  • "GENERALGLYPH": The style is to be applied to all general glyphs.

  • "GRAPHICALOBJECT": The style is to be applied to all graphical objects.

  • "ANY": The style is to be applied to any and all glyphs and graphical objects. Equivalent to explicitly listing all other keywords.

Returns
integer value indicating success/failure of the function. The value is drawn from the enumeration OperationReturnValues_t. The possible values returned by this function are: