libSBML C API  5.18.0
ReactionGlyph_t Class Reference

Detailed Description

layout A glyph for an SBML reaction.

Analogous to how a Reaction_t object has to at least have one reactant or product, the ReactionGlyph_t has to at least have one SpeciesReferenceGlyph_t stored in the ListOfSpeciesReferenceGlyphs_t. Figure 12 on the following page provides the UML diagram for the class definition. The ReactionGlyph_t inherits from GraphicalObject_t. In addition to the attributes inherited from GraphicalObject_t, the ReactionGlyph_t is described by an attribute reaction, a Curve_t element and a listOfSpeciesReferenceGlyphs element. The Curve_t describes the center section of a ReactionGlyph_t. The center section is frequently used by tools to separate the point where substrates arcs come together, from the point where product arcs split off. The Curve_t is optional, and when not present the dimensions of the inherited BoundingBox_t describes the center section, by storing its position and dimension.

Public Member Functions

void ReactionGlyph_addSpeciesReferenceGlyph (ReactionGlyph_t *rg, SpeciesReferenceGlyph_t *srg)
 Add a SpeciesReferenceGlyph_t structure to the list of SpeciesReferenceGlyph_t's. More...
 
void ReactionGlyph_clear (ReactionGlyph_t *rg)
 Frees the memory taken up by the attributes. More...
 
ReactionGlyph_tReactionGlyph_clone (const ReactionGlyph_t *rg)
 
ReactionGlyph_tReactionGlyph_create (void)
 Creates a new ReactionGlyph_t and returns the pointer to it. More...
 
CubicBezier_tReactionGlyph_createCubicBezier (ReactionGlyph_t *rg)
 Creates a new CubicBezier_t structure, adds it to the end of the list of curve segments and returns a pointer to the newly created structure. More...
 
ReactionGlyph_tReactionGlyph_createFrom (const ReactionGlyph_t *temp)
 Creates a new ReactionGlyph_t structure from a template. More...
 
LineSegment_tReactionGlyph_createLineSegment (ReactionGlyph_t *rg)
 Creates a new LineSegment_t structure, adds it to the end of the list of curve segments and returns a pointer to the newly created structure. More...
 
SpeciesReferenceGlyph_tReactionGlyph_createSpeciesReferenceGlyph (ReactionGlyph_t *rg)
 Creates a new SpeciesReferenceGlyph_t structure, adds it to the end of the list of species reference glyphs and returns a pointer to the newly created structure. More...
 
ReactionGlyph_tReactionGlyph_createWith (const char *sid)
 Creates a new ReactionGlyph_t with the given sid. More...
 
ReactionGlyph_tReactionGlyph_createWithReactionId (const char *sid, const char *reactionId)
 Creates a new ReactionGlyph_t referencing the given reaction. More...
 
void ReactionGlyph_free (ReactionGlyph_t *rg)
 Frees the memory taken by the given reaction glyph. More...
 
Curve_tReactionGlyph_getCurve (ReactionGlyph_t *rg)
 Gets the Curve_t for the given reaction glyph. More...
 
unsigned int ReactionGlyph_getIndexForSpeciesReferenceGlyph (ReactionGlyph_t *rg, const char *id)
 Returns the index of the species reference glyph with the given id. More...
 
ListOf_tReactionGlyph_getListOfSpeciesReferenceGlyphs (ReactionGlyph_t *rg)
 Returns the list structure that holds all species reference glyphs. More...
 
unsigned int ReactionGlyph_getNumSpeciesReferenceGlyphs (const ReactionGlyph_t *rg)
 Returns the number of SpeciesReferenceGlyphs for the ReactionGlyph_t. More...
 
const char * ReactionGlyph_getReactionId (const ReactionGlyph_t *rg)
 Gets the reference reactions id for the given reaction glyph. More...
 
SpeciesReferenceGlyph_tReactionGlyph_getSpeciesReferenceGlyph (ReactionGlyph_t *rg, unsigned int index)
 Returns the pointer to the SpeciesReferenceGlyph_t for the given index. More...
 
void ReactionGlyph_initDefaults (ReactionGlyph_t *rg)
 Calls initDefaults from GraphicalObject_t. More...
 
int ReactionGlyph_isSetCurve (ReactionGlyph_t *rg)
 Returns 1 (true) if the Curve_t has one or more LineSegment_t. More...
 
int ReactionGlyph_isSetReactionId (const ReactionGlyph_t *rg)
 Returns 0 (false) if the reference reaction has not been set for this glyph and 1 (true) otherwise. More...
 
SpeciesReferenceGlyph_tReactionGlyph_removeSpeciesReferenceGlyph (ReactionGlyph_t *rg, unsigned int index)
 Remove the species reference glyph with the given index. More...
 
SpeciesReferenceGlyph_tReactionGlyph_removeSpeciesReferenceGlyphWithId (ReactionGlyph_t *rg, const char *id)
 Remove the species reference glyph with the given id. More...
 
void ReactionGlyph_setCurve (ReactionGlyph_t *rg, Curve_t *c)
 Sets the curve for the reaction glyph. More...
 
void ReactionGlyph_setReactionId (ReactionGlyph_t *rg, const char *id)
 Sets the reference reaction for the reaction glyph. More...
 

Member Function Documentation

void ReactionGlyph_addSpeciesReferenceGlyph ( ReactionGlyph_t rg,
SpeciesReferenceGlyph_t srg 
)

Add a SpeciesReferenceGlyph_t structure to the list of SpeciesReferenceGlyph_t's.

Parameters
rgthe ReactionGlyph_t structure.
srgthe SpeciesReferenceGlyph_t structure to add.
void ReactionGlyph_clear ( ReactionGlyph_t rg)

Frees the memory taken up by the attributes.

Parameters
rgthe ReactionGlyph_t structure.
ReactionGlyph_t * ReactionGlyph_clone ( const ReactionGlyph_t rg)
Returns
a (deep) copy of this ReactionGlyph_t.
Parameters
rgthe ReactionGlyph_t structure.
ReactionGlyph_t * ReactionGlyph_create ( void  )

Creates a new ReactionGlyph_t and returns the pointer to it.

CubicBezier_t * ReactionGlyph_createCubicBezier ( ReactionGlyph_t rg)

Creates a new CubicBezier_t structure, adds it to the end of the list of curve segments and returns a pointer to the newly created structure.

Parameters
rgthe ReactionGlyph_t structure.
ReactionGlyph_t * ReactionGlyph_createFrom ( const ReactionGlyph_t temp)

Creates a new ReactionGlyph_t structure from a template.

Parameters
tempthe ReactionGlyph_t structure to copy.
LineSegment_t * ReactionGlyph_createLineSegment ( ReactionGlyph_t rg)

Creates a new LineSegment_t structure, adds it to the end of the list of curve segments and returns a pointer to the newly created structure.

Parameters
rgthe ReactionGlyph_t structure.
SpeciesReferenceGlyph_t * ReactionGlyph_createSpeciesReferenceGlyph ( ReactionGlyph_t rg)

Creates a new SpeciesReferenceGlyph_t structure, adds it to the end of the list of species reference glyphs and returns a pointer to the newly created structure.

Parameters
rgthe ReactionGlyph_t structure.
ReactionGlyph_t * ReactionGlyph_createWith ( const char *  sid)

Creates a new ReactionGlyph_t with the given sid.

Parameters
sidthe string to use as the ID of the ReactionGlyph_t.
ReactionGlyph_t * ReactionGlyph_createWithReactionId ( const char *  sid,
const char *  reactionId 
)

Creates a new ReactionGlyph_t referencing the given reaction.

Parameters
sidthe string to use as the ID of the ReactionGlyph_t.
reactionIdthe string to use as the reaction ID.
void ReactionGlyph_free ( ReactionGlyph_t rg)

Frees the memory taken by the given reaction glyph.

Parameters
rgthe ReactionGlyph_t structure.
Curve_t * ReactionGlyph_getCurve ( ReactionGlyph_t rg)

Gets the Curve_t for the given reaction glyph.

Parameters
rgthe ReactionGlyph_t structure.
unsigned int ReactionGlyph_getIndexForSpeciesReferenceGlyph ( ReactionGlyph_t rg,
const char *  id 
)

Returns the index of the species reference glyph with the given id.

If the reaction glyph does not contain a species reference glyph with this id, UINT_MAX from limits.h is returned.

Parameters
rgthe ReactionGlyph_t structure.
idthe idof the SpeciesReferenceGlyph_t to find.
ListOf_t * ReactionGlyph_getListOfSpeciesReferenceGlyphs ( ReactionGlyph_t rg)

Returns the list structure that holds all species reference glyphs.

Parameters
rgthe ReactionGlyph_t structure.
unsigned int ReactionGlyph_getNumSpeciesReferenceGlyphs ( const ReactionGlyph_t rg)

Returns the number of SpeciesReferenceGlyphs for the ReactionGlyph_t.

Parameters
rgthe ReactionGlyph_t structure.
const char * ReactionGlyph_getReactionId ( const ReactionGlyph_t rg)

Gets the reference reactions id for the given reaction glyph.

Parameters
rgthe ReactionGlyph_t structure.
SpeciesReferenceGlyph_t * ReactionGlyph_getSpeciesReferenceGlyph ( ReactionGlyph_t rg,
unsigned int  index 
)

Returns the pointer to the SpeciesReferenceGlyph_t for the given index.

Parameters
rgthe ReactionGlyph_t structure.
indexthe index of the SpeciesReferenceGlyph_t to return.
void ReactionGlyph_initDefaults ( ReactionGlyph_t rg)

Calls initDefaults from GraphicalObject_t.

Parameters
rgthe ReactionGlyph_t structure.
int ReactionGlyph_isSetCurve ( ReactionGlyph_t rg)

Returns 1 (true) if the Curve_t has one or more LineSegment_t.

Parameters
rgthe ReactionGlyph_t structure.
int ReactionGlyph_isSetReactionId ( const ReactionGlyph_t rg)

Returns 0 (false) if the reference reaction has not been set for this glyph and 1 (true) otherwise.

Parameters
rgthe ReactionGlyph_t structure.
SpeciesReferenceGlyph_t * ReactionGlyph_removeSpeciesReferenceGlyph ( ReactionGlyph_t rg,
unsigned int  index 
)

Remove the species reference glyph with the given index.

A pointer to the structure is returned. If no structure has been removed, NULL is returned.

Parameters
rgthe ReactionGlyph_t structure.
indexthe index of the SpeciesReferenceGlyph_t to remove.
SpeciesReferenceGlyph_t * ReactionGlyph_removeSpeciesReferenceGlyphWithId ( ReactionGlyph_t rg,
const char *  id 
)

Remove the species reference glyph with the given id.

A pointer to the structure is returned. If no structure has been removed, NULL is returned.

Parameters
rgthe ReactionGlyph_t structure.
idthe id of the SpeciesReferenceGlyph_t to remove.
void ReactionGlyph_setCurve ( ReactionGlyph_t rg,
Curve_t c 
)

Sets the curve for the reaction glyph.

Parameters
rgthe ReactionGlyph_t structure.
cthe Curve_t to set for the SpeciesReferenceGlyph_t.
void ReactionGlyph_setReactionId ( ReactionGlyph_t rg,
const char *  id 
)

Sets the reference reaction for the reaction glyph.

Parameters
rgthe ReactionGlyph_t structure.
idthe string to use as the reaction ID.