libSBML Python API
5.11.0
|
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. (
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 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... | |
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. (
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 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.
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.
level | SBML level of the new object |
level | SBML version of the new object |
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.
id | the 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.
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.
node | the XMLNode object reference that describes the LinearGradient object to be instantiated. |
LinearGradient(RenderPkgNamespaces renderns)
Creates a new LinearGradient object with the given SBMLNamespaces.
sbmlns | The SBML namespace for the object. |
def libsbml.LinearGradient.clone | ( | self | ) |
Creates and returns a deep copy of this LinearGradient object.
clone() LinearGradient
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
SBML_UNKNOWN
(default).def libsbml.LinearGradient.getXPoint1 | ( | self, | |
args | |||
) |
Returns the x coordinate for the start point as a reference.
getXPoint1() RelAbsVector
def libsbml.LinearGradient.getXPoint2 | ( | self, | |
args | |||
) |
Returns the x coordinate for the end point as a reference.
getXPoint2() RelAbsVector
def libsbml.LinearGradient.getYPoint1 | ( | self, | |
args | |||
) |
Returns the y coordinate for the start point as a reference.
getYPoint1() RelAbsVector
def libsbml.LinearGradient.getYPoint2 | ( | self, | |
args | |||
) |
Returns the y coordinate for the end point as a reference.
getYPoint2() RelAbsVector
def libsbml.LinearGradient.getZPoint1 | ( | self, | |
args | |||
) |
Returns the z coordinate for the start point as a reference.
getZPoint1() RelAbsVector
def libsbml.LinearGradient.getZPoint2 | ( | self, | |
args | |||
) |
Returns the z coordinate for the end point as a reference.
getZPoint2() RelAbsVector
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.
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.
x1 | x value of the start point of the linear gradient vector |
y1 | y value of the start point of the linear gradient vector |
z1 | z value of the start point of the linear gradient vector |
x2 | x value of the end point of the linear gradient vector |
y2 | y value of the end point of the linear gradient vector |
z2 | z value of the end point of the linear gradient vector |
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.
x1 | x value of the start point of the linear gradient vector |
y1 | y value of the start point of the linear gradient vector |
x2 | x value of the end point of the linear gradient vector |
y2 | y 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.
x | x value of the start point of the linear gradient vector |
y | y value of the start point of the linear gradient vector |
z | z 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.
x | x value of the end point of the linear gradient vector |
y | y value of the end point of the linear gradient vector |
z | z 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