Open CASCADE Technology
7.2.0
|
This class allows the definition of the type of a surface. Aspect attributes of a 3d face. Keywords: Material, FillArea, Shininess, Ambient, Color, Diffuse, Specular, Transparency, Emissive, ReflectionMode, BackFace, FrontFace, Reflection, Absorbtion. More...
#include <Graphic3d_MaterialAspect.hxx>
Public Member Functions | |
Graphic3d_MaterialAspect () | |
Creates a material from default values. More... | |
Graphic3d_MaterialAspect (const Graphic3d_NameOfMaterial theName) | |
Creates a generic material. More... | |
Graphic3d_NameOfMaterial | Name () const |
Returns the material name (within predefined enumeration). More... | |
Graphic3d_NameOfMaterial | RequestedName () const |
Returns the material name within predefined enumeration which has been requested (before modifications). More... | |
const TCollection_AsciiString & | StringName () const |
Returns the given name of this material. This might be: More... | |
Standard_CString | MaterialName () const |
Returns the given name of this material. This might be: More... | |
void | SetMaterialName (const TCollection_AsciiString &theName) |
The current material become a "UserDefined" material. Set the name of the "UserDefined" material. More... | |
void | Reset () |
Resets the material with the original values according to the material name but leave the current color values untouched for the material of type ASPECT. More... | |
const Quantity_Color & | Color () const |
Returns the diffuse color of the surface. More... | |
void | SetColor (const Quantity_Color &theColor) |
Modifies the ambient and diffuse color of the surface. More... | |
Standard_ShortReal | Transparency () const |
Returns the transparency coefficient of the surface (1.0 - Alpha); 0.0 means opaque. More... | |
Standard_ShortReal | Alpha () const |
Returns the alpha coefficient of the surface (1.0 - Transparency); 1.0 means opaque. More... | |
void | SetTransparency (const Standard_ShortReal theValue) |
Modifies the transparency coefficient of the surface, where 0 is opaque and 1 is fully transparent. Transparency is applicable to materials that have at least one of reflection modes (ambient, diffuse, specular or emissive) enabled. See also SetReflectionModeOn() and SetReflectionModeOff() methods. More... | |
void | SetAlpha (Standard_ShortReal theValue) |
Modifies the alpha coefficient of the surface, where 1.0 is opaque and 0.0 is fully transparent. More... | |
const Quantity_Color & | AmbientColor () const |
Returns the ambient color of the surface. More... | |
void | SetAmbientColor (const Quantity_Color &theColor) |
Modifies the ambient color of the surface. More... | |
const Quantity_Color & | DiffuseColor () const |
Returns the diffuse color of the surface. More... | |
void | SetDiffuseColor (const Quantity_Color &theColor) |
Modifies the diffuse color of the surface. More... | |
const Quantity_Color & | SpecularColor () const |
Returns the specular color of the surface. More... | |
void | SetSpecularColor (const Quantity_Color &theColor) |
Modifies the specular color of the surface. More... | |
const Quantity_Color & | EmissiveColor () const |
Returns the emissive color of the surface. More... | |
void | SetEmissiveColor (const Quantity_Color &theColor) |
Modifies the emissive color of the surface. More... | |
Standard_ShortReal | Ambient () const |
Returns the reflection properties of the surface. More... | |
void | SetAmbient (const Standard_ShortReal theValue) |
Modifies the reflection properties of the surface. Warning: Raises MaterialDefinitionError if given value is a negative value or greater than 1.0. More... | |
Standard_ShortReal | Diffuse () const |
Returns the reflection properties of the surface. More... | |
void | SetDiffuse (const Standard_ShortReal theValue) |
Modifies the reflection properties of the surface. Warning: Raises MaterialDefinitionError if given value is a negative value or greater than 1.0. More... | |
Standard_ShortReal | Specular () const |
Returns the reflection properties of the surface. More... | |
void | SetSpecular (const Standard_ShortReal theValue) |
Modifies the reflection properties of the surface. Warning: Raises MaterialDefinitionError if given value is a negative value or greater than 1.0. More... | |
Standard_ShortReal | Emissive () const |
Returns the emissive coefficient of the surface. More... | |
void | SetEmissive (const Standard_ShortReal theValue) |
Modifies the reflection properties of the surface. Warning: Raises MaterialDefinitionError if given value is a negative value or greater than 1.0. More... | |
Standard_ShortReal | Shininess () const |
Returns the luminosity of the surface. More... | |
void | SetShininess (const Standard_ShortReal theValue) |
Modifies the luminosity of the surface. Warning: Raises MaterialDefinitionError if given value is a negative value or greater than 1.0. More... | |
void | IncreaseShine (const Standard_ShortReal theDelta) |
Increases or decreases the luminosity. More... | |
Standard_ShortReal | RefractionIndex () const |
Returns the refraction index of the material. More... | |
void | SetRefractionIndex (const Standard_ShortReal theValue) |
Modifies the refraction index of the material. Warning: Raises MaterialDefinitionError if given value is a lesser than 1.0. More... | |
const Graphic3d_BSDF & | BSDF () const |
Returns BSDF (bidirectional scattering distribution function). More... | |
void | SetBSDF (const Graphic3d_BSDF &theBSDF) |
Modifies the BSDF (bidirectional scattering distribution function). More... | |
Standard_Boolean | ReflectionMode (const Graphic3d_TypeOfReflection theType) const |
Returns TRUE if the reflection mode is active, FALSE otherwise. More... | |
void | SetReflectionMode (const Graphic3d_TypeOfReflection theType, const Standard_Boolean theValue) |
Activates or deactivates the reflective properties of the surface with specified reflection type. More... | |
void | SetReflectionModeOn (const Graphic3d_TypeOfReflection theType) |
Activates the reflective properties of the surface with specified reflection type. More... | |
void | SetReflectionModeOff (const Graphic3d_TypeOfReflection theType) |
Deactivates the reflective properties of the surface with specified reflection type. More... | |
Standard_Boolean | MaterialType (const Graphic3d_TypeOfMaterial theType) const |
Returns TRUE if type of this material is equal to specified type. More... | |
void | SetMaterialType (const Graphic3d_TypeOfMaterial theType) |
Set material type. More... | |
Standard_Boolean | IsDifferent (const Graphic3d_MaterialAspect &theOther) const |
Returns TRUE if this material differs from specified one. More... | |
Standard_Boolean | operator!= (const Graphic3d_MaterialAspect &theOther) const |
Returns TRUE if this material differs from specified one. More... | |
Standard_Boolean | IsEqual (const Graphic3d_MaterialAspect &theOther) const |
Returns TRUE if this material is identical to specified one. More... | |
Standard_Boolean | operator== (const Graphic3d_MaterialAspect &theOther) const |
Returns TRUE if this material is identical to specified one. More... | |
Static Public Member Functions | |
static Standard_Integer | NumberOfMaterials () |
Returns the number of predefined textures. More... | |
static Standard_CString | MaterialName (const Standard_Integer theRank) |
Returns the name of the predefined material of specified rank within range [1, NumberOfMaterials()]. More... | |
static Graphic3d_TypeOfMaterial | MaterialType (const Standard_Integer theRank) |
Returns the type of the predefined material of specified rank within range [1, NumberOfMaterials()]. More... | |
static Graphic3d_NameOfMaterial | MaterialFromName (const Standard_CString theName) |
Returns the material for specified name or Graphic3d_NOM_DEFAULT if name is unknown. More... | |
This class allows the definition of the type of a surface. Aspect attributes of a 3d face. Keywords: Material, FillArea, Shininess, Ambient, Color, Diffuse, Specular, Transparency, Emissive, ReflectionMode, BackFace, FrontFace, Reflection, Absorbtion.
Graphic3d_MaterialAspect::Graphic3d_MaterialAspect | ( | ) |
Creates a material from default values.
Graphic3d_MaterialAspect::Graphic3d_MaterialAspect | ( | const Graphic3d_NameOfMaterial | theName | ) |
Creates a generic material.
|
inline |
Returns the alpha coefficient of the surface (1.0 - Transparency); 1.0 means opaque.
|
inline |
Returns the reflection properties of the surface.
|
inline |
Returns the ambient color of the surface.
|
inline |
Returns BSDF (bidirectional scattering distribution function).
|
inline |
Returns the diffuse color of the surface.
|
inline |
Returns the reflection properties of the surface.
|
inline |
Returns the diffuse color of the surface.
|
inline |
Returns the emissive coefficient of the surface.
|
inline |
Returns the emissive color of the surface.
void Graphic3d_MaterialAspect::IncreaseShine | ( | const Standard_ShortReal | theDelta | ) |
Increases or decreases the luminosity.
theDelta | a signed percentage |
|
inline |
Returns TRUE if this material differs from specified one.
|
inline |
Returns TRUE if this material is identical to specified one.
|
static |
Returns the material for specified name or Graphic3d_NOM_DEFAULT if name is unknown.
|
static |
Returns the name of the predefined material of specified rank within range [1, NumberOfMaterials()].
|
inline |
Returns the given name of this material. This might be:
|
static |
Returns the type of the predefined material of specified rank within range [1, NumberOfMaterials()].
|
inline |
Returns TRUE if type of this material is equal to specified type.
|
inline |
Returns the material name (within predefined enumeration).
|
inlinestatic |
Returns the number of predefined textures.
|
inline |
Returns TRUE if this material differs from specified one.
|
inline |
Returns TRUE if this material is identical to specified one.
|
inline |
Returns TRUE if the reflection mode is active, FALSE otherwise.
|
inline |
Returns the refraction index of the material.
|
inline |
Returns the material name within predefined enumeration which has been requested (before modifications).
|
inline |
Resets the material with the original values according to the material name but leave the current color values untouched for the material of type ASPECT.
|
inline |
Modifies the alpha coefficient of the surface, where 1.0 is opaque and 0.0 is fully transparent.
void Graphic3d_MaterialAspect::SetAmbient | ( | const Standard_ShortReal | theValue | ) |
Modifies the reflection properties of the surface. Warning: Raises MaterialDefinitionError if given value is a negative value or greater than 1.0.
void Graphic3d_MaterialAspect::SetAmbientColor | ( | const Quantity_Color & | theColor | ) |
Modifies the ambient color of the surface.
|
inline |
Modifies the BSDF (bidirectional scattering distribution function).
void Graphic3d_MaterialAspect::SetColor | ( | const Quantity_Color & | theColor | ) |
Modifies the ambient and diffuse color of the surface.
void Graphic3d_MaterialAspect::SetDiffuse | ( | const Standard_ShortReal | theValue | ) |
Modifies the reflection properties of the surface. Warning: Raises MaterialDefinitionError if given value is a negative value or greater than 1.0.
void Graphic3d_MaterialAspect::SetDiffuseColor | ( | const Quantity_Color & | theColor | ) |
Modifies the diffuse color of the surface.
void Graphic3d_MaterialAspect::SetEmissive | ( | const Standard_ShortReal | theValue | ) |
Modifies the reflection properties of the surface. Warning: Raises MaterialDefinitionError if given value is a negative value or greater than 1.0.
void Graphic3d_MaterialAspect::SetEmissiveColor | ( | const Quantity_Color & | theColor | ) |
Modifies the emissive color of the surface.
|
inline |
The current material become a "UserDefined" material. Set the name of the "UserDefined" material.
void Graphic3d_MaterialAspect::SetMaterialType | ( | const Graphic3d_TypeOfMaterial | theType | ) |
Set material type.
void Graphic3d_MaterialAspect::SetReflectionMode | ( | const Graphic3d_TypeOfReflection | theType, |
const Standard_Boolean | theValue | ||
) |
Activates or deactivates the reflective properties of the surface with specified reflection type.
Disabling diffuse and specular reflectance is useful for efficient visualization of large amounts of data as definition of normals for graphic primitives is not needed when only "all-directional" reflectance is active.
NOTE: Disabling all four reflection modes also turns off the following effects:
|
inline |
Deactivates the reflective properties of the surface with specified reflection type.
|
inline |
Activates the reflective properties of the surface with specified reflection type.
void Graphic3d_MaterialAspect::SetRefractionIndex | ( | const Standard_ShortReal | theValue | ) |
Modifies the refraction index of the material. Warning: Raises MaterialDefinitionError if given value is a lesser than 1.0.
void Graphic3d_MaterialAspect::SetShininess | ( | const Standard_ShortReal | theValue | ) |
Modifies the luminosity of the surface. Warning: Raises MaterialDefinitionError if given value is a negative value or greater than 1.0.
void Graphic3d_MaterialAspect::SetSpecular | ( | const Standard_ShortReal | theValue | ) |
Modifies the reflection properties of the surface. Warning: Raises MaterialDefinitionError if given value is a negative value or greater than 1.0.
void Graphic3d_MaterialAspect::SetSpecularColor | ( | const Quantity_Color & | theColor | ) |
Modifies the specular color of the surface.
void Graphic3d_MaterialAspect::SetTransparency | ( | const Standard_ShortReal | theValue | ) |
Modifies the transparency coefficient of the surface, where 0 is opaque and 1 is fully transparent. Transparency is applicable to materials that have at least one of reflection modes (ambient, diffuse, specular or emissive) enabled. See also SetReflectionModeOn() and SetReflectionModeOff() methods.
Warning: Raises MaterialDefinitionError if given value is a negative value or greater than 1.0.
|
inline |
Returns the luminosity of the surface.
|
inline |
Returns the reflection properties of the surface.
|
inline |
Returns the specular color of the surface.
|
inline |
Returns the given name of this material. This might be:
|
inline |
Returns the transparency coefficient of the surface (1.0 - Alpha); 0.0 means opaque.