Chemical Data Processing Library Python API - Version 1.1.1
Public Member Functions | Properties | List of all members
CDPL.Vis.SizeSpecification Class Reference

Specifies the value and type of a size attribute and defines how the value may change during processing steps. More...

+ Inheritance diagram for CDPL.Vis.SizeSpecification:

Public Member Functions

None __init__ (SizeSpecification spec)
 Initializes a copy of the SizeSpecification instance spec. More...
 
None __init__ (float value=0.0, bool relative=False, bool input_scaling=False, bool output_scaling=False)
 Constructs a SizeSpecification object with the given attributes. More...
 
int getObjectID ()
 Returns the numeric identifier (ID) of the wrapped C++ class instance. More...
 
SizeSpecification assign (SizeSpecification spec)
 Replaces the current state of self with a copy of the state of the SizeSpecification instance spec. More...
 
bool followsInputScaling ()
 Tells if the specified size follows input scaling operations. More...
 
None followInputScaling (bool follow)
 Specifies whether the specified size has to follow input scaling operations. More...
 
bool followsOutputScaling ()
 Tells if the specified size follows output scaling operations. More...
 
None followOutputScaling (bool follow)
 Specifies whether the specified size has to follow output scaling operations. More...
 
bool isRelative ()
 Tells if the size specification is absolute or relative to another size. More...
 
None setRelative (bool relative)
 Specifies if the size specification is absolute or relative to another size. More...
 
float getValue ()
 Returns the value of the specified size. More...
 
None setValue (float value)
 Sets value of the specified size. More...
 
bool __eq__ (SizeSpecification spec)
 Equality comparison operator. More...
 
bool __ne__ (SizeSpecification spec)
 Inequality comparison operator. More...
 
str __str__ ()
 Returns a string representation of the SizeSpecification instance. More...
 

Properties

 objectID = property(getObjectID)
 
 inputScaling = property(followsInputScaling, followInputScaling)
 
 outputScaling = property(followsOutputScaling, followOutputScaling)
 
 relative = property(isRelative, setRelative)
 
 value = property(getValue, setValue)
 

Detailed Description

Specifies the value and type of a size attribute and defines how the value may change during processing steps.

Constructor & Destructor Documentation

◆ __init__() [1/2]

None CDPL.Vis.SizeSpecification.__init__ ( SizeSpecification  spec)

Initializes a copy of the SizeSpecification instance spec.

Parameters
specThe SizeSpecification instance to copy.

◆ __init__() [2/2]

None CDPL.Vis.SizeSpecification.__init__ ( float   value = 0.0,
bool   relative = False,
bool   input_scaling = False,
bool   output_scaling = False 
)

Constructs a SizeSpecification object with the given attributes.

Parameters
valueThe value of the specified size.
relativeTrue if the size specification is relative (proportional) to another size, and False otherwise.
input_scalingTrue if the specified size has to follow input scaling, and False otherwise.
output_scalingTrue if the specified size has to follow output scaling, and False otherwise.
See also
setValue(), setRelative(), followInputScaling(), followOutputScaling()

Member Function Documentation

◆ getObjectID()

int CDPL.Vis.SizeSpecification.getObjectID ( )

Returns the numeric identifier (ID) of the wrapped C++ class instance.

Different Python SizeSpecification instances may reference the same underlying C++ class instance. The commonly used Python expression a is not b thus cannot tell reliably whether the two SizeSpecification instances a and b reference different C++ objects. The numeric identifier returned by this method allows to correctly implement such an identity test via the simple expression a.getObjectID() != b.getObjectID().

Returns
The numeric ID of the internally referenced C++ class instance.

◆ assign()

SizeSpecification CDPL.Vis.SizeSpecification.assign ( SizeSpecification  spec)

Replaces the current state of self with a copy of the state of the SizeSpecification instance spec.

Parameters
specThe SizeSpecification instance to copy.
Returns
self

◆ followsInputScaling()

bool CDPL.Vis.SizeSpecification.followsInputScaling ( )

Tells if the specified size follows input scaling operations.

Returns
True if the specified size follows input scaling operations, and False otherwise.
See also
followInputScaling()

◆ followInputScaling()

None CDPL.Vis.SizeSpecification.followInputScaling ( bool  follow)

Specifies whether the specified size has to follow input scaling operations.

Input scaling is a pre-processing step (performed by some other part of the system) where an input size quantity is scaled to fulfill a certain constraint. An example is the scaling of input atom coordinates to obtain a certain average bond length for the 2D depiction of a chemical structure or reaction.

Parameters
followTrue if the specified size has to follow input scaling operations, and False otherwise.

◆ followsOutputScaling()

bool CDPL.Vis.SizeSpecification.followsOutputScaling ( )

Tells if the specified size follows output scaling operations.

Returns
True if the specified size follows output scaling operations, and False otherwise.
See also
followOutputScaling()

◆ followOutputScaling()

None CDPL.Vis.SizeSpecification.followOutputScaling ( bool  follow)

Specifies whether the specified size has to follow output scaling operations.

Output scaling is a post-processing step (performed by some other part of the system) where an output size quantity is scaled to fulfill a certain constraint. An example is the scaling of output atom coordinates to fit the 2D depiction of a chemical structure or reaction into the viewport area.

Parameters
followTrue if the specified size has to follow output scaling operations, and False otherwise.

◆ isRelative()

bool CDPL.Vis.SizeSpecification.isRelative ( )

Tells if the size specification is absolute or relative to another size.

Returns
True if the size specification is relative, and False otherwise.
See also
setRelative()

◆ setRelative()

None CDPL.Vis.SizeSpecification.setRelative ( bool  relative)

Specifies if the size specification is absolute or relative to another size.

If the size specification is relative (proportional) to another size, the size value is interpreted as a scaling factor for the absolute value of the other size.

Parameters
relativeTrue if the size specification is relative, and False otherwise.
See also
setValue()

◆ getValue()

float CDPL.Vis.SizeSpecification.getValue ( )

Returns the value of the specified size.

Returns
The value of the specified size.
See also
setValue()

◆ setValue()

None CDPL.Vis.SizeSpecification.setValue ( float  value)

Sets value of the specified size.

Parameters
valueThe value of the specified size.

◆ __eq__()

bool CDPL.Vis.SizeSpecification.__eq__ ( SizeSpecification  spec)

Equality comparison operator.

Parameters
specThe other SizeSpecification object to be compared with.
Returns
True if all attributes compare equal, and False otherwise.

◆ __ne__()

bool CDPL.Vis.SizeSpecification.__ne__ ( SizeSpecification  spec)

Inequality comparison operator.

The result is equivalent to !(self == spec).

Parameters
specThe other SizeSpecification object to be compared with.
Returns
True if one of the attributes compares non-equal, and False otherwise.

◆ __str__()

str CDPL.Vis.SizeSpecification.__str__ ( )

Returns a string representation of the SizeSpecification instance.

Returns
The generated string representation.