Manages several properties that need to be lazily tracked for OpenGL. More...
#include <Inventor/elements/SoLazyElement.h>
Classes | |
class | __ivstate |
Public Types | |
enum | cases { LIGHT_MODEL_CASE = 0, COLOR_MATERIAL_CASE = 1, DIFFUSE_CASE = 2, AMBIENT_CASE = 3, EMISSIVE_CASE = 4, SPECULAR_CASE = 5, SHININESS_CASE = 6, BLENDING_CASE = 7, TRANSPARENCY_CASE = 8, PATTERN_CASE = 9, SMOOTHING_CASE = 10, LINE_WIDTH_CASE = 11 } |
enum | masks { LIGHT_MODEL_MASK = 1 << LIGHT_MODEL_CASE, COLOR_MATERIAL_MASK = 1 << COLOR_MATERIAL_CASE, DIFFUSE_MASK = 1 << DIFFUSE_CASE, AMBIENT_MASK = 1 << AMBIENT_CASE, EMISSIVE_MASK = 1 << EMISSIVE_CASE, SPECULAR_MASK = 1 << SPECULAR_CASE, SHININESS_MASK = 1 << SHININESS_CASE, TRANSPARENCY_MASK = 1 << TRANSPARENCY_CASE, BLENDING_MASK = 1 << BLENDING_CASE, SMOOTHING_MASK = 1 << SMOOTHING_CASE, ALL_MASK = (1 << SO_LAZY_NUM_COMPONENTS)-1, PATTERN_MASK = 1 << PATTERN_CASE, LINE_WIDTH_MASK = 1 << LINE_WIDTH_CASE } |
enum | LightModel { BASE_COLOR = 0, PHONG = 1 } |
Public Member Functions | |
int32_t | getNumDiffuse () const |
int32_t | getNumTransparencies () const |
int32_t | getNumColorIndices () const |
SbBool | isPacked () const |
SbBool | isTransparent () const |
virtual void | push (SoState *state) |
Static Public Member Functions | |
static SoType | getClassTypeId () |
static int | getClassStackIndex () |
static void | setDiffuse (SoState *state, SoNode *node, int32_t numColors, const SbColor *colors, SoColorPacker *cPacker) |
static void | setTransparency (SoState *state, SoNode *node, int32_t numTransp, const float *transp, SoColorPacker *cPacker) |
static void | setPacked (SoState *state, SoNode *node, SoColorPacker *cPacker, 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, const SbColor &color) |
static void | setEmissive (SoState *state, const SbColor &color) |
static void | setSpecular (SoState *state, const SbColor &color) |
static void | setShininess (SoState *state, float value) |
static void | setColorMaterial (SoState *state, SbBool value) |
static void | setBlending (SoState *state, SbBool value) |
static void | setSmoothing (SoState *state, SbBool value) |
static void | setLightModel (SoState *state, const int32_t model) |
static const SbColor & | getDiffuse (SoState *state, int index) |
static float | getTransparency (SoState *, int index) |
static const uint32_t * | 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 SbBool | getBlending (SoState *) |
static SbBool | getSmoothing (SoState *) |
static int32_t | getLightModel (SoState *) |
static SoLazyElement * | getInstance (SoState *state) |
static float | getDefaultAmbientIntensity () |
static SbColor | getDefaultDiffuse () |
static SbColor | getDefaultAmbient () |
static SbColor | getDefaultSpecular () |
static SbColor | getDefaultEmissive () |
static float | getDefaultShininess () |
static uint32_t | getDefaultPackedInternal () |
static uint32_t | getDefaultPacked () |
static float | getDefaultTransparency () |
static int32_t | getDefaultLightModel () |
static int32_t | getDefaultColorIndex () |
static float | getDefaultLineWidth () |
Deprecated | |
| |
static SoDEPRECATED void | setAmbient (SoState *state, const SbColor *color) |
static SoDEPRECATED void | setEmissive (SoState *state, const SbColor *color) |
static SoDEPRECATED void | setSpecular (SoState *state, const SbColor *color) |
Manages several properties that need to be lazily tracked for OpenGL.
This element manages several properties such as colors, that need to be lazily tracked for OpenGL. Allows Open Inventor property nodes to set these properties without immediately making any OpenGL calls. Thus we avoid making redundant OpenGL 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 OpenGL state) be sent to OpenGL.
Includes:
Transparencies
GLColorMaterial
GLBlendEnablement
PolygonStipple
Light model
Color index
Line width
SoBaseColor, SoMaterial, SoPackedColor, SoTransparencyType, SoVertexProperty
enum SoLazyElement::cases |
Following masks and cases define the components of the lazy element.
Masks are needed by SoEXTENDER apps that need to use SoGLLazyElement::reset(bitmask) to invalidate GL values of particular components. NOTE: the order of these cases should not be changed without careful consideration of dependencies in the reallySend method. Cases
enum SoLazyElement::masks |
Masks.
static int SoLazyElement::getClassStackIndex | ( | ) | [static] |
Returns the stack id for this element.
Reimplemented from SoElement.
Reimplemented in SoGLLazyElement.
static SoType SoLazyElement::getClassTypeId | ( | ) | [static] |
Returns the type identifier for this class.
Reimplemented from SoElement.
Reimplemented in SoGLLazyElement.
static int32_t SoLazyElement::getColorIndex | ( | SoState * | , | |
int | num | |||
) | [static] |
static const int32_t* SoLazyElement::getColorIndices | ( | SoState * | state | ) | [static] |
static SbColor SoLazyElement::getDefaultAmbient | ( | ) | [inline, static] |
Specify Open Inventor defaults for colors, etc.
static float SoLazyElement::getDefaultAmbientIntensity | ( | ) | [inline, static] |
Specify Open Inventor defaults for colors, etc.
static int32_t SoLazyElement::getDefaultColorIndex | ( | ) | [inline, static] |
Specify Open Inventor defaults for colors, etc.
static SbColor SoLazyElement::getDefaultDiffuse | ( | ) | [inline, static] |
Specify Open Inventor defaults for colors, etc.
static SbColor SoLazyElement::getDefaultEmissive | ( | ) | [inline, static] |
Specify Open Inventor defaults for colors, etc.
static int32_t SoLazyElement::getDefaultLightModel | ( | ) | [inline, static] |
Specify Open Inventor defaults for colors, etc.
static float SoLazyElement::getDefaultLineWidth | ( | ) | [inline, static] |
Specify Open Inventor defaults for colors, etc.
static uint32_t SoLazyElement::getDefaultPacked | ( | ) | [inline, static] |
Specify Open Inventor defaults for colors, etc.
static uint32_t SoLazyElement::getDefaultPackedInternal | ( | ) | [static] |
Specify Open Inventor defaults for colors, etc.
static float SoLazyElement::getDefaultShininess | ( | ) | [inline, static] |
Specify Open Inventor defaults for colors, etc.
static SbColor SoLazyElement::getDefaultSpecular | ( | ) | [inline, static] |
Specify Open Inventor defaults for colors, etc.
static float SoLazyElement::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. If there is a cache, the appropriate virtual registerGetDependence is called.
static SoLazyElement* SoLazyElement::getInstance | ( | SoState * | state | ) | [inline, static] |
Returns the top (current) instance of the element in the state Note that the cache dependencies associated with this element are managed differently from other elements: this replaces the SoElement::getConstElement that is used by standard elements, but which causes cache dependency.
Note that this element is not const; however modifications to it can cause problems. SoEXTENDER apps should use only SoEXTENDER methods on this element.
static int32_t SoLazyElement::getLightModel | ( | SoState * | ) | [static] |
int32_t SoLazyElement::getNumColorIndices | ( | ) | const [inline] |
Method to inquire about current colors.
int32_t SoLazyElement::getNumDiffuse | ( | ) | const [inline] |
Method to inquire about current colors.
int32_t SoLazyElement::getNumTransparencies | ( | ) | const [inline] |
Method to inquire about current colors.
static const uint32_t* SoLazyElement::getPackedColors | ( | SoState * | state | ) | [static] |
static float SoLazyElement::getShininess | ( | SoState * | ) | [static] |
static float SoLazyElement::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.
SbBool SoLazyElement::isPacked | ( | ) | const [inline] |
Method to inquire about current colors.
SbBool SoLazyElement::isTransparent | ( | ) | const |
Method to inquire about current colors.
virtual void SoLazyElement::push | ( | SoState * | state | ) | [virtual] |
static SoDEPRECATED void SoLazyElement::setAmbient | ( | SoState * | state, | |
const SbColor * | color | |||
) | [inline, static] |
static void SoLazyElement::setColorIndices | ( | SoState * | state, | |
SoNode * | node, | |||
int32_t | numIndices, | |||
const int32_t * | indices | |||
) | [static] |
Static set method.
static void SoLazyElement::setDiffuse | ( | SoState * | state, | |
SoNode * | node, | |||
int32_t | numColors, | |||
const SbColor * | colors, | |||
SoColorPacker * | cPacker | |||
) | [static] |
Static set method.
static SoDEPRECATED void SoLazyElement::setEmissive | ( | SoState * | state, | |
const SbColor * | color | |||
) | [inline, static] |
static void SoLazyElement::setLightModel | ( | SoState * | state, | |
const int32_t | model | |||
) | [static] |
static void SoLazyElement::setPacked | ( | SoState * | state, | |
SoNode * | node, | |||
SoColorPacker * | cPacker, | |||
int32_t | numColors, | |||
const uint32_t * | colors | |||
) | [static] |
Static set method.
static void SoLazyElement::setShininess | ( | SoState * | state, | |
float | value | |||
) | [static] |
static SoDEPRECATED void SoLazyElement::setSpecular | ( | SoState * | state, | |
const SbColor * | color | |||
) | [inline, static] |
static void SoLazyElement::setTransparency | ( | SoState * | state, | |
SoNode * | node, | |||
int32_t | numTransp, | |||
const float * | transp, | |||
SoColorPacker * | cPacker | |||
) | [static] |
Static set method.