Manages several properties that need to be lazily tracked for rendering. More...
#include <Inventor/elements/SoMaterialElement.h>
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 SoCpuBufferObject * | getPackedColors (SoState *state) |
static const int32_t * | getColorIndices (SoState *state) |
static int32_t | getColorIndex (SoState *, int num) |
static const SbColor & | getAmbient (SoState *) |
static const SbColor & | getEmissive (SoState *) |
static const SbColor & | getSpecular (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 () |
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
SoBaseColor, SoMaterial, SoPackedColor, SoVertexProperty
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 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.
get() methods get value from Inventor state.
The public methods are static, they get an instance of the element.
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 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.
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.