Open CASCADE Technology Reference Manual 8.0.0
Loading...
Searching...
No Matches
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, Absorption. More...

#include <Graphic3d_MaterialAspect.hxx>

Public Member Functions

 Graphic3d_MaterialAspect ()
 Creates a material from default values.
 
 Graphic3d_MaterialAspect (const Graphic3d_NameOfMaterial theName)
 Creates a generic material.
 
Graphic3d_NameOfMaterial Name () const
 Returns the material name (within predefined enumeration).
 
Graphic3d_NameOfMaterial RequestedName () const
 Returns the material name within predefined enumeration which has been requested (before modifications).
 
const TCollection_AsciiStringStringName () const
 Returns the given name of this material. This might be:
 
const charMaterialName () const
 Returns the given name of this material. This might be:
 
void SetMaterialName (const TCollection_AsciiString &theName)
 The current material become a "UserDefined" material. Set the name of the "UserDefined" material.
 
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.
 
const Quantity_ColorColor () const
 Returns the diffuse color of the surface. WARNING! This method does NOT return color for Graphic3d_MATERIAL_ASPECT material (color is defined by Graphic3d_Aspects::InteriorColor()).
 
void SetColor (const Quantity_Color &theColor)
 Modifies the ambient and diffuse color of the surface. WARNING! Has no effect for Graphic3d_MATERIAL_ASPECT material (color should be set to Graphic3d_Aspects::SetInteriorColor()).
 
float Transparency () const
 Returns the transparency coefficient of the surface (1.0 - Alpha); 0.0 means opaque.
 
float Alpha () const
 Returns the alpha coefficient of the surface (1.0 - Transparency); 1.0 means opaque.
 
void SetTransparency (const float 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.
 
void SetAlpha (float theValue)
 Modifies the alpha coefficient of the surface, where 1.0 is opaque and 0.0 is fully transparent.
 
const Quantity_ColorAmbientColor () const
 Returns the ambient color of the surface.
 
void SetAmbientColor (const Quantity_Color &theColor)
 Modifies the ambient color of the surface.
 
const Quantity_ColorDiffuseColor () const
 Returns the diffuse color of the surface.
 
void SetDiffuseColor (const Quantity_Color &theColor)
 Modifies the diffuse color of the surface.
 
const Quantity_ColorSpecularColor () const
 Returns the specular color of the surface.
 
void SetSpecularColor (const Quantity_Color &theColor)
 Modifies the specular color of the surface.
 
const Quantity_ColorEmissiveColor () const
 Returns the emissive color of the surface.
 
void SetEmissiveColor (const Quantity_Color &theColor)
 Modifies the emissive color of the surface.
 
float Shininess () const
 Returns the luminosity of the surface.
 
void SetShininess (const float theValue)
 Modifies the luminosity of the surface. Warning: Raises MaterialDefinitionError if given value is a negative value or greater than 1.0.
 
void IncreaseShine (const float theDelta)
 Increases or decreases the luminosity.
 
float RefractionIndex () const
 Returns the refraction index of the material.
 
void SetRefractionIndex (const float theValue)
 Modifies the refraction index of the material. Warning: Raises MaterialDefinitionError if given value is a lesser than 1.0.
 
const Graphic3d_BSDFBSDF () const
 Returns BSDF (bidirectional scattering distribution function).
 
void SetBSDF (const Graphic3d_BSDF &theBSDF)
 Modifies the BSDF (bidirectional scattering distribution function).
 
const Graphic3d_PBRMaterialPBRMaterial () const
 Returns physically based representation of material.
 
void SetPBRMaterial (const Graphic3d_PBRMaterial &thePBRMaterial)
 Modifies the physically based representation of material.
 
bool ReflectionMode (const Graphic3d_TypeOfReflection theType) const
 Returns TRUE if the reflection mode is active, FALSE otherwise.
 
Graphic3d_TypeOfMaterial MaterialType () const
 Returns material type.
 
bool MaterialType (const Graphic3d_TypeOfMaterial theType) const
 Returns TRUE if type of this material is equal to specified type.
 
void SetMaterialType (const Graphic3d_TypeOfMaterial theType)
 Set material type.
 
bool IsDifferent (const Graphic3d_MaterialAspect &theOther) const
 Returns TRUE if this material differs from specified one.
 
bool operator!= (const Graphic3d_MaterialAspect &theOther) const
 Returns TRUE if this material differs from specified one.
 
bool IsEqual (const Graphic3d_MaterialAspect &theOther) const
 Returns TRUE if this material is identical to specified one.
 
bool operator== (const Graphic3d_MaterialAspect &theOther) const
 Returns TRUE if this material is identical to specified one.
 
void DumpJson (Standard_OStream &theOStream, int theDepth=-1) const
 Dumps the content of me into the stream.
 
instead void SetReflectionModeOff (const Graphic3d_TypeOfReflection theType)
 Deactivates the reflective properties of the surface with specified reflection type.
 

Static Public Member Functions

static int NumberOfMaterials ()
 Returns the number of predefined textures.
 
static const charMaterialName (const int theRank)
 Returns the name of the predefined material of specified rank within range [1, NumberOfMaterials()].
 
static Graphic3d_TypeOfMaterial MaterialType (const int theRank)
 Returns the type of the predefined material of specified rank within range [1, NumberOfMaterials()].
 
static bool MaterialFromName (const char *const theName, Graphic3d_NameOfMaterial &theMat)
 Finds the material for specified name.
 
static Graphic3d_NameOfMaterial MaterialFromName (const char *const theName)
 Returns the material for specified name or Graphic3d_NameOfMaterial_DEFAULT if name is unknown.
 

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, Absorption.

Constructor & Destructor Documentation

◆ Graphic3d_MaterialAspect() [1/2]

Graphic3d_MaterialAspect::Graphic3d_MaterialAspect ( )

Creates a material from default values.

◆ Graphic3d_MaterialAspect() [2/2]

Graphic3d_MaterialAspect::Graphic3d_MaterialAspect ( const Graphic3d_NameOfMaterial theName)

Creates a generic material.

Member Function Documentation

◆ Alpha()

float Graphic3d_MaterialAspect::Alpha ( ) const
inline

Returns the alpha coefficient of the surface (1.0 - Transparency); 1.0 means opaque.

◆ AmbientColor()

const Quantity_Color & Graphic3d_MaterialAspect::AmbientColor ( ) const
inline

Returns the ambient color of the surface.

◆ BSDF()

const Graphic3d_BSDF & Graphic3d_MaterialAspect::BSDF ( ) const
inline

Returns BSDF (bidirectional scattering distribution function).

◆ Color()

const Quantity_Color & Graphic3d_MaterialAspect::Color ( ) const
inline

Returns the diffuse color of the surface. WARNING! This method does NOT return color for Graphic3d_MATERIAL_ASPECT material (color is defined by Graphic3d_Aspects::InteriorColor()).

◆ DiffuseColor()

const Quantity_Color & Graphic3d_MaterialAspect::DiffuseColor ( ) const
inline

Returns the diffuse color of the surface.

◆ DumpJson()

void Graphic3d_MaterialAspect::DumpJson ( Standard_OStream & theOStream,
int theDepth = -1 ) const

Dumps the content of me into the stream.

◆ EmissiveColor()

const Quantity_Color & Graphic3d_MaterialAspect::EmissiveColor ( ) const
inline

Returns the emissive color of the surface.

◆ IncreaseShine()

void Graphic3d_MaterialAspect::IncreaseShine ( const float theDelta)

Increases or decreases the luminosity.

Parameters
theDeltaa signed percentage

◆ IsDifferent()

bool Graphic3d_MaterialAspect::IsDifferent ( const Graphic3d_MaterialAspect & theOther) const
inline

Returns TRUE if this material differs from specified one.

◆ IsEqual()

bool Graphic3d_MaterialAspect::IsEqual ( const Graphic3d_MaterialAspect & theOther) const
inline

Returns TRUE if this material is identical to specified one.

◆ MaterialFromName() [1/2]

static Graphic3d_NameOfMaterial Graphic3d_MaterialAspect::MaterialFromName ( const char *const theName)
inlinestatic

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

◆ MaterialFromName() [2/2]

static bool Graphic3d_MaterialAspect::MaterialFromName ( const char *const theName,
Graphic3d_NameOfMaterial & theMat )
static

Finds the material for specified name.

Parameters
[in]theNamename to find
[out]theMatfound material
Returns
FALSE if name was unrecognized

◆ MaterialName() [1/2]

const char * Graphic3d_MaterialAspect::MaterialName ( ) const
inline

Returns the given name of this material. This might be:

◆ MaterialName() [2/2]

static const char * Graphic3d_MaterialAspect::MaterialName ( const int theRank)
static

Returns the name of the predefined material of specified rank within range [1, NumberOfMaterials()].

◆ MaterialType() [1/3]

Graphic3d_TypeOfMaterial Graphic3d_MaterialAspect::MaterialType ( ) const
inline

Returns material type.

◆ MaterialType() [2/3]

bool Graphic3d_MaterialAspect::MaterialType ( const Graphic3d_TypeOfMaterial theType) const
inline

Returns TRUE if type of this material is equal to specified type.

◆ MaterialType() [3/3]

static Graphic3d_TypeOfMaterial Graphic3d_MaterialAspect::MaterialType ( const int theRank)
static

Returns the type of the predefined material of specified rank within range [1, NumberOfMaterials()].

◆ Name()

Graphic3d_NameOfMaterial Graphic3d_MaterialAspect::Name ( ) const
inline

Returns the material name (within predefined enumeration).

◆ NumberOfMaterials()

static int Graphic3d_MaterialAspect::NumberOfMaterials ( )
inlinestatic

Returns the number of predefined textures.

◆ operator!=()

bool Graphic3d_MaterialAspect::operator!= ( const Graphic3d_MaterialAspect & theOther) const
inline

Returns TRUE if this material differs from specified one.

◆ operator==()

bool Graphic3d_MaterialAspect::operator== ( const Graphic3d_MaterialAspect & theOther) const
inline

Returns TRUE if this material is identical to specified one.

◆ PBRMaterial()

const Graphic3d_PBRMaterial & Graphic3d_MaterialAspect::PBRMaterial ( ) const
inline

Returns physically based representation of material.

◆ ReflectionMode()

bool Graphic3d_MaterialAspect::ReflectionMode ( const Graphic3d_TypeOfReflection theType) const
inline

Returns TRUE if the reflection mode is active, FALSE otherwise.

◆ RefractionIndex()

float Graphic3d_MaterialAspect::RefractionIndex ( ) const
inline

Returns the refraction index of the material.

◆ RequestedName()

Graphic3d_NameOfMaterial Graphic3d_MaterialAspect::RequestedName ( ) const
inline

Returns the material name within predefined enumeration which has been requested (before modifications).

◆ Reset()

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

◆ SetAlpha()

void Graphic3d_MaterialAspect::SetAlpha ( float theValue)
inline

Modifies the alpha coefficient of the surface, where 1.0 is opaque and 0.0 is fully transparent.

◆ SetAmbientColor()

void Graphic3d_MaterialAspect::SetAmbientColor ( const Quantity_Color & theColor)

Modifies the ambient color of the surface.

◆ SetBSDF()

void Graphic3d_MaterialAspect::SetBSDF ( const Graphic3d_BSDF & theBSDF)
inline

Modifies the BSDF (bidirectional scattering distribution function).

◆ SetColor()

void Graphic3d_MaterialAspect::SetColor ( const Quantity_Color & theColor)

Modifies the ambient and diffuse color of the surface. WARNING! Has no effect for Graphic3d_MATERIAL_ASPECT material (color should be set to Graphic3d_Aspects::SetInteriorColor()).

◆ SetDiffuseColor()

void Graphic3d_MaterialAspect::SetDiffuseColor ( const Quantity_Color & theColor)

Modifies the diffuse color of the surface.

◆ SetEmissiveColor()

void Graphic3d_MaterialAspect::SetEmissiveColor ( const Quantity_Color & theColor)

Modifies the emissive color of the surface.

◆ SetMaterialName()

void Graphic3d_MaterialAspect::SetMaterialName ( const TCollection_AsciiString & theName)
inline

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

◆ SetMaterialType()

void Graphic3d_MaterialAspect::SetMaterialType ( const Graphic3d_TypeOfMaterial theType)

Set material type.

◆ SetPBRMaterial()

void Graphic3d_MaterialAspect::SetPBRMaterial ( const Graphic3d_PBRMaterial & thePBRMaterial)
inline

Modifies the physically based representation of material.

◆ SetReflectionModeOff()

instead void Graphic3d_MaterialAspect::SetReflectionModeOff ( const Graphic3d_TypeOfReflection theType)
inline

Deactivates the reflective properties of the surface with specified reflection type.

Deprecated
("Deprecated method, specific material component should be zerroed "

◆ SetRefractionIndex()

void Graphic3d_MaterialAspect::SetRefractionIndex ( const float theValue)

Modifies the refraction index of the material. Warning: Raises MaterialDefinitionError if given value is a lesser than 1.0.

◆ SetShininess()

void Graphic3d_MaterialAspect::SetShininess ( const float theValue)

Modifies the luminosity of the surface. Warning: Raises MaterialDefinitionError if given value is a negative value or greater than 1.0.

◆ SetSpecularColor()

void Graphic3d_MaterialAspect::SetSpecularColor ( const Quantity_Color & theColor)

Modifies the specular color of the surface.

◆ SetTransparency()

void Graphic3d_MaterialAspect::SetTransparency ( const float 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.

◆ Shininess()

float Graphic3d_MaterialAspect::Shininess ( ) const
inline

Returns the luminosity of the surface.

◆ SpecularColor()

const Quantity_Color & Graphic3d_MaterialAspect::SpecularColor ( ) const
inline

Returns the specular color of the surface.

◆ StringName()

const TCollection_AsciiString & Graphic3d_MaterialAspect::StringName ( ) const
inline

Returns the given name of this material. This might be:

  • given name set by method SetMaterialName()
  • standard name for a material within enumeration
  • "UserDefined" for non-standard material without name specified externally.

◆ Transparency()

float Graphic3d_MaterialAspect::Transparency ( ) const
inline

Returns the transparency coefficient of the surface (1.0 - Alpha); 0.0 means opaque.


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