libSBML Python API  5.11.0
libsbml.LinearGradient Class Reference
Inheritance diagram for libsbml.LinearGradient:
[legend]

Detailed Description

Representation of a linear gradient object from the SBML render extension.

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 class apply. (

See also
GradientBase)

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

See also
RelAbsVector)

For examples of LinearGradients see the render extension specification and/or the SVG specification.

Public Member Functions

def __init__ (self, args)
 Representation of a linear gradient object from the SBML render extension. More...
 
def clone (self)
 Creates and returns a deep copy of this LinearGradient object. More...
 
def getElementName (self)
 Returns the XML element name of this object. More...
 
def getTypeCode (self)
 Returns the libSBML type code for this SBML object. More...
 
def getXPoint1 (self, args)
 Returns the x coordinate for the start point as a reference. More...
 
def getXPoint2 (self, args)
 Returns the x coordinate for the end point as a reference. More...
 
def getYPoint1 (self, args)
 Returns the y coordinate for the start point as a reference. More...
 
def getYPoint2 (self, args)
 Returns the y coordinate for the end point as a reference. More...
 
def getZPoint1 (self, args)
 Returns the z coordinate for the start point as a reference. More...
 
def getZPoint2 (self, args)
 Returns the z coordinate for the end point as a reference. More...
 
def setCoordinates (self, args)
 This method has multiple variants; they differ in the arguments they accept. More...
 
def setPoint1 (self, args)
 Sets the coordinates for the start point of the linear gradient vector. More...
 
def setPoint2 (self, args)
 Sets the coordinates for the end point of the linear gradient vector. More...
 
def toXML (self)
 Creates an XMLNode object from this LinearGradient object. More...
 

Constructor & Destructor Documentation

def libsbml.LinearGradient.__init__ (   self,
  args 
)

Representation of a linear gradient object from the SBML render extension.

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 class apply. (

See also
GradientBase)

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

See also
RelAbsVector)

For examples of LinearGradients see the render extension specification and/or the SVG specification.

This method has multiple variants; they differ in the arguments they accept.

__init__(long level, long version, long pkgVersion)   LinearGradient
__init__(long level, long version)   LinearGradient
__init__(long level)   LinearGradient
__init__()   LinearGradient
__init__(RenderPkgNamespaces renderns)   LinearGradient
__init__(XMLNode node, long l2version=4)   LinearGradient
__init__(XMLNode node)   LinearGradient
__init__(RenderPkgNamespaces renderns, string id)   LinearGradient

Each variant is described separately below.


Method variant with the following signature:
LinearGradient(XMLNode node, long l2version=4)

Creates a new LinearGradient object from the given XMLNode object. The XMLNode object has to contain a valid XML representation of a LinearGradient object as defined in the render extension specification. This method is normally called when render information is read from a file and should normally not have to be called explicitely.

Parameters
nodethe XMLNode object reference that describes the LinearGradient object to be instantiated.

Method variant with the following signature:
LinearGradient(RenderPkgNamespaces renderns)

Creates a new LinearGradient object with the given SBMLNamespaces.

Parameters
sbmlnsThe SBML namespace for the object.

Method variant with the following signature:
LinearGradient(long level = RenderExtension.getDefaultLevel(), long version = RenderExtension.getDefaultVersion(), long pkgVersion = RenderExtension.getDefaultPackageVersion())

Creates a new LinearGradient object with the given SBML level and SBML version.

Parameters
levelSBML level of the new object
levelSBML version of the new object

Method variant with the following signature:
LinearGradient(RenderPkgNamespaces renderns, string id)

Constructor which creates a LinearGradient with no gradient stops. The id is set to the given value. The LinearGradient object is invalid until it has an id and at least two gradient stops. The start and the end of the linear gradient vector are set to (0,0,0). A linear gradient with a vector of length zero should also be considered invalid.

Parameters
idthe new id for the LinearGradient.

This constructor is deprecated. The new libsbml API only has constructors which take the SBML level and version or one that takes an SBMLNamespaces object.

Member Function Documentation

def libsbml.LinearGradient.clone (   self)

Creates and returns a deep copy of this LinearGradient object.

clone()   LinearGradient
Returns
a (deep) copy of this LinearGradient object
def libsbml.LinearGradient.getElementName (   self)

Returns the XML element name of this object.

getElementName()   string

This is overridden by subclasses to return a string appropriate to the SBML component. For example, Model defines it as returning 'model', CompartmentType defines it as returning 'compartmentType', etc.

def libsbml.LinearGradient.getTypeCode (   self)

Returns the libSBML type code for this SBML object.

getTypeCode()   int
Returns
the SBML type code for this object, or SBML_UNKNOWN (default).
See also
getElementName()
def libsbml.LinearGradient.getXPoint1 (   self,
  args 
)

Returns the x coordinate for the start point as a reference.

getXPoint1()   RelAbsVector
Returns
RelAbsVector that represents the x value of the start point.
def libsbml.LinearGradient.getXPoint2 (   self,
  args 
)

Returns the x coordinate for the end point as a reference.

getXPoint2()   RelAbsVector
Returns
RelAbsVector that represents the x value of the start point.
def libsbml.LinearGradient.getYPoint1 (   self,
  args 
)

Returns the y coordinate for the start point as a reference.

getYPoint1()   RelAbsVector
Returns
RelAbsVector that represents the y value of the start point.
def libsbml.LinearGradient.getYPoint2 (   self,
  args 
)

Returns the y coordinate for the end point as a reference.

getYPoint2()   RelAbsVector
Returns
RelAbsVector that represents the y value of the start point.
def libsbml.LinearGradient.getZPoint1 (   self,
  args 
)

Returns the z coordinate for the start point as a reference.

getZPoint1()   RelAbsVector
Returns
RelAbsVector that represents the z value of the start point.
def libsbml.LinearGradient.getZPoint2 (   self,
  args 
)

Returns the z coordinate for the end point as a reference.

getZPoint2()   RelAbsVector
Returns
RelAbsVector that represents the z value of the start point.
def libsbml.LinearGradient.setCoordinates (   self,
  args 
)

This method has multiple variants; they differ in the arguments they accept.

setCoordinates(RelAbsVector x1, RelAbsVector y1, RelAbsVector z1, RelAbsVector x2, RelAbsVector y2, RelAbsVector z2)
setCoordinates(RelAbsVector x1, RelAbsVector y1, RelAbsVector x2, RelAbsVector y2)

Each variant is described separately below.


Method variant with the following signature:
setCoordinates(RelAbsVector x1,RelAbsVector y1,RelAbsVector x2,RelAbsVector y2)

Sets the 2D coordinates for the start and the end point of the linear gradient vector. The z values are automatically set to 0. Each value can be a combination of absolute and relative value and is represented by a RelAbsVector object.

Parameters
x1x value of the start point of the linear gradient vector
y1y value of the start point of the linear gradient vector
x2x value of the end point of the linear gradient vector
y2y value of the end point of the linear gradient vector

Method variant with the following signature:
setCoordinates(RelAbsVector x1,RelAbsVector y1,RelAbsVector z1,RelAbsVector x2,RelAbsVector y2,RelAbsVector z2)

Sets the 3D coordinates for the start and the end point of the linear gradient vector. Each value can be a combination of absolute and relative value and is represented by a RelAbsVector object.

Parameters
x1x value of the start point of the linear gradient vector
y1y value of the start point of the linear gradient vector
z1z value of the start point of the linear gradient vector
x2x value of the end point of the linear gradient vector
y2y value of the end point of the linear gradient vector
z2z value of the end point of the linear gradient vector
def libsbml.LinearGradient.setPoint1 (   self,
  args 
)

Sets the coordinates for the start point of the linear gradient vector.

setPoint1(RelAbsVector x, RelAbsVector y, RelAbsVector z)
setPoint1(RelAbsVector x, RelAbsVector y)

Each value can be a combination of absolute and relative value and is represented by a RelAbsVector object.

The z value can be omitted. In that case it is set to 0.

Parameters
xx value of the start point of the linear gradient vector
yy value of the start point of the linear gradient vector
zz value of the start point of the linear gradient vector
def libsbml.LinearGradient.setPoint2 (   self,
  args 
)

Sets the coordinates for the end point of the linear gradient vector.

setPoint2(RelAbsVector x, RelAbsVector y, RelAbsVector z)
setPoint2(RelAbsVector x, RelAbsVector y)

Each value can be a combination of absolute and relative value and is represented by a RelAbsVector object.

The z value can be omitted. In that case it is set to 0.

Parameters
xx value of the end point of the linear gradient vector
yy value of the end point of the linear gradient vector
zz value of the end point of the linear gradient vector
def libsbml.LinearGradient.toXML (   self)

Creates an XMLNode object from this LinearGradient object.

toXML()   XMLNode
Returns
the XMLNode with the XML representation for the LinearGradient object.