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

Defines material properties of Vis.Object3D instances. More...

+ Inheritance diagram for CDPL.Vis.Material:

Public Member Functions

None __init__ (Material material)
 Initializes a copy of the Material instance material. More...
 
None __init__ (Color amb_color, float amb_factor, Color diff_color, Color spec_color, float shininess, float transp=1.0)
 Constructs an new Material instance with the specified properties. More...
 
None __init__ (float amb_factor, Color diff_color, Color spec_color, float shininess, float transp=1.0)
 Constructs an new Material instance with the specified properties. More...
 
int getObjectID ()
 Returns the numeric identifier (ID) of the wrapped C++ class instance. More...
 
Material assign (Material material)
 Replaces the current state of self with a copy of the state of the Material instance material. More...
 
Color getAmbientColor ()
 Returns the ambient color component. More...
 
None setAmbientColor (Color color)
 Sets the ambient color component. More...
 
float getAmbientFactor ()
 Returns the scaling factor used for calculating the ambient from the diffuse color component. More...
 
None setAmbientFactor (float factor)
 Sets the scaling factor to use for calculating the ambient from the diffuse color component. More...
 
Color getDiffuseColor ()
 Returns the diffuse color component. More...
 
None setDiffuseColor (Color color)
 Sets the diffuse color component. More...
 
Color getSpecularColor ()
 Returns the specular color component. More...
 
None setSpecularColor (Color color)
 Sets the specular color component. More...
 
float getTransparency ()
 Returns the transparency of the material. More...
 
None setTransparency (float transp)
 Sets the transparency of the material. More...
 
float getShininess ()
 Returns the shininess of the material. More...
 
None setShininess (float shininess)
 Sets the shininess of the material. More...
 
bool __eq__ (Material material)
 Equality comparison operator. More...
 
bool __ne__ (Material material)
 Inequality comparison operator. More...
 

Properties

 objectID = property(getObjectID)
 
 ambient = property(getAmbient, setAmbient)
 FIXME!
 
 diffuse = property(getDiffuse, setDiffuse)
 FIXME!
 
 specular = property(getSpecular, setSpecular)
 FIXME!
 
 ambientFactor = property(getAmbientFactor, setAmbientFactor)
 
 shininess = property(getShininess, setShininess)
 
 transparency = property(getTransparency, setTransparency)
 

Detailed Description

Defines material properties of Vis.Object3D instances.

A color vector for each of the Phong lighting's components is defined (alpha channel will be inored): The ambient component defines what color the surface reflects under ambient lighting. This is usually the same as the surface's color. The diffuse component defines the color of the surface under diffuse lighting. The diffuse color is (just like ambient lighting) usually set to the desired surface's color. The specular component sets the color of the specular highlight on the surface (or possibly even reflect a surface-specific color). Lastly, the shininess impacts the scattering/radius of the specular highlight. For transparent materials a transparency in the range 0.0 to 1.0 can be specified where a value of 0.0 represents a completely opaque material.

Since
1.3

Constructor & Destructor Documentation

◆ __init__() [1/3]

None CDPL.Vis.Material.__init__ ( Material  material)

Initializes a copy of the Material instance material.

Parameters
materialThe Material instance to copy.

◆ __init__() [2/3]

None CDPL.Vis.Material.__init__ ( Color  amb_color,
float  amb_factor,
Color  diff_color,
Color  spec_color,
float  shininess,
float   transp = 1.0 
)

Constructs an new Material instance with the specified properties.

Parameters
amb_colorThe ambient color component.
amb_factorThe scaling factor to use for calculating the ambient from the diffuse color component.
diff_colorThe diffuse color component.
spec_colorThe specular color component.
shininessThe shininess value.
transpThe transparency value.

◆ __init__() [3/3]

None CDPL.Vis.Material.__init__ ( float  amb_factor,
Color  diff_color,
Color  spec_color,
float  shininess,
float   transp = 1.0 
)

Constructs an new Material instance with the specified properties.

Parameters
amb_factorThe scaling factor to use for calculating the ambient from the diffuse color component.
diff_colorThe diffuse color component.
spec_colorThe specular color component.
shininessThe shininess value.
transpThe transparency value.

Member Function Documentation

◆ getObjectID()

int CDPL.Vis.Material.getObjectID ( )

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

Different Python Material 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 Material 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()

Material CDPL.Vis.Material.assign ( Material  material)

Replaces the current state of self with a copy of the state of the Material instance material.

Parameters
materialThe Material instance to copy.
Returns
self

◆ getAmbientColor()

Color CDPL.Vis.Material.getAmbientColor ( )

Returns the ambient color component.

Returns
The ambient color component.

◆ setAmbientColor()

None CDPL.Vis.Material.setAmbientColor ( Color  color)

Sets the ambient color component.

Parameters
colorThe ambient color component.

◆ getAmbientFactor()

float CDPL.Vis.Material.getAmbientFactor ( )

Returns the scaling factor used for calculating the ambient from the diffuse color component.

Returns
The scaling factor.

◆ setAmbientFactor()

None CDPL.Vis.Material.setAmbientFactor ( float  factor)

Sets the scaling factor to use for calculating the ambient from the diffuse color component.

Parameters
factorThe scaling factor in the range [0, 1].

◆ getDiffuseColor()

Color CDPL.Vis.Material.getDiffuseColor ( )

Returns the diffuse color component.

Returns
The diffuse color component.

◆ setDiffuseColor()

None CDPL.Vis.Material.setDiffuseColor ( Color  color)

Sets the diffuse color component.

Parameters
colorThe diffuse color component.

◆ getSpecularColor()

Color CDPL.Vis.Material.getSpecularColor ( )

Returns the specular color component.

Returns
The specular color component.

◆ setSpecularColor()

None CDPL.Vis.Material.setSpecularColor ( Color  color)

Sets the specular color component.

Parameters
colorThe specular color component.

◆ getTransparency()

float CDPL.Vis.Material.getTransparency ( )

Returns the transparency of the material.

Returns
The transparency value.

◆ setTransparency()

None CDPL.Vis.Material.setTransparency ( float  transp)

Sets the transparency of the material.

Parameters
transpThe transparency value in the range [0, 1].

◆ getShininess()

float CDPL.Vis.Material.getShininess ( )

Returns the shininess of the material.

Returns
The shininess value.

◆ setShininess()

None CDPL.Vis.Material.setShininess ( float  shininess)

Sets the shininess of the material.

Parameters
shininessThe shininess value in the range [0, 1].

◆ __eq__()

bool CDPL.Vis.Material.__eq__ ( Material  material)

Equality comparison operator.

Parameters
materialThe other Material object to be compared with.
Returns
True if the style and color attributes compare equal, and False otherwise.

◆ __ne__()

bool CDPL.Vis.Material.__ne__ ( Material  material)

Inequality comparison operator.

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

Parameters
materialThe other Material object to be compared with.
Returns
True if either the style or the color attributes compare non-equal, and False otherwise.