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

Manages several properties that need to be lazily tracked for rendering. 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 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 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 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

Manages several properties that need to be lazily tracked for rendering.

This element manages several properties such as colors, that need to be lazily tracked for rendering. Allows Open Inventor property nodes to set these properties without immediately making any rendering calls. Thus we avoid making redundant rendering calls to set, for example, the material color. Open Inventor rendering nodes then request that the values of any properties that are relevant to that shape and "out of date" (not current with rendering state) be sent to the rendering engine.

Includes:
Transparencies
GLColorMaterial
PolygonStipple
Color index

SEE ALSO

SoBaseColor, SoMaterial, SoPackedColor, SoVertexProperty

Definition at line 63 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 69 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 210 of file SoMaterialElement.h.

◆ getDefaultAmbientIntensity()

static float SoMaterialElement::getDefaultAmbientIntensity ( )
inlinestatic

Specify Open Inventor defaults for colors, etc.

Definition at line 197 of file SoMaterialElement.h.

◆ getDefaultColorIndex()

static int32_t SoMaterialElement::getDefaultColorIndex ( )
inlinestatic

Specify Open Inventor defaults for colors, etc.

Definition at line 240 of file SoMaterialElement.h.

◆ getDefaultDiffuse()

static SbColor SoMaterialElement::getDefaultDiffuse ( )
inlinestatic

Specify Open Inventor defaults for colors, etc.

Definition at line 204 of file SoMaterialElement.h.

◆ getDefaultEmissive()

static SbColor SoMaterialElement::getDefaultEmissive ( )
inlinestatic

Specify Open Inventor defaults for colors, etc.

Definition at line 222 of file SoMaterialElement.h.

◆ getDefaultShininess()

static float SoMaterialElement::getDefaultShininess ( )
inlinestatic

Specify Open Inventor defaults for colors, etc.

Definition at line 228 of file SoMaterialElement.h.

◆ getDefaultSpecular()

static SbColor SoMaterialElement::getDefaultSpecular ( )
inlinestatic

Specify Open Inventor defaults for colors, etc.

Definition at line 216 of file SoMaterialElement.h.

◆ getDefaultTransparency()

static float SoMaterialElement::getDefaultTransparency ( )
inlinestatic

Specify Open Inventor defaults for colors, etc.

Definition at line 234 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

◆ getNumColorIndices() [1/2]

int32_t SoMaterialElement::getNumColorIndices ( ) const
inline

Method to inquire about current colors.

Definition at line 185 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 174 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.

◆ getShininess()

static float SoMaterialElement::getShininess ( SoState )
static

◆ getSpecular()

static const SbColor & SoMaterialElement::getSpecular ( SoState )
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

◆ setPacked()

static void SoMaterialElement::setPacked ( SoState state,
SoNode node,
int32_t  numColors,
const uint32_t *  colors 
)
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

◆ 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: