Open CASCADE Technology  6.9.0
Public Member Functions | Static Public Member Functions

Graphic3d_MaterialAspect Class Reference

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 AName)
 Creates a generic material calls <AName> More...
 
void IncreaseShine (const Standard_Real ADelta)
 Increases or decreases the luminosity of <me>. <ADelta> is a signed percentage. More...
 
void SetAmbient (const Standard_Real AValue)
 Modifies the reflection properties of the surface. Category: Methods to modify the class definition Warning: Raises MaterialDefinitionError if <AValue> is a negative value or greater than 1.0. More...
 
void SetDiffuse (const Standard_Real AValue)
 Modifies the reflection properties of the surface. Category: Methods to modify the class definition Warning: Raises MaterialDefinitionError if <AValue> is a negative value or greater than 1.0. More...
 
void SetEmissive (const Standard_Real AValue)
 Modifies the reflection properties of the surface. Category: Methods to modify the class definition Warning: Raises MaterialDefinitionError if <AValue> is a negative value or greater than 1.0. More...
 
void SetShininess (const Standard_Real AValue)
 Modifies the luminosity of the surface. Category: Methods to modify the class definition Warning: Raises MaterialDefinitionError if <AValue> is a negative value or greater than 1.0. More...
 
void SetSpecular (const Standard_Real AValue)
 Modifies the reflection properties of the surface. Category: Methods to modify the class definition Warning: Raises MaterialDefinitionError if <AValue> is a negative value or greater than 1.0. More...
 
void SetTransparency (const Standard_Real AValue)
 Modifies the transparency coefficient of the surface. <AValue> = 0. opaque. (default) <AValue> = 1. 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 SetRefractionIndex (const Standard_Real theValue)
 Modifies the refraction index of the material. Category: Methods to modify the class definition Warning: Raises MaterialDefinitionError if <theValue> is a lesser than 1.0. More...
 
void SetColor (const Quantity_Color &AColor)
 Modifies the ambient and diffuse colour of the surface. Category: Methods to modify the class definition. More...
 
void SetAmbientColor (const Quantity_Color &AColor)
 Modifies the ambient colour of the surface. More...
 
void SetDiffuseColor (const Quantity_Color &AColor)
 Modifies the difuse colour of the surface. More...
 
void SetSpecularColor (const Quantity_Color &AColor)
 Modifies the specular colour of the surface. More...
 
void SetEmissiveColor (const Quantity_Color &AColor)
 Modifies the emissive colour of the surface. More...
 
void SetReflectionModeOn (const Graphic3d_TypeOfReflection AType)
 Activates the reflective properties of the surface <AType>. More...
 
void SetReflectionModeOff (const Graphic3d_TypeOfReflection AType)
 Deactivates the reflective properties of the surface <AType>. More...
 
void SetMaterialType (const Graphic3d_TypeOfMaterial AType)
 Set MyMaterialType to the value of parameter <AType> More...
 
void SetMaterialName (const Standard_CString AName)
 The current matarial become a "UserDefined" material. Set the name of the "UserDefined" material. More...
 
void SetEnvReflexion (const Standard_ShortReal AValue)
 
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_ColorColor () const
 Returns the diffuse colour of the surface. More...
 
const Quantity_ColorAmbientColor () const
 Returns the ambient colour of the surface. More...
 
const Quantity_ColorDiffuseColor () const
 Returns the diffuse colour of the surface. More...
 
const Quantity_ColorSpecularColor () const
 Returns the specular colour of the surface. More...
 
const Quantity_ColorEmissiveColor () const
 Returns the emissive colour of the surface. More...
 
Standard_Real Ambient () const
 Returns the reflection properties of the surface. More...
 
Standard_Real Diffuse () const
 Returns the reflection properties of the surface. More...
 
Standard_Real Specular () const
 Returns the reflection properties of the surface. More...
 
Standard_Real Transparency () const
 Returns the transparency coefficient of the surface. More...
 
Standard_Real RefractionIndex () const
 Returns the refraction index of the material. More...
 
Standard_Real Emissive () const
 Returns the emissive coefficient of the surface. More...
 
Standard_Real Shininess () const
 Returns the luminosity of the surface. More...
 
Standard_Boolean ReflectionMode (const Graphic3d_TypeOfReflection AType) const
 Returns Standard_True if the reflection mode is active, Standard_False otherwise. More...
 
Standard_Boolean MaterialType (const Graphic3d_TypeOfMaterial AType) const
 Returns Standard_True if MyMaterialType equal the parameter AType, Standard_False otherwise. More...
 
Standard_ShortReal EnvReflexion () const
 
Graphic3d_NameOfMaterial Name () const
 Returns the material name. More...
 
Standard_Boolean IsDifferent (const Graphic3d_MaterialAspect &Other) const
 Returns Standard_True if the materials <me> and <Other> are different. More...
 
Standard_Boolean operator!= (const Graphic3d_MaterialAspect &Other) const
 
Standard_Boolean IsEqual (const Graphic3d_MaterialAspect &Other) const
 Returns Standard_True if the materials <me> and <Other> are identical. More...
 
Standard_Boolean operator== (const Graphic3d_MaterialAspect &Other) const
 
Standard_CString MaterialName () const
 Returns the name of this material. More...
 

Static Public Member Functions

static Standard_Integer NumberOfMaterials ()
 Returns the number of predefined textures. More...
 
static Standard_CString MaterialName (const Standard_Integer aRank)
 Returns the name of the predefined material of rank <aRank> Trigger: when <aRank> is < 1 or > NumberOfMaterials. More...
 
static Graphic3d_TypeOfMaterial MaterialType (const Standard_Integer aRank)
 Returns the type of the predefined material of rank <aRank> Trigger: when <aRank> is < 1 or > 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...
 

Detailed Description

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.

Constructor & Destructor Documentation

Graphic3d_MaterialAspect::Graphic3d_MaterialAspect ( )

Creates a material from default values.

Graphic3d_MaterialAspect::Graphic3d_MaterialAspect ( const Graphic3d_NameOfMaterial  AName)

Creates a generic material calls <AName>

Member Function Documentation

Standard_Real Graphic3d_MaterialAspect::Ambient ( ) const

Returns the reflection properties of the surface.

const Quantity_Color& Graphic3d_MaterialAspect::AmbientColor ( ) const

Returns the ambient colour of the surface.

const Quantity_Color& Graphic3d_MaterialAspect::Color ( ) const

Returns the diffuse colour of the surface.

Standard_Real Graphic3d_MaterialAspect::Diffuse ( ) const

Returns the reflection properties of the surface.

const Quantity_Color& Graphic3d_MaterialAspect::DiffuseColor ( ) const

Returns the diffuse colour of the surface.

Standard_Real Graphic3d_MaterialAspect::Emissive ( ) const

Returns the emissive coefficient of the surface.

const Quantity_Color& Graphic3d_MaterialAspect::EmissiveColor ( ) const

Returns the emissive colour of the surface.

Standard_ShortReal Graphic3d_MaterialAspect::EnvReflexion ( ) const
void Graphic3d_MaterialAspect::IncreaseShine ( const Standard_Real  ADelta)

Increases or decreases the luminosity of <me>. <ADelta> is a signed percentage.

Standard_Boolean Graphic3d_MaterialAspect::IsDifferent ( const Graphic3d_MaterialAspect Other) const

Returns Standard_True if the materials <me> and <Other> are different.

Standard_Boolean Graphic3d_MaterialAspect::IsEqual ( const Graphic3d_MaterialAspect Other) const

Returns Standard_True if the materials <me> and <Other> are identical.

static Graphic3d_NameOfMaterial Graphic3d_MaterialAspect::MaterialFromName ( const Standard_CString  theName)
static

Returns the material for specified name or Graphic3d_NOM_DEFAULT if name is unknown.

static Standard_CString Graphic3d_MaterialAspect::MaterialName ( const Standard_Integer  aRank)
static

Returns the name of the predefined material of rank <aRank> Trigger: when <aRank> is < 1 or > NumberOfMaterials.

Standard_CString Graphic3d_MaterialAspect::MaterialName ( ) const

Returns the name of this material.

Standard_Boolean Graphic3d_MaterialAspect::MaterialType ( const Graphic3d_TypeOfMaterial  AType) const

Returns Standard_True if MyMaterialType equal the parameter AType, Standard_False otherwise.

static Graphic3d_TypeOfMaterial Graphic3d_MaterialAspect::MaterialType ( const Standard_Integer  aRank)
static

Returns the type of the predefined material of rank <aRank> Trigger: when <aRank> is < 1 or > NumberOfMaterials.

Graphic3d_NameOfMaterial Graphic3d_MaterialAspect::Name ( ) const

Returns the material name.

static Standard_Integer Graphic3d_MaterialAspect::NumberOfMaterials ( )
static

Returns the number of predefined textures.

Standard_Boolean Graphic3d_MaterialAspect::operator!= ( const Graphic3d_MaterialAspect Other) const
inline
Standard_Boolean Graphic3d_MaterialAspect::operator== ( const Graphic3d_MaterialAspect Other) const
inline
Standard_Boolean Graphic3d_MaterialAspect::ReflectionMode ( const Graphic3d_TypeOfReflection  AType) const

Returns Standard_True if the reflection mode is active, Standard_False otherwise.

Standard_Real Graphic3d_MaterialAspect::RefractionIndex ( ) const

Returns the refraction index of the material.

void Graphic3d_MaterialAspect::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.

void Graphic3d_MaterialAspect::SetAmbient ( const Standard_Real  AValue)

Modifies the reflection properties of the surface. Category: Methods to modify the class definition Warning: Raises MaterialDefinitionError if <AValue> is a negative value or greater than 1.0.

void Graphic3d_MaterialAspect::SetAmbientColor ( const Quantity_Color AColor)

Modifies the ambient colour of the surface.

void Graphic3d_MaterialAspect::SetColor ( const Quantity_Color AColor)

Modifies the ambient and diffuse colour of the surface. Category: Methods to modify the class definition.

void Graphic3d_MaterialAspect::SetDiffuse ( const Standard_Real  AValue)

Modifies the reflection properties of the surface. Category: Methods to modify the class definition Warning: Raises MaterialDefinitionError if <AValue> is a negative value or greater than 1.0.

void Graphic3d_MaterialAspect::SetDiffuseColor ( const Quantity_Color AColor)

Modifies the difuse colour of the surface.

void Graphic3d_MaterialAspect::SetEmissive ( const Standard_Real  AValue)

Modifies the reflection properties of the surface. Category: Methods to modify the class definition Warning: Raises MaterialDefinitionError if <AValue> is a negative value or greater than 1.0.

void Graphic3d_MaterialAspect::SetEmissiveColor ( const Quantity_Color AColor)

Modifies the emissive colour of the surface.

void Graphic3d_MaterialAspect::SetEnvReflexion ( const Standard_ShortReal  AValue)
void Graphic3d_MaterialAspect::SetMaterialName ( const Standard_CString  AName)

The current matarial become a "UserDefined" material. Set the name of the "UserDefined" material.

void Graphic3d_MaterialAspect::SetMaterialType ( const Graphic3d_TypeOfMaterial  AType)

Set MyMaterialType to the value of parameter <AType>

TypeOfMaterial : MATERIAL_ASPECT MATERIAL_PHYSIC

void Graphic3d_MaterialAspect::SetReflectionModeOff ( const Graphic3d_TypeOfReflection  AType)

Deactivates the reflective properties of the surface <AType>.

TypeOfReflection : TOR_AMBIENT TOR_DIFFUSE TOR_SPECULAR TOR_EMISSION 1, 2, 3 or 4 types of reflection can be set off for a given surface. 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:

  1. Lighting. Colors of primitives are not affected by the material properties when lighting is off.
  2. Transparency.
void Graphic3d_MaterialAspect::SetReflectionModeOn ( const Graphic3d_TypeOfReflection  AType)

Activates the reflective properties of the surface <AType>.

TypeOfReflection : TOR_AMBIENT TOR_DIFFUSE TOR_SPECULAR TOR_EMISSION 1, 2, 3 or 4 types of reflection can be set for a given surface.

void Graphic3d_MaterialAspect::SetRefractionIndex ( const Standard_Real  theValue)

Modifies the refraction index of the material. Category: Methods to modify the class definition Warning: Raises MaterialDefinitionError if <theValue> is a lesser than 1.0.

void Graphic3d_MaterialAspect::SetShininess ( const Standard_Real  AValue)

Modifies the luminosity of the surface. Category: Methods to modify the class definition Warning: Raises MaterialDefinitionError if <AValue> is a negative value or greater than 1.0.

void Graphic3d_MaterialAspect::SetSpecular ( const Standard_Real  AValue)

Modifies the reflection properties of the surface. Category: Methods to modify the class definition Warning: Raises MaterialDefinitionError if <AValue> is a negative value or greater than 1.0.

void Graphic3d_MaterialAspect::SetSpecularColor ( const Quantity_Color AColor)

Modifies the specular colour of the surface.

void Graphic3d_MaterialAspect::SetTransparency ( const Standard_Real  AValue)

Modifies the transparency coefficient of the surface. <AValue> = 0. opaque. (default) <AValue> = 1. 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.

NOTE: In order for transparency specified through this method to take effect, it is necessary to enable transparency in the viewer. This can be done either directly - see Visual3d_ViewManager::SetTransparency(Standard_Boolean), or indirectly - by calling AIS_InteractiveObject::SetTransparency() before an object is added to an interactive context, or by calling AIS_InteractiveContext::SetTransparency() for a given interactive object already displayed. Category: Methods to modify the class definition Warning: Raises MaterialDefinitionError if <AValue> is a negative value or greater than 1.0.

Standard_Real Graphic3d_MaterialAspect::Shininess ( ) const

Returns the luminosity of the surface.

Standard_Real Graphic3d_MaterialAspect::Specular ( ) const

Returns the reflection properties of the surface.

const Quantity_Color& Graphic3d_MaterialAspect::SpecularColor ( ) const

Returns the specular colour of the surface.

Standard_Real Graphic3d_MaterialAspect::Transparency ( ) const

Returns the transparency coefficient of the surface.


The documentation for this class was generated from the following file: