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

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

#include <Inventor/elements/SoLazyElement.h>

+ Inheritance diagram for SoLazyElement:

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
}
 Following masks and cases define the components of the lazy element. More...
 
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
}
 Masks. More...
 

Public Member Functions

int32_t getNumDiffuse () const
 Method to inquire about current colors.
 
int32_t getNumTransparencies () const
 Method to inquire about current colors.
 
int32_t getNumColorIndices () const
 Method to inquire about current colors.
 
SbBool isPacked () const
 Method to inquire about current colors.
 
SbBool isTransparent () const
 Method to inquire about current colors.
 
virtual void push (SoState *state)
 push (for non-GL elements)
 
virtual void print (FILE *fp) const
 Prints element (for debugging).
 
- Public Member Functions inherited from SoElement
virtual void pop (SoState *state, const SoElement *prevTopElement)
 Pops element.
 
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, SoColorPacker *cPacker)
 Static set method.
 
static void setTransparency (SoState *state, SoNode *node, int32_t numTransp, const float *transp, SoColorPacker *cPacker)
 Static set method.
 
static void setPacked (SoState *state, SoNode *node, SoColorPacker *cPacker, int32_t numColors, const uint32_t *colors)
 Static set method.
 
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 setBlending (SoState *state, SbBool value)
 
static void setSmoothing (SoState *state, SbBool value)
 
static void setLightModel (SoState *state, const int32_t model)
 
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 const uint32_t * getPackedColors (SoState *state)
 
static const int32_t * getColorIndices (SoState *state)
 
static int32_t getColorIndex (SoState *, int num)
 
static SbColor getAmbient (SoState *)
 
static SbColor getEmissive (SoState *)
 
static 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 SoLazyElementgetInstance (SoState *state)
 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.
 
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 uint32_t getDefaultPackedInternal ()
 Specify Open Inventor defaults for colors, etc.
 
static uint32_t getDefaultPacked ()
 Specify Open Inventor defaults for colors, etc.
 
static float getDefaultTransparency ()
 Specify Open Inventor defaults for colors, etc.
 
static int32_t getDefaultLightModel ()
 Specify Open Inventor defaults for colors, etc.
 
static int32_t getDefaultColorIndex ()
 Specify Open Inventor defaults for colors, etc.
 
static float getDefaultLineWidth ()
 Specify Open Inventor defaults for colors, etc.
 
Deprecated
static SoDEPRECATED void setAmbient (SoState *state, SoNode *node, const SbColor *color)
 
static SoDEPRECATED void setEmissive (SoState *state, SoNode *node, const SbColor *color)
 
static SoDEPRECATED void setSpecular (SoState *state, SoNode *node, const SbColor *color)
 
- 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 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

SEE ALSO

SoBaseColor, SoMaterial, SoPackedColor, SoVertexProperty

Definition at line 105 of file SoLazyElement.h.

Member Enumeration Documentation

◆ 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

Enumerator
LIGHT_MODEL_CASE 

Light model case.

COLOR_MATERIAL_CASE 

Color material case.

DIFFUSE_CASE 

Diffuse case.

AMBIENT_CASE 

Ambient case.

EMISSIVE_CASE 

Emissive case.

SPECULAR_CASE 

Specular case.

SHININESS_CASE 

Shininess case.

BLENDING_CASE 

Blending case.

TRANSPARENCY_CASE 

Transparency case.

PATTERN_CASE 

Pattern case.

SMOOTHING_CASE 

Smoothing case.

LINE_WIDTH_CASE 

Line width case.

Definition at line 119 of file SoLazyElement.h.

◆ masks

Masks.

Enumerator
LIGHT_MODEL_MASK 

Light model mask.

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.

BLENDING_MASK 

Blending mask.

SMOOTHING_MASK 

Smoothing mask.

ALL_MASK 

All masks.

PATTERN_MASK 

Pattern mask.

LINE_WIDTH_MASK 

Line width mask.

Definition at line 147 of file SoLazyElement.h.

Member Function Documentation

◆ getAmbient()

static SbColor SoLazyElement::getAmbient ( SoState )
static

◆ getBlending()

static SbBool SoLazyElement::getBlending ( SoState )
static

◆ getClassStackIndex()

static int SoLazyElement::getClassStackIndex ( )
static

Returns the stack id for this element.


◆ getClassTypeId()

static SoType SoLazyElement::getClassTypeId ( )
static

Returns the type identifier for this class.


◆ getColorIndex()

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

◆ getColorIndices()

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

◆ getColorMaterial()

static SbBool SoLazyElement::getColorMaterial ( SoState )
static

◆ getDefaultAmbient()

static SbColor SoLazyElement::getDefaultAmbient ( )
inlinestatic

Specify Open Inventor defaults for colors, etc.

Definition at line 343 of file SoLazyElement.h.

◆ getDefaultAmbientIntensity()

static float SoLazyElement::getDefaultAmbientIntensity ( )
inlinestatic

Specify Open Inventor defaults for colors, etc.

Definition at line 330 of file SoLazyElement.h.

◆ getDefaultColorIndex()

static int32_t SoLazyElement::getDefaultColorIndex ( )
inlinestatic

Specify Open Inventor defaults for colors, etc.

Definition at line 389 of file SoLazyElement.h.

◆ getDefaultDiffuse()

static SbColor SoLazyElement::getDefaultDiffuse ( )
inlinestatic

Specify Open Inventor defaults for colors, etc.

Definition at line 337 of file SoLazyElement.h.

◆ getDefaultEmissive()

static SbColor SoLazyElement::getDefaultEmissive ( )
inlinestatic

Specify Open Inventor defaults for colors, etc.

Definition at line 355 of file SoLazyElement.h.

◆ getDefaultLightModel()

static int32_t SoLazyElement::getDefaultLightModel ( )
inlinestatic

Specify Open Inventor defaults for colors, etc.

Definition at line 383 of file SoLazyElement.h.

◆ getDefaultLineWidth()

static float SoLazyElement::getDefaultLineWidth ( )
inlinestatic

Specify Open Inventor defaults for colors, etc.

Definition at line 395 of file SoLazyElement.h.

◆ getDefaultPacked()

static uint32_t SoLazyElement::getDefaultPacked ( )
inlinestatic

Specify Open Inventor defaults for colors, etc.

Definition at line 371 of file SoLazyElement.h.

◆ getDefaultPackedInternal()

static uint32_t SoLazyElement::getDefaultPackedInternal ( )
static

Specify Open Inventor defaults for colors, etc.

◆ getDefaultShininess()

static float SoLazyElement::getDefaultShininess ( )
inlinestatic

Specify Open Inventor defaults for colors, etc.

Definition at line 361 of file SoLazyElement.h.

◆ getDefaultSpecular()

static SbColor SoLazyElement::getDefaultSpecular ( )
inlinestatic

Specify Open Inventor defaults for colors, etc.

Definition at line 349 of file SoLazyElement.h.

◆ getDefaultTransparency()

static float SoLazyElement::getDefaultTransparency ( )
inlinestatic

Specify Open Inventor defaults for colors, etc.

Definition at line 377 of file SoLazyElement.h.

◆ getDiffuse()

static SbColor SoLazyElement::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. If there is a cache, the appropriate virtual registerGetDependence is called.

◆ getEmissive()

static SbColor SoLazyElement::getEmissive ( SoState )
static

◆ getInstance()

static SoLazyElement * SoLazyElement::getInstance ( SoState state)
inlinestatic

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.

Definition at line 324 of file SoLazyElement.h.

◆ getLightModel()

static int32_t SoLazyElement::getLightModel ( SoState )
static

◆ getNumColorIndices()

int32_t SoLazyElement::getNumColorIndices ( ) const
inline

Method to inquire about current colors.

Definition at line 300 of file SoLazyElement.h.

◆ getNumDiffuse()

int32_t SoLazyElement::getNumDiffuse ( ) const
inline

Method to inquire about current colors.

Definition at line 288 of file SoLazyElement.h.

◆ getNumTransparencies()

int32_t SoLazyElement::getNumTransparencies ( ) const
inline

Method to inquire about current colors.

Definition at line 294 of file SoLazyElement.h.

◆ getPackedColors()

static const uint32_t * SoLazyElement::getPackedColors ( SoState state)
static

◆ getShininess()

static float SoLazyElement::getShininess ( SoState )
static

◆ getSmoothing()

static SbBool SoLazyElement::getSmoothing ( SoState )
static

◆ getSpecular()

static SbColor SoLazyElement::getSpecular ( SoState )
static

◆ getTransparency()

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.

◆ isPacked()

SbBool SoLazyElement::isPacked ( ) const
inline

Method to inquire about current colors.

Definition at line 306 of file SoLazyElement.h.

◆ isTransparent()

SbBool SoLazyElement::isTransparent ( ) const

Method to inquire about current colors.

◆ print()

virtual void SoLazyElement::print ( FILE *  fp) const
virtual

Prints element (for debugging).

Reimplemented from SoElement.

◆ push()

virtual void SoLazyElement::push ( SoState state)
virtual

push (for non-GL elements)

Reimplemented from SoElement.

Reimplemented in SoGLLazyElement.

◆ setAmbient() [1/2]

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

◆ setAmbient() [2/2]

static SoDEPRECATED void SoLazyElement::setAmbient ( SoState state,
SoNode node,
const SbColor color 
)
inlinestatic

Definition at line 226 of file SoLazyElement.h.

◆ setBlending()

static void SoLazyElement::setBlending ( SoState state,
SbBool  value 
)
static

◆ setColorIndices()

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

Static set method.

◆ setColorMaterial()

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

◆ setDiffuse()

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

Static set method.

◆ setEmissive() [1/2]

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

◆ setEmissive() [2/2]

static SoDEPRECATED void SoLazyElement::setEmissive ( SoState state,
SoNode node,
const SbColor color 
)
inlinestatic

Definition at line 232 of file SoLazyElement.h.

◆ setLightModel()

static void SoLazyElement::setLightModel ( SoState state,
const int32_t  model 
)
static

◆ setPacked()

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

Static set method.

◆ setShininess()

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

◆ setSmoothing()

static void SoLazyElement::setSmoothing ( SoState state,
SbBool  value 
)
static

◆ setSpecular() [1/2]

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

◆ setSpecular() [2/2]

static SoDEPRECATED void SoLazyElement::setSpecular ( SoState state,
SoNode node,
const SbColor color 
)
inlinestatic

Definition at line 238 of file SoLazyElement.h.

◆ setTransparency()

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

Static set method.


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