![]() |
Chemical Data Processing Library Python API - Version 1.3.0
|
Defines material properties of Vis.Object3D instances. More...
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) | |
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.
None CDPL.Vis.Material.__init__ | ( | Material | material | ) |
Initializes a copy of the Material instance material.
material | The Material instance to copy. |
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.
amb_color | The ambient color component. |
amb_factor | The scaling factor to use for calculating the ambient from the diffuse color component. |
diff_color | The diffuse color component. |
spec_color | The specular color component. |
shininess | The shininess value. |
transp | The transparency value. |
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.
amb_factor | The scaling factor to use for calculating the ambient from the diffuse color component. |
diff_color | The diffuse color component. |
spec_color | The specular color component. |
shininess | The shininess value. |
transp | The transparency value. |
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()
.
Replaces the current state of self with a copy of the state of the Material
instance material.
material | The Material instance to copy. |
Color CDPL.Vis.Material.getAmbientColor | ( | ) |
Returns the ambient color component.
None CDPL.Vis.Material.setAmbientColor | ( | Color | color | ) |
Sets the ambient color component.
color | The ambient color component. |
float CDPL.Vis.Material.getAmbientFactor | ( | ) |
Returns the scaling factor used for calculating the ambient from the diffuse color component.
None CDPL.Vis.Material.setAmbientFactor | ( | float | factor | ) |
Sets the scaling factor to use for calculating the ambient from the diffuse color component.
factor | The scaling factor in the range [0, 1]. |
Color CDPL.Vis.Material.getDiffuseColor | ( | ) |
Returns the diffuse color component.
None CDPL.Vis.Material.setDiffuseColor | ( | Color | color | ) |
Sets the diffuse color component.
color | The diffuse color component. |
Color CDPL.Vis.Material.getSpecularColor | ( | ) |
Returns the specular color component.
None CDPL.Vis.Material.setSpecularColor | ( | Color | color | ) |
Sets the specular color component.
color | The specular color component. |
float CDPL.Vis.Material.getTransparency | ( | ) |
Returns the transparency of the material.
None CDPL.Vis.Material.setTransparency | ( | float | transp | ) |
Sets the transparency of the material.
transp | The transparency value in the range [0, 1]. |
float CDPL.Vis.Material.getShininess | ( | ) |
Returns the shininess of the material.
None CDPL.Vis.Material.setShininess | ( | float | shininess | ) |
Sets the shininess of the material.
shininess | The shininess value in the range [0, 1]. |
bool CDPL.Vis.Material.__eq__ | ( | Material | material | ) |
Equality comparison operator.
material | The other Material object to be compared with. |
True
if the style and color attributes compare equal, and False
otherwise.