libSBML C API  5.18.0
RelAbsVector_t Class Reference

Detailed Description

render Vectors with an absolute value and a relative value.

For many elements in the render extension, it is necessary to specify coordinates not in terms of absolute values, but rather in terms of relative values or even a combination of absolute and relative values. Such a pair of values where one represents an absolute value and the other represents a relative value can be expressed by a RelAbsVector_t. The RelAbsVector_t class represents a pair of numerical values where one value represents an absolute value and the other value is a relative value in percent.

The relative and absolute values to initialize a RelAbsVector_t object can either be given as numerical datatypes (double) or as a valid value string. A value string is a combination of an absolute value and a relative value and the absolute value if given has to come first. So valid value strings would be: "5.0e3+20%", or "100%" or "4".

Public Member Functions

RelAbsVector_tRelAbsVector_clone (const RelAbsVector_t *rav)
 Creates and returns a deep copy of this RelAbsVector_t object. More...
 
RelAbsVector_tRelAbsVector_create (double abs, double rel)
 Creates a new RelAbsVector_t . More...
 
void RelAbsVector_free (RelAbsVector_t *rav)
 Frees this RelAbsVector_t object. More...
 
double RelAbsVector_getAbsoluteValue (const RelAbsVector_t *rav)
 Returns the value of the "abs" attribute of this RelAbsVector_t. More...
 
double RelAbsVector_getRelativeValue (const RelAbsVector_t *rav)
 Returns the value of the "rel" attribute of this RelAbsVector_t. More...
 
int RelAbsVector_isSetAbsoluteValue (const RelAbsVector_t *rav)
 Predicate returning 1 (true) if this RelAbsVector_t's "abs" attribute is set. More...
 
int RelAbsVector_isSetRelativeValue (const RelAbsVector_t *rav)
 Predicate returning 1 (true) if this RelAbsVector_t's "rel" attribute is set. More...
 
int RelAbsVector_setAbsoluteValue (RelAbsVector_t *rav, double abs)
 Sets the value of the "abs" attribute of this RelAbsVector_t. More...
 
int RelAbsVector_setRelativeValue (RelAbsVector_t *rav, double rel)
 Sets the value of the "rel" attribute of this RelAbsVector_t. More...
 
int RelAbsVector_unsetAbsoluteValue (RelAbsVector_t *rav)
 Unsets the value of the "abs" attribute of this RelAbsVector_t. More...
 
int RelAbsVector_unsetRelativeValue (RelAbsVector_t *rav)
 Unsets the value of the "rel" attribute of this RelAbsVector_t. More...
 

Member Function Documentation

RelAbsVector_t * RelAbsVector_clone ( const RelAbsVector_t rav)

Creates and returns a deep copy of this RelAbsVector_t object.

Parameters
ravthe RelAbsVector_t structure.
Returns
a (deep) copy of this RelAbsVector_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.
RelAbsVector_t * RelAbsVector_create ( double  abs,
double  rel 
)

Creates a new RelAbsVector_t .

Parameters
absa double, the absolute value to assign to this RelAbsVector_t.
rela double, the relative value to assign to this RelAbsVector_t.
void RelAbsVector_free ( RelAbsVector_t rav)

Frees this RelAbsVector_t object.

Parameters
ravthe RelAbsVector_t structure.
double RelAbsVector_getAbsoluteValue ( const RelAbsVector_t rav)

Returns the value of the "abs" attribute of this RelAbsVector_t.

Parameters
ravthe RelAbsVector_t structure whose abs is sought.
Returns
the value of the "abs" attribute of this RelAbsVector_t as a double.
double RelAbsVector_getRelativeValue ( const RelAbsVector_t rav)

Returns the value of the "rel" attribute of this RelAbsVector_t.

Parameters
ravthe RelAbsVector_t structure whose rel is sought.
Returns
the value of the "rel" attribute of this RelAbsVector_t as a double.
int RelAbsVector_isSetAbsoluteValue ( const RelAbsVector_t rav)

Predicate returning 1 (true) if this RelAbsVector_t's "abs" attribute is set.

Parameters
ravthe RelAbsVector_t structure.
Returns
1 (true) if this RelAbsVector_t's "abs" attribute has been set, otherwise 0 (false) is returned.
int RelAbsVector_isSetRelativeValue ( const RelAbsVector_t rav)

Predicate returning 1 (true) if this RelAbsVector_t's "rel" attribute is set.

Parameters
ravthe RelAbsVector_t structure.
Returns
1 (true) if this RelAbsVector_t's "rel" attribute has been set, otherwise 0 (false) is returned.
int RelAbsVector_setAbsoluteValue ( RelAbsVector_t rav,
double  abs 
)

Sets the value of the "abs" attribute of this RelAbsVector_t.

Parameters
ravthe RelAbsVector_t structure.
absdouble value of the "abs" 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:
int RelAbsVector_setRelativeValue ( RelAbsVector_t rav,
double  rel 
)

Sets the value of the "rel" attribute of this RelAbsVector_t.

Parameters
ravthe RelAbsVector_t structure.
reldouble value of the "rel" 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:
int RelAbsVector_unsetAbsoluteValue ( RelAbsVector_t rav)

Unsets the value of the "abs" attribute of this RelAbsVector_t.

Parameters
ravthe RelAbsVector_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 RelAbsVector_unsetRelativeValue ( RelAbsVector_t rav)

Unsets the value of the "rel" attribute of this RelAbsVector_t.

Parameters
ravthe RelAbsVector_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: