libSBML C API  5.18.0
LinearGradient_t Class Reference

Detailed Description

render Representation of a linear gradient.

The concept of a linear gradient is more or or less taken from SVG. A linear gradient is defined by a vector which determines the direction and the length of the gradient. So for a valid gradient, this vector should have a length different from 0. Otherwise, all restrictions for the GradientBase_t class apply.

The vector for a linear gradient is defined by a start and an endpoint and each point consists of three absolute-relative value pairs.

For examples of LinearGradient_t objects, see the SBML Render package specification and/or the SVG specification.

See also
GradientBase_t
RelAbsVector_t

Public Member Functions

LinearGradient_tLinearGradient_clone (const LinearGradient_t *lg)
 Creates and returns a deep copy of this LinearGradient_t object. More...
 
LinearGradient_tLinearGradient_create (unsigned int level, unsigned int version, unsigned int pkgVersion)
 Creates a new LinearGradient_t using the given SBML Level, Version and “render” package version. More...
 
void LinearGradient_free (LinearGradient_t *lg)
 Frees this LinearGradient_t object. More...
 
const RelAbsVector_tLinearGradient_getX1 (const LinearGradient_t *lg)
 Returns the value of the "x1" element of this LinearGradient_t. More...
 
const RelAbsVector_tLinearGradient_getX2 (const LinearGradient_t *lg)
 Returns the value of the "x2" element of this LinearGradient_t. More...
 
const RelAbsVector_tLinearGradient_getY1 (const LinearGradient_t *lg)
 Returns the value of the "y1" element of this LinearGradient_t. More...
 
const RelAbsVector_tLinearGradient_getY2 (const LinearGradient_t *lg)
 Returns the value of the "y2" element of this LinearGradient_t. More...
 
const RelAbsVector_tLinearGradient_getZ1 (const LinearGradient_t *lg)
 Returns the value of the "z1" element of this LinearGradient_t. More...
 
const RelAbsVector_tLinearGradient_getZ2 (const LinearGradient_t *lg)
 Returns the value of the "z2" element of this LinearGradient_t. More...
 
int LinearGradient_hasRequiredAttributes (const LinearGradient_t *lg)
 Predicate returning 1 (true) if all the required attributes for this LinearGradient_t object have been set. More...
 
int LinearGradient_hasRequiredElements (const LinearGradient_t *lg)
 Predicate returning 1 (true) if all the required elements for this LinearGradient_t object have been set. More...
 
int LinearGradient_isSetX1 (const LinearGradient_t *lg)
 Predicate returning 1 (true) if this LinearGradient_t's "x1" element is set. More...
 
int LinearGradient_isSetX2 (const LinearGradient_t *lg)
 Predicate returning 1 (true) if this LinearGradient_t's "x2" element is set. More...
 
int LinearGradient_isSetY1 (const LinearGradient_t *lg)
 Predicate returning 1 (true) if this LinearGradient_t's "y1" element is set. More...
 
int LinearGradient_isSetY2 (const LinearGradient_t *lg)
 Predicate returning 1 (true) if this LinearGradient_t's "y2" element is set. More...
 
int LinearGradient_isSetZ1 (const LinearGradient_t *lg)
 Predicate returning 1 (true) if this LinearGradient_t's "z1" element is set. More...
 
int LinearGradient_isSetZ2 (const LinearGradient_t *lg)
 Predicate returning 1 (true) if this LinearGradient_t's "z2" element is set. More...
 
int LinearGradient_setX1 (LinearGradient_t *lg, const RelAbsVector_t *x1)
 Sets the value of the "x1" element of this LinearGradient_t. More...
 
int LinearGradient_setX2 (LinearGradient_t *lg, const RelAbsVector_t *x2)
 Sets the value of the "x2" element of this LinearGradient_t. More...
 
int LinearGradient_setY1 (LinearGradient_t *lg, const RelAbsVector_t *y1)
 Sets the value of the "y1" element of this LinearGradient_t. More...
 
int LinearGradient_setY2 (LinearGradient_t *lg, const RelAbsVector_t *y2)
 Sets the value of the "y2" element of this LinearGradient_t. More...
 
int LinearGradient_setZ1 (LinearGradient_t *lg, const RelAbsVector_t *z1)
 Sets the value of the "z1" element of this LinearGradient_t. More...
 
int LinearGradient_setZ2 (LinearGradient_t *lg, const RelAbsVector_t *z2)
 Sets the value of the "z2" element of this LinearGradient_t. More...
 
int LinearGradient_unsetX1 (LinearGradient_t *lg)
 Unsets the value of the "x1" element of this LinearGradient_t. More...
 
int LinearGradient_unsetX2 (LinearGradient_t *lg)
 Unsets the value of the "x2" element of this LinearGradient_t. More...
 
int LinearGradient_unsetY1 (LinearGradient_t *lg)
 Unsets the value of the "y1" element of this LinearGradient_t. More...
 
int LinearGradient_unsetY2 (LinearGradient_t *lg)
 Unsets the value of the "y2" element of this LinearGradient_t. More...
 
int LinearGradient_unsetZ1 (LinearGradient_t *lg)
 Unsets the value of the "z1" element of this LinearGradient_t. More...
 
int LinearGradient_unsetZ2 (LinearGradient_t *lg)
 Unsets the value of the "z2" element of this LinearGradient_t. More...
 

Member Function Documentation

LinearGradient_t * LinearGradient_clone ( const LinearGradient_t lg)

Creates and returns a deep copy of this LinearGradient_t object.

Parameters
lgthe LinearGradient_t structure.
Returns
a (deep) copy of this LinearGradient_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.
LinearGradient_t * LinearGradient_create ( unsigned int  level,
unsigned int  version,
unsigned int  pkgVersion 
)

Creates a new LinearGradient_t using the given SBML Level, Version and “render” package version.

Parameters
levelan unsigned int, the SBML Level to assign to this LinearGradient_t.
versionan unsigned int, the SBML Version to assign to this LinearGradient_t.
pkgVersionan unsigned int, the SBML Render Version to assign to this LinearGradient_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 LinearGradient_free ( LinearGradient_t lg)

Frees this LinearGradient_t object.

Parameters
lgthe LinearGradient_t structure.
const RelAbsVector_t * LinearGradient_getX1 ( const LinearGradient_t lg)

Returns the value of the "x1" element of this LinearGradient_t.

Parameters
lgthe LinearGradient_t structure whose x1 is sought.
Returns
the value of the "x1" element of this LinearGradient_t as a RelAbsVector_t.
const RelAbsVector_t * LinearGradient_getX2 ( const LinearGradient_t lg)

Returns the value of the "x2" element of this LinearGradient_t.

Parameters
lgthe LinearGradient_t structure whose x2 is sought.
Returns
the value of the "x2" element of this LinearGradient_t as a RelAbsVector_t.
const RelAbsVector_t * LinearGradient_getY1 ( const LinearGradient_t lg)

Returns the value of the "y1" element of this LinearGradient_t.

Parameters
lgthe LinearGradient_t structure whose y1 is sought.
Returns
the value of the "y1" element of this LinearGradient_t as a RelAbsVector_t.
const RelAbsVector_t * LinearGradient_getY2 ( const LinearGradient_t lg)

Returns the value of the "y2" element of this LinearGradient_t.

Parameters
lgthe LinearGradient_t structure whose y2 is sought.
Returns
the value of the "y2" element of this LinearGradient_t as a RelAbsVector_t.
const RelAbsVector_t * LinearGradient_getZ1 ( const LinearGradient_t lg)

Returns the value of the "z1" element of this LinearGradient_t.

Parameters
lgthe LinearGradient_t structure whose z1 is sought.
Returns
the value of the "z1" element of this LinearGradient_t as a RelAbsVector_t.
const RelAbsVector_t * LinearGradient_getZ2 ( const LinearGradient_t lg)

Returns the value of the "z2" element of this LinearGradient_t.

Parameters
lgthe LinearGradient_t structure whose z2 is sought.
Returns
the value of the "z2" element of this LinearGradient_t as a RelAbsVector_t.
int LinearGradient_hasRequiredAttributes ( const LinearGradient_t lg)

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

Parameters
lgthe LinearGradient_t structure.
Returns
1 (true) to indicate that all the required attributes of this LinearGradient_t have been set, otherwise 0 (false) is returned.
int LinearGradient_hasRequiredElements ( const LinearGradient_t lg)

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

Parameters
lgthe LinearGradient_t structure.
Returns
1 (true) to indicate that all the required elements of this LinearGradient_t have been set, otherwise 0 (false) is returned.
Note
The required elements for the LinearGradient_t object are:
int LinearGradient_isSetX1 ( const LinearGradient_t lg)

Predicate returning 1 (true) if this LinearGradient_t's "x1" element is set.

Parameters
lgthe LinearGradient_t structure.
Returns
1 (true) if this LinearGradient_t's "x1" element has been set, otherwise 0 (false) is returned.
int LinearGradient_isSetX2 ( const LinearGradient_t lg)

Predicate returning 1 (true) if this LinearGradient_t's "x2" element is set.

Parameters
lgthe LinearGradient_t structure.
Returns
1 (true) if this LinearGradient_t's "x2" element has been set, otherwise 0 (false) is returned.
int LinearGradient_isSetY1 ( const LinearGradient_t lg)

Predicate returning 1 (true) if this LinearGradient_t's "y1" element is set.

Parameters
lgthe LinearGradient_t structure.
Returns
1 (true) if this LinearGradient_t's "y1" element has been set, otherwise 0 (false) is returned.
int LinearGradient_isSetY2 ( const LinearGradient_t lg)

Predicate returning 1 (true) if this LinearGradient_t's "y2" element is set.

Parameters
lgthe LinearGradient_t structure.
Returns
1 (true) if this LinearGradient_t's "y2" element has been set, otherwise 0 (false) is returned.
int LinearGradient_isSetZ1 ( const LinearGradient_t lg)

Predicate returning 1 (true) if this LinearGradient_t's "z1" element is set.

Parameters
lgthe LinearGradient_t structure.
Returns
1 (true) if this LinearGradient_t's "z1" element has been set, otherwise 0 (false) is returned.
int LinearGradient_isSetZ2 ( const LinearGradient_t lg)

Predicate returning 1 (true) if this LinearGradient_t's "z2" element is set.

Parameters
lgthe LinearGradient_t structure.
Returns
1 (true) if this LinearGradient_t's "z2" element has been set, otherwise 0 (false) is returned.
int LinearGradient_setX1 ( LinearGradient_t lg,
const RelAbsVector_t x1 
)

Sets the value of the "x1" element of this LinearGradient_t.

Parameters
lgthe LinearGradient_t structure.
x1RelAbsVector_t value of the "x1" 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 LinearGradient_setX2 ( LinearGradient_t lg,
const RelAbsVector_t x2 
)

Sets the value of the "x2" element of this LinearGradient_t.

Parameters
lgthe LinearGradient_t structure.
x2RelAbsVector_t value of the "x2" 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 LinearGradient_setY1 ( LinearGradient_t lg,
const RelAbsVector_t y1 
)

Sets the value of the "y1" element of this LinearGradient_t.

Parameters
lgthe LinearGradient_t structure.
y1RelAbsVector_t value of the "y1" 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 LinearGradient_setY2 ( LinearGradient_t lg,
const RelAbsVector_t y2 
)

Sets the value of the "y2" element of this LinearGradient_t.

Parameters
lgthe LinearGradient_t structure.
y2RelAbsVector_t value of the "y2" 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 LinearGradient_setZ1 ( LinearGradient_t lg,
const RelAbsVector_t z1 
)

Sets the value of the "z1" element of this LinearGradient_t.

Parameters
lgthe LinearGradient_t structure.
z1RelAbsVector_t value of the "z1" 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 LinearGradient_setZ2 ( LinearGradient_t lg,
const RelAbsVector_t z2 
)

Sets the value of the "z2" element of this LinearGradient_t.

Parameters
lgthe LinearGradient_t structure.
z2RelAbsVector_t value of the "z2" 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 LinearGradient_unsetX1 ( LinearGradient_t lg)

Unsets the value of the "x1" element of this LinearGradient_t.

Parameters
lgthe LinearGradient_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 LinearGradient_unsetX2 ( LinearGradient_t lg)

Unsets the value of the "x2" element of this LinearGradient_t.

Parameters
lgthe LinearGradient_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 LinearGradient_unsetY1 ( LinearGradient_t lg)

Unsets the value of the "y1" element of this LinearGradient_t.

Parameters
lgthe LinearGradient_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 LinearGradient_unsetY2 ( LinearGradient_t lg)

Unsets the value of the "y2" element of this LinearGradient_t.

Parameters
lgthe LinearGradient_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 LinearGradient_unsetZ1 ( LinearGradient_t lg)

Unsets the value of the "z1" element of this LinearGradient_t.

Parameters
lgthe LinearGradient_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 LinearGradient_unsetZ2 ( LinearGradient_t lg)

Unsets the value of the "z2" element of this LinearGradient_t.

Parameters
lgthe LinearGradient_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: