Open Inventor Release 2024.2.1
 
Loading...
Searching...
No Matches
SoMaterialElement Class Reference

Store in the state the material properties set by some property nodes. More...

#include <Inventor/elements/SoMaterialElement.h>

+ Inheritance diagram for SoMaterialElement:

Public Types

enum  masks {
  COLOR_MATERIAL_MASK = 1 << 1 ,
  DIFFUSE_MASK = 1 << 2 ,
  AMBIENT_MASK = 1 << 3 ,
  EMISSIVE_MASK = 1 << 4 ,
  SPECULAR_MASK = 1 << 5 ,
  SHININESS_MASK = 1 << 6 ,
  TRANSPARENCY_MASK = 1 << 8 ,
  ALL_MASK = 0xFFFF
}
 Masks. More...
 

Public Member Functions

int32_t getNumDiffuse () const
 Method to inquire about current colors.
 
int32_t getNumColorIndices () const
 Method to inquire about current colors.
 
virtual void push (SoState *state)
 Copy current material into the pushed element.
 
virtual void pop (SoState *state, const SoElement *prevTopElement)
 Unref buffer object of the popped element.
 
- Public Member Functions inherited from SoElement
virtual SoType getTypeId () const
 Returns type identifier for element instance.
 
- Public Member Functions inherited from SoTypedObject
SbBool isOfType (const SoType &type) const
 Returns TRUE if this object is of the type specified in type or is derived from that type.
 
template<typename TypedObjectClass >
SbBool isOfType () const
 Returns TRUE if this object is of the type of class TypedObjectClass or is derived from that class.
 

Static Public Member Functions

static SoType getClassTypeId ()
 Returns the type identifier for this class.
 
static int getClassStackIndex ()
 Returns the stack id for this element.
 
static void setDiffuse (SoState *state, SoNode *node, int32_t numColors, const SbColor *colors)
 Static set method.
 
static void setTransparency (SoState *state, SoNode *node, int32_t numTransp, const float *transp)
 Static set method.
 
static void setPacked (SoState *state, SoNode *node, int32_t numColors, const uint32_t *colors)
 
static void setColorIndices (SoState *state, SoNode *node, int32_t numIndices, const int32_t *indices)
 Static set method.
 
static void setAmbient (SoState *state, SoNode *node, const SbColor &color)
 
static void setEmissive (SoState *state, SoNode *node, const SbColor &color)
 
static void setSpecular (SoState *state, SoNode *node, const SbColor &color)
 
static void setShininess (SoState *state, SoNode *node, float value)
 
static void setColorMaterial (SoState *state, SoNode *node, SbBool value)
 
static void setSpecularFactor (SoState *state, SoNode *node, float value)
 
static void setRoughness (SoState *state, SoNode *node, float value)
 
static void setMetallic (SoState *state, SoNode *node, float value)
 
static SbColor getDiffuse (SoState *state, int index)
 get() methods get value from Inventor state.
 
static float getTransparency (SoState *, int index)
 get() methods get value from Inventor state.
 
static SoCpuBufferObjectgetPackedColors (SoState *state)
 Return packed colors if any.
 
static const int32_t * getColorIndices (SoState *state)
 
static int32_t getColorIndex (SoState *, int num)
 
static const SbColorgetAmbient (SoState *)
 
static const SbColorgetEmissive (SoState *)
 
static const SbColorgetSpecular (SoState *)
 
static float getShininess (SoState *)
 
static SbBool getColorMaterial (SoState *)
 
static float getSpecularFactor (SoState *state)
 
static float getRoughness (SoState *state)
 
static float getMetallic (SoState *state)
 
static size_t getNumDiffuse (SoState *state)
 Return number of diffuse colors.
 
static size_t getNumColorIndices (SoState *state)
 Method to inquire about current colors.
 
static int32_t getNumTransparencies (SoState *state)
 Method to inquire about current colors.
 
static bool isTransparent (SoState *state)
 Method to inquire about current colors.
 
static float getDefaultAmbientIntensity ()
 Specify Open Inventor defaults for colors, etc.
 
static SbColor getDefaultDiffuse ()
 Specify Open Inventor defaults for colors, etc.
 
static SbColor getDefaultAmbient ()
 Specify Open Inventor defaults for colors, etc.
 
static SbColor getDefaultSpecular ()
 Specify Open Inventor defaults for colors, etc.
 
static SbColor getDefaultEmissive ()
 Specify Open Inventor defaults for colors, etc.
 
static float getDefaultShininess ()
 Specify Open Inventor defaults for colors, etc.
 
static float getDefaultSpecularFactor ()
 
static float getDefaultRoughness ()
 
static float getDefaultMetallic ()
 
static float getDefaultTransparency ()
 Specify Open Inventor defaults for colors, etc.
 
static int32_t getDefaultColorIndex ()
 Specify Open Inventor defaults for colors, etc.
 
- Static Public Member Functions inherited from SoReplacedElement
static SoType getClassTypeId ()
 Returns the type identifier for this class.
 
static int getClassStackIndex ()
 Returns the stack id for this element.
 
- Static Public Member Functions inherited from SoElement
static SoType getClassTypeId ()
 Returns type identifier for SoElement class.
 
- Static Public Member Functions inherited from SoTypedObject
static SoType getClassTypeId ()
 Returns the type identifier for this class.
 

Detailed Description

Store in the state the material properties set by some property nodes.

The values of this element are modified by property nodes that affects the material characteristics such as: SoBaseColor, SoMaterial, SoPhysicalMaterial.

SEE ALSO

SoBaseColor, SoPhysicalMaterial, SoMaterial, SoPackedColor, SoVertexProperty

Definition at line 53 of file SoMaterialElement.h.

Member Enumeration Documentation

◆ masks

Masks.

Enumerator
COLOR_MATERIAL_MASK 

Color mask.

DIFFUSE_MASK 

Diffuse mask.

AMBIENT_MASK 

Ambient mask.

EMISSIVE_MASK 

Emissive mask.

SPECULAR_MASK 

Specular mask.

SHININESS_MASK 

Shininess mask.

TRANSPARENCY_MASK 

Transparency mask.

ALL_MASK 

All masks.

Definition at line 59 of file SoMaterialElement.h.

Member Function Documentation

◆ getAmbient()

static const SbColor & SoMaterialElement::getAmbient ( SoState )
static

◆ getClassStackIndex()

static int SoMaterialElement::getClassStackIndex ( )
static

Returns the stack id for this element.


◆ getClassTypeId()

static SoType SoMaterialElement::getClassTypeId ( )
static

Returns the type identifier for this class.


◆ getColorIndex()

static int32_t SoMaterialElement::getColorIndex ( SoState ,
int  num 
)
static

◆ getColorIndices()

static const int32_t * SoMaterialElement::getColorIndices ( SoState state)
static

◆ getColorMaterial()

static SbBool SoMaterialElement::getColorMaterial ( SoState )
static

◆ getDefaultAmbient()

static SbColor SoMaterialElement::getDefaultAmbient ( )
inlinestatic

Specify Open Inventor defaults for colors, etc.

Definition at line 211 of file SoMaterialElement.h.

◆ getDefaultAmbientIntensity()

static float SoMaterialElement::getDefaultAmbientIntensity ( )
inlinestatic

Specify Open Inventor defaults for colors, etc.

Definition at line 198 of file SoMaterialElement.h.

◆ getDefaultColorIndex()

static int32_t SoMaterialElement::getDefaultColorIndex ( )
inlinestatic

Specify Open Inventor defaults for colors, etc.

Definition at line 259 of file SoMaterialElement.h.

◆ getDefaultDiffuse()

static SbColor SoMaterialElement::getDefaultDiffuse ( )
inlinestatic

Specify Open Inventor defaults for colors, etc.

Definition at line 205 of file SoMaterialElement.h.

◆ getDefaultEmissive()

static SbColor SoMaterialElement::getDefaultEmissive ( )
inlinestatic

Specify Open Inventor defaults for colors, etc.

Definition at line 223 of file SoMaterialElement.h.

◆ getDefaultMetallic()

static float SoMaterialElement::getDefaultMetallic ( )
inlinestatic

Definition at line 245 of file SoMaterialElement.h.

◆ getDefaultRoughness()

static float SoMaterialElement::getDefaultRoughness ( )
inlinestatic

Definition at line 240 of file SoMaterialElement.h.

◆ getDefaultShininess()

static float SoMaterialElement::getDefaultShininess ( )
inlinestatic

Specify Open Inventor defaults for colors, etc.

Definition at line 229 of file SoMaterialElement.h.

◆ getDefaultSpecular()

static SbColor SoMaterialElement::getDefaultSpecular ( )
inlinestatic

Specify Open Inventor defaults for colors, etc.

Definition at line 217 of file SoMaterialElement.h.

◆ getDefaultSpecularFactor()

static float SoMaterialElement::getDefaultSpecularFactor ( )
inlinestatic

Definition at line 235 of file SoMaterialElement.h.

◆ getDefaultTransparency()

static float SoMaterialElement::getDefaultTransparency ( )
inlinestatic

Specify Open Inventor defaults for colors, etc.

Definition at line 253 of file SoMaterialElement.h.

◆ getDiffuse()

static SbColor SoMaterialElement::getDiffuse ( SoState state,
int  index 
)
static

get() methods get value from Inventor state.

The public methods are static, they get an instance of the element.

◆ getEmissive()

static const SbColor & SoMaterialElement::getEmissive ( SoState )
static

◆ getMetallic()

static float SoMaterialElement::getMetallic ( SoState state)
static

◆ getNumColorIndices() [1/2]

int32_t SoMaterialElement::getNumColorIndices ( ) const
inline

Method to inquire about current colors.

Definition at line 186 of file SoMaterialElement.h.

◆ getNumColorIndices() [2/2]

static size_t SoMaterialElement::getNumColorIndices ( SoState state)
static

Method to inquire about current colors.

◆ getNumDiffuse() [1/2]

int32_t SoMaterialElement::getNumDiffuse ( ) const
inline

Method to inquire about current colors.

Definition at line 175 of file SoMaterialElement.h.

◆ getNumDiffuse() [2/2]

static size_t SoMaterialElement::getNumDiffuse ( SoState state)
static

Return number of diffuse colors.

◆ getNumTransparencies()

static int32_t SoMaterialElement::getNumTransparencies ( SoState state)
static

Method to inquire about current colors.

◆ getPackedColors()

static SoCpuBufferObject * SoMaterialElement::getPackedColors ( SoState state)
static

Return packed colors if any.

◆ getRoughness()

static float SoMaterialElement::getRoughness ( SoState state)
static

◆ getShininess()

static float SoMaterialElement::getShininess ( SoState )
static

◆ getSpecular()

static const SbColor & SoMaterialElement::getSpecular ( SoState )
static

◆ getSpecularFactor()

static float SoMaterialElement::getSpecularFactor ( SoState state)
static

◆ getTransparency()

static float SoMaterialElement::getTransparency ( SoState ,
int  index 
)
static

get() methods get value from Inventor state.

The public methods are static, they get an instance of the element. If there is a cache, the appropriate virtual registerGetDependence is called.

◆ isTransparent()

static bool SoMaterialElement::isTransparent ( SoState state)
static

Method to inquire about current colors.

◆ pop()

virtual void SoMaterialElement::pop ( SoState state,
const SoElement prevTopElement 
)
virtual

Unref buffer object of the popped element.

Reimplemented from SoElement.

◆ push()

virtual void SoMaterialElement::push ( SoState state)
virtual

Copy current material into the pushed element.

Reimplemented from SoElement.

◆ setAmbient()

static void SoMaterialElement::setAmbient ( SoState state,
SoNode node,
const SbColor color 
)
static

◆ setColorIndices()

static void SoMaterialElement::setColorIndices ( SoState state,
SoNode node,
int32_t  numIndices,
const int32_t *  indices 
)
static

Static set method.

◆ setColorMaterial()

static void SoMaterialElement::setColorMaterial ( SoState state,
SoNode node,
SbBool  value 
)
static

◆ setDiffuse()

static void SoMaterialElement::setDiffuse ( SoState state,
SoNode node,
int32_t  numColors,
const SbColor colors 
)
static

Static set method.

◆ setEmissive()

static void SoMaterialElement::setEmissive ( SoState state,
SoNode node,
const SbColor color 
)
static

◆ setMetallic()

static void SoMaterialElement::setMetallic ( SoState state,
SoNode node,
float  value 
)
static

◆ setPacked()

static void SoMaterialElement::setPacked ( SoState state,
SoNode node,
int32_t  numColors,
const uint32_t *  colors 
)
static

◆ setRoughness()

static void SoMaterialElement::setRoughness ( SoState state,
SoNode node,
float  value 
)
static

◆ setShininess()

static void SoMaterialElement::setShininess ( SoState state,
SoNode node,
float  value 
)
static

◆ setSpecular()

static void SoMaterialElement::setSpecular ( SoState state,
SoNode node,
const SbColor color 
)
static

◆ setSpecularFactor()

static void SoMaterialElement::setSpecularFactor ( SoState state,
SoNode node,
float  value 
)
static

◆ setTransparency()

static void SoMaterialElement::setTransparency ( SoState state,
SoNode node,
int32_t  numTransp,
const float *  transp 
)
static

Static set method.


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