SoMaterialElement Class Reference
[Elements]

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

#include <Inventor/elements/SoMaterialElement.h>

Inheritance diagram for SoMaterialElement:
SoReplacedElement SoElement SoTypedObject

List of all members.

Classes

struct  Material

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
}

Public Member Functions

int32_t getNumDiffuse () const
int32_t getNumColorIndices () const
virtual void push (SoState *state)
virtual void pop (SoState *state, const SoElement *prevTopElement)

Static Public Member Functions

static SoType getClassTypeId ()
static int getClassStackIndex ()
static void setDiffuse (SoState *state, SoNode *node, int32_t numColors, const SbColor *colors)
static void setTransparency (SoState *state, SoNode *node, int32_t numTransp, const float *transp)
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 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)
static float getTransparency (SoState *, int index)
static SoCpuBufferObjectgetPackedColors (SoState *state)
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)
static size_t getNumColorIndices (SoState *state)
static int32_t getNumTransparencies (SoState *state)
static bool isTransparent (SoState *state)
static float getDefaultAmbientIntensity ()
static SbColor getDefaultDiffuse ()
static SbColor getDefaultAmbient ()
static SbColor getDefaultSpecular ()
static SbColor getDefaultEmissive ()
static float getDefaultShininess ()
static float getDefaultTransparency ()
static int32_t getDefaultColorIndex ()

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


Member Enumeration Documentation

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.


Member Function Documentation

static const SbColor& SoMaterialElement::getAmbient ( SoState  )  [static]
static int SoMaterialElement::getClassStackIndex (  )  [static]

Returns the stack id for this element.

Reimplemented from SoReplacedElement.

static SoType SoMaterialElement::getClassTypeId (  )  [static]

Returns the type identifier for this class.

Reimplemented from SoReplacedElement.

static int32_t SoMaterialElement::getColorIndex ( SoState ,
int  num 
) [static]
static const int32_t* SoMaterialElement::getColorIndices ( SoState state  )  [static]
static SbBool SoMaterialElement::getColorMaterial ( SoState  )  [static]
static SbColor SoMaterialElement::getDefaultAmbient (  )  [inline, static]

Specify Open Inventor defaults for colors, etc.

static float SoMaterialElement::getDefaultAmbientIntensity (  )  [inline, static]

Specify Open Inventor defaults for colors, etc.

static int32_t SoMaterialElement::getDefaultColorIndex (  )  [inline, static]

Specify Open Inventor defaults for colors, etc.

static SbColor SoMaterialElement::getDefaultDiffuse (  )  [inline, static]

Specify Open Inventor defaults for colors, etc.

static SbColor SoMaterialElement::getDefaultEmissive (  )  [inline, static]

Specify Open Inventor defaults for colors, etc.

static float SoMaterialElement::getDefaultShininess (  )  [inline, static]

Specify Open Inventor defaults for colors, etc.

static SbColor SoMaterialElement::getDefaultSpecular (  )  [inline, static]

Specify Open Inventor defaults for colors, etc.

static float SoMaterialElement::getDefaultTransparency (  )  [inline, static]

Specify Open Inventor defaults for colors, etc.

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.

static const SbColor& SoMaterialElement::getEmissive ( SoState  )  [static]
int32_t SoMaterialElement::getNumColorIndices (  )  const [inline]

Method to inquire about current colors.

static size_t SoMaterialElement::getNumColorIndices ( SoState state  )  [static]

Method to inquire about current colors.

int32_t SoMaterialElement::getNumDiffuse (  )  const [inline]

Method to inquire about current colors.

static size_t SoMaterialElement::getNumDiffuse ( SoState state  )  [static]

Return number of diffuse colors.

static int32_t SoMaterialElement::getNumTransparencies ( SoState state  )  [static]

Method to inquire about current colors.

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

Return packed colors if any.

static float SoMaterialElement::getShininess ( SoState  )  [static]
static const SbColor& SoMaterialElement::getSpecular ( SoState  )  [static]
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.

static bool SoMaterialElement::isTransparent ( SoState state  )  [static]

Method to inquire about current colors.

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

Unref buffer object of the popped element.

virtual void SoMaterialElement::push ( SoState state  )  [virtual]

Copy current material into the pushed element.

Reimplemented from SoElement.

static void SoMaterialElement::setAmbient ( SoState state,
SoNode node,
const SbColor color 
) [static]
static void SoMaterialElement::setColorIndices ( SoState state,
SoNode node,
int32_t  numIndices,
const int32_t *  indices 
) [static]

Static set method.

static void SoMaterialElement::setColorMaterial ( SoState state,
SoNode node,
SbBool  value 
) [static]
static void SoMaterialElement::setDiffuse ( SoState state,
SoNode node,
int32_t  numColors,
const SbColor colors 
) [static]

Static set method.

static void SoMaterialElement::setEmissive ( SoState state,
SoNode node,
const SbColor color 
) [static]
static void SoMaterialElement::setPacked ( SoState state,
SoNode node,
int32_t  numColors,
const uint32_t *  colors 
) [static]
static void SoMaterialElement::setShininess ( SoState state,
SoNode node,
float  value 
) [static]
static void SoMaterialElement::setSpecular ( SoState state,
SoNode node,
const SbColor color 
) [static]
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:

Open Inventor Toolkit reference manual, generated on 15 Mar 2023
Copyright © Thermo Fisher Scientific All rights reserved.
http://www.openinventor.com/