![]() |
Chemical Data Processing Library C++ API - Version 1.3.0
|
Defines material properties of Vis::Object3D instances. More...
#include <Material.hpp>
Public Member Functions | |
Material (const Color &amb_color, double amb_factor, const Color &diff_color, const Color &spec_color, double shininess, double transp=0.0) | |
Constructs an new Material instance with the specified properties. More... | |
Material (double amb_factor, const Color &diff_color, const Color &spec_color, double shininess, double transp=0.0) | |
Constructs an new Material instance with the specified properties. More... | |
void | setAmbientColor (const Color &color) |
Sets the ambient color component. More... | |
const Color & | getAmbientColor () const |
Returns the ambient color component. More... | |
void | setAmbientFactor (double factor) |
Sets the scaling factor to use for calculating the ambient from the diffuse color component. More... | |
double | getAmbientFactor () const |
Returns the scaling factor used for calculating the ambient from the diffuse color component. More... | |
void | setDiffuseColor (const Color &color) |
Sets the diffuse color component. More... | |
const Color & | getDiffuseColor () const |
Returns the diffuse color component. More... | |
void | setSpecularColor (const Color &color) |
Sets the specular color component. More... | |
const Color & | getSpecularColor () const |
Returns the specular color component. More... | |
void | setShininess (double shininess) |
Sets the shininess of the material. More... | |
double | getShininess () const |
Returns the shininess of the material. More... | |
void | setTransparency (double transp) |
Sets the transparency of the material. More... | |
double | getTransparency () const |
Returns the transparency of the material. More... | |
bool | operator== (const Material &material) const |
Equality comparison operator. More... | |
bool | operator!= (const Material &material) const |
Inequality comparison operator. More... | |
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.
CDPL::Vis::Material::Material | ( | const Color & | amb_color, |
double | amb_factor, | ||
const Color & | diff_color, | ||
const Color & | spec_color, | ||
double | shininess, | ||
double | transp = 0.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. |
CDPL::Vis::Material::Material | ( | double | amb_factor, |
const Color & | diff_color, | ||
const Color & | spec_color, | ||
double | shininess, | ||
double | transp = 0.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. |
void CDPL::Vis::Material::setAmbientColor | ( | const Color & | color | ) |
Sets the ambient color component.
color | The ambient color component. |
const Color& CDPL::Vis::Material::getAmbientColor | ( | ) | const |
Returns the ambient color component.
void CDPL::Vis::Material::setAmbientFactor | ( | double | 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]. |
double CDPL::Vis::Material::getAmbientFactor | ( | ) | const |
Returns the scaling factor used for calculating the ambient from the diffuse color component.
void CDPL::Vis::Material::setDiffuseColor | ( | const Color & | color | ) |
Sets the diffuse color component.
color | The diffuse color component. |
const Color& CDPL::Vis::Material::getDiffuseColor | ( | ) | const |
Returns the diffuse color component.
void CDPL::Vis::Material::setSpecularColor | ( | const Color & | color | ) |
Sets the specular color component.
color | The specular color component. |
const Color& CDPL::Vis::Material::getSpecularColor | ( | ) | const |
Returns the specular color component.
void CDPL::Vis::Material::setShininess | ( | double | shininess | ) |
Sets the shininess of the material.
shininess | The shininess value in the range [0, 1]. |
double CDPL::Vis::Material::getShininess | ( | ) | const |
Returns the shininess of the material.
void CDPL::Vis::Material::setTransparency | ( | double | transp | ) |
Sets the transparency of the material.
transp | The transparency value in the range [0, 1]. |
double CDPL::Vis::Material::getTransparency | ( | ) | const |
Returns the transparency of the 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. Inequality comparison operator.
The result is equivalent to !(*this == material)
.
material | The other Material object to be compared with. |
true
if either the style or the color attributes compare non-equal, and false
otherwise.