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

Detailed Description

This class represents a pair of numerical values where one value represents an absolute value and the other value is a relative value in percent.

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.

The relative and absolute values to initialize a RelAbsVector object can either be given as numerical datatypes (float) 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

def __add__ (self, other)
 
def __div__ (self, x)
 
def __eq__ (self, other)
 
def __init__ (self, args)
 This class represents a pair of numerical values where one value represents an absolute value and the other value is a relative value in percent. More...
 
def __ne__ (self, other)
 
def getAbsoluteValue (self)
 Returns the absolute coordinate value. More...
 
def getRelativeValue (self)
 Returns the relative coordinate value. More...
 
def setAbsoluteValue (self, abs)
 Sets the absolute coordinate value. More...
 
def setCoordinate (self, args)
 This method has multiple variants; they differ in the arguments they accept. More...
 
def setRelativeValue (self, rel)
 Sets the relative coordinate value. More...
 

Constructor & Destructor Documentation

def libsbml.RelAbsVector.__init__ (   self,
  args 
)

This class represents a pair of numerical values where one value represents an absolute value and the other value is a relative value in percent.

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.

The relative and absolute values to initialize a RelAbsVector object can either be given as numerical datatypes (float) 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'.

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

__init__ (float a=0.0, float r=0.0)   RelAbsVector
__init__ (float a=0.0)   RelAbsVector
__init__()   RelAbsVector
__init__(string coordString)   RelAbsVector

Each variant is described separately below.


Method variant with the following signature:
RelAbsVector (float a=0.0,double r=0.0)

Constructor with two values. First value sets the absolute value, second sets the relative value (%).

Parameters
aabsolute value
arelative value in % (50 50%)

Method variant with the following signature:
RelAbsVector(string coordString)

Constructor with a value string. If the string does not represent a valid value, the relative and the absolute component of the RelAbsVector are set to NaN.

Member Function Documentation

def libsbml.RelAbsVector.__add__ (   self,
  other 
)
__add__(RelAbsVector other)   RelAbsVector
def libsbml.RelAbsVector.__div__ (   self,
  x 
)
__div__ (float x)   RelAbsVector
def libsbml.RelAbsVector.__eq__ (   self,
  other 
)
__eq__(RelAbsVector other)   bool
def libsbml.RelAbsVector.__ne__ (   self,
  other 
)
__ne__(RelAbsVector other)   bool
def libsbml.RelAbsVector.getAbsoluteValue (   self)

Returns the absolute coordinate value.

getAbsoluteValue()   float
Returns
absolute value
def libsbml.RelAbsVector.getRelativeValue (   self)

Returns the relative coordinate value.

getRelativeValue()   float
Returns
absolute value
def libsbml.RelAbsVector.setAbsoluteValue (   self,
  abs 
)

Sets the absolute coordinate value.

setAbsoluteValue (float abs)
Parameters
absabsolute value to be set
def libsbml.RelAbsVector.setCoordinate (   self,
  args 
)

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

setCoordinate (float abs, float rel=0.0)
setCoordinate (float abs)
setCoordinate(string coordString)

Each variant is described separately below.


Method variant with the following signature:
setCoordinate(string coordString)

Sets the coordinatees from the given string. If the string does not represent a valid value, the relative and the absolute component of the RelAbsVector are set to NaN.

Parameters
coordStringvalue string

Method variant with the following signature:
setCoordinate (float abs,double rel=0.0)

Sets the relative and absolute value.

Parameters
absabsolute value
relrelative value. If the relative value is omitted, it is set to 0.
def libsbml.RelAbsVector.setRelativeValue (   self,
  rel 
)

Sets the relative coordinate value.

setRelativeValue (float rel)
Parameters
relrelative value to be set