Coin  4.0.3
Coin3D core library
Loading...
Searching...
No Matches
SoGLLazyElement Class Reference

The SoGLLazyElement class is meant to optimize GL rendering. More...

#include <Inventor/elements/SoGLLazyElement.h>

Inheritance diagram for SoGLLazyElement:
SoLazyElement SoElement

Classes

struct  GLState
 

Public Member Functions

virtual void disableBlendingElt (void)
 
virtual void enableBlendingElt (int sfactor, int dfactor, int alpha_sfactor, int alpha_dfactor)
 
virtual void init (SoState *state)
 
virtual void pop (SoState *state, const SoElement *prevtopelement)
 
virtual void push (SoState *state)
 
void reset (SoState *state, uint32_t bitmask) const
 
void send (const SoState *state, uint32_t mask) const
 FIXME: write doc.
 
void sendDiffuseByIndex (const int index) const
 FIXME: write doc.
 
void sendVPPacked (SoState *state, const unsigned char *pcolor)
 FIXME: write doc.
 
virtual void setAlphaTestElt (int func, float value)
 
virtual void setAmbientElt (const SbColor *color)
 
virtual void setBackfaceCullingElt (SbBool onoff)
 
virtual void setColorIndexElt (SoNode *node, int32_t numindices, const int32_t *indices)
 
virtual void setColorMaterialElt (SbBool value)
 
virtual void setDiffuseElt (SoNode *, int32_t numcolors, const SbColor *colors, SoColorPacker *packer)
 
virtual void setEmissiveElt (const SbColor *color)
 
virtual void setLightModelElt (SoState *state, int32_t model)
 
virtual void setMaterialElt (SoNode *node, uint32_t bitmask, SoColorPacker *packer, const SbColor *diffuse, const int numdiffuse, const float *transp, const int numtransp, const SbColor &ambient, const SbColor &emissive, const SbColor &specular, const float shininess, const SbBool istransparent)
 
virtual void setPackedElt (SoNode *node, int32_t numcolors, const uint32_t *colors, const SbBool packedtransparency)
 
virtual void setShadeModelElt (SbBool flatshading)
 
virtual void setShininessElt (float value)
 
virtual void setSpecularElt (const SbColor *color)
 
virtual void setTranspElt (SoNode *node, int32_t numtransp, const float *transp, SoColorPacker *packer)
 
virtual void setTranspTypeElt (int32_t type)
 
virtual void setTwosideLightingElt (SbBool onoff)
 
virtual void setVertexOrderingElt (VertexOrdering ordering)
 
void updateColorVBO (SoVBO *vbo)
 
- Public Member Functions inherited from SoLazyElement
virtual SoElementcopyMatchInfo (void) const
 
const int32_t * getColorIndexPointer (void) const
 
const SbColorgetDiffusePointer (void) const
 
int32_t getNumColorIndices (void) const
 
int32_t getNumDiffuse (void) const
 
int32_t getNumTransparencies (void) const
 
const uint32_t * getPackedPointer (void) const
 
const float * getTransparencyPointer (void) const
 
SbBool isPacked (void) const
 
SbBool isTransparent (void) const
 
virtual SbBool matches (const SoElement *) const
 
- Public Member Functions inherited from SoElement
virtual ~SoElement ()
 
int getDepth (void) const
 
int getStackIndex (void) const
 
const SoType getTypeId (void) const
 
virtual void print (FILE *file=stdout) const
 
void setDepth (const int depth)
 

Static Public Member Functions

static void beginCaching (SoState *state, SoGLLazyElement::GLState *prestate, SoGLLazyElement::GLState *poststate)
 
static voidcreateInstance (void)
 
static void endCaching (SoState *state)
 
static int getClassStackIndex (void)
 
static SoType getClassTypeId (void)
 
static SoGLLazyElementgetInstance (const SoState *state)
 FIXME: write doc.
 
static void initClass ()
 
static SbBool isColorIndex (SoState *state)
 FIXME: write doc.
 
static void mergeCacheInfo (SoState *state, SoGLLazyElement::GLState *childprestate, SoGLLazyElement::GLState *childpoststate)
 
static void postCacheCall (const SoState *state, const SoGLLazyElement::GLState *poststate)
 
static SbBool preCacheCall (const SoState *state, const SoGLLazyElement::GLState *prestate)
 
static void sendAllMaterial (SoState *state)
 FIXME: write doc.
 
static void sendBackfaceCulling (SoState *state, const SbBool onoff)
 
static void sendFlatshading (SoState *state, const SbBool onoff)
 
static void sendLightModel (SoState *state, const int32_t model)
 
static void sendNoMaterial (SoState *state)
 FIXME: write doc.
 
static void sendOnlyDiffuseColor (SoState *state)
 FIXME: write doc.
 
static void sendPackedDiffuse (SoState *state, const uint32_t diffuse)
 
static void sendTwosideLighting (SoState *state, const SbBool onoff)
 
static void sendVertexOrdering (SoState *state, const VertexOrdering ordering)
 
- Static Public Member Functions inherited from SoLazyElement
static voidcreateInstance (void)
 
static void disableBlending (SoState *state)
 
static void enableBlending (SoState *state, int sfactor, int dfactor)
 
static void enableSeparateBlending (SoState *state, int sfactor, int dfactor, int alpha_sfactor, int alpha_dfactor)
 
static SbBool getAlphaBlending (SoState *, int &sfactor, int &dfactor)
 
static int getAlphaTest (SoState *state, float &value)
 
static const SbColorgetAmbient (SoState *)
 
static SbBool getBlending (SoState *, int &sfactor, int &dfactor)
 
static int getClassStackIndex (void)
 
static SoType getClassTypeId (void)
 
static int32_t getColorIndex (SoState *, int num)
 
static const int32_t * getColorIndices (SoState *)
 
static SbBool getColorMaterial (SoState *)
 
static SbColor getDefaultAmbient (void)
 
static float getDefaultAmbientIntensity (void)
 
static int32_t getDefaultColorIndex (void)
 
static SbColor getDefaultDiffuse (void)
 
static SbColor getDefaultEmissive (void)
 
static int32_t getDefaultLightModel (void)
 
static uint32_t getDefaultPacked (void)
 
static float getDefaultShininess (void)
 
static SbColor getDefaultSpecular (void)
 
static float getDefaultTransparency (void)
 
static const SbColorgetDiffuse (SoState *state, int index)
 
static const SbColorgetEmissive (SoState *)
 
static SoLazyElementgetInstance (SoState *state)
 
static int32_t getLightModel (SoState *)
 
static const uint32_t * getPackedColors (SoState *)
 
static float getShininess (SoState *)
 
static const SbColorgetSpecular (SoState *)
 
static float getTransparency (SoState *, int index)
 
static SbBool getTwoSidedLighting (SoState *state)
 
static SoLazyElementgetWInstance (SoState *state)
 
static void initClass ()
 
static void setAlphaTest (SoState *state, int func, float value)
 
static void setAmbient (SoState *state, const SbColor *color)
 
static void setBackfaceCulling (SoState *state, SbBool onoff)
 
static void setColorIndices (SoState *state, SoNode *node, int32_t numindices, const int32_t *indices)
 
static void setColorMaterial (SoState *state, SbBool value)
 
static void setDiffuse (SoState *state, SoNode *node, int32_t numcolors, const SbColor *colors, SoColorPacker *packer)
 
static void setEmissive (SoState *state, const SbColor *color)
 
static void setLightModel (SoState *state, const int32_t model)
 
static void setMaterials (SoState *state, SoNode *node, uint32_t bitmask, SoColorPacker *cPacker, const SbColor *diffuse, const int numdiffuse, const float *transp, const int numtransp, const SbColor &ambient, const SbColor &emissive, const SbColor &specular, const float shininess, const SbBool istransparent)
 
static void setPacked (SoState *state, SoNode *node, int32_t numcolors, const uint32_t *colors, const SbBool packedtransparency=FALSE)
 
static void setShadeModel (SoState *state, SbBool flatshading)
 
static void setShininess (SoState *state, float value)
 
static void setSpecular (SoState *state, const SbColor *color)
 
static void setToDefault (SoState *state)
 
static void setTransparency (SoState *state, SoNode *node, int32_t numvalues, const float *transparency, SoColorPacker *packer)
 
static void setTransparencyType (SoState *state, int32_t type)
 
static void setTwosideLighting (SoState *state, SbBool onoff)
 
static void setVertexOrdering (SoState *state, VertexOrdering ordering)
 
- Static Public Member Functions inherited from SoElement
static int getClassStackIndex (void)
 
static SoType getClassTypeId (void)
 
static SoType getIdFromStackIndex (const int stackIndex)
 
static int getNumStackIndices (void)
 
static void initClass (void)
 
static void initElements (void)
 

Protected Member Functions

 ~SoGLLazyElement ()
 
virtual void lazyDidntSet (uint32_t mask)
 
virtual void lazyDidSet (uint32_t mask)
 
- Protected Member Functions inherited from SoLazyElement
 ~SoLazyElement ()
 
- Protected Member Functions inherited from SoElement
 SoElement (void)
 
void capture (SoState *const state) const
 
virtual void captureThis (SoState *state) const
 
SoElementgetNextFree (void) const
 
SoElementgetNextInStack (void) const
 
void setStackIndex (const int index)
 
void setTypeId (const SoType typeId)
 

Additional Inherited Members

- Public Types inherited from SoLazyElement
enum  cases {
  LIGHT_MODEL_CASE = 0 , COLOR_MATERIAL_CASE , DIFFUSE_CASE , AMBIENT_CASE ,
  EMISSIVE_CASE , SPECULAR_CASE , SHININESS_CASE , BLENDING_CASE ,
  TRANSPARENCY_CASE , VERTEXORDERING_CASE , TWOSIDE_CASE , CULLING_CASE ,
  SHADE_MODEL_CASE , ALPHATEST_CASE , GLIMAGE_CASE , LAZYCASES_LAST
}
 
enum  internalMasks {
  OTHER_COLOR_MASK = AMBIENT_MASK|EMISSIVE_MASK|SPECULAR_MASK|SHININESS_MASK , ALL_COLOR_MASK = OTHER_COLOR_MASK|DIFFUSE_MASK , NO_COLOR_MASK = ALL_MASK & (~ALL_COLOR_MASK) , ALL_BUT_DIFFUSE_MASK = ALL_MASK &(~ DIFFUSE_MASK) ,
  DIFFUSE_ONLY_MASK = ALL_MASK &(~ OTHER_COLOR_MASK)
}
 
enum  LightModel { BASE_COLOR , PHONG }
 
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 , VERTEXORDERING_MASK = 1 << VERTEXORDERING_CASE , TWOSIDE_MASK = 1 << TWOSIDE_CASE , CULLING_MASK = 1 << CULLING_CASE ,
  SHADE_MODEL_MASK = 1 << SHADE_MODEL_CASE , ALPHATEST_MASK = 1 << ALPHATEST_CASE , GLIMAGE_MASK = 1 << GLIMAGE_CASE , ALL_MASK = (1 << LAZYCASES_LAST)-1
}
 
enum  VertexOrdering { CW , CCW }
 
- Static Protected Member Functions inherited from SoElement
static int createStackIndex (const SoType id)
 
static const SoElementgetConstElement (SoState *const state, const int stackIndex)
 
static SoElementgetElement (SoState *const state, const int stackIndex)
 
- Protected Attributes inherited from SoLazyElement
struct SoLazyElement::CoinState coinstate
 
- Protected Attributes inherited from SoElement
int depth
 
int stackIndex
 
SoType typeId
 
- Static Protected Attributes inherited from SoElement
static int classStackIndex
 
static SoTypeListstackToType
 

Detailed Description

The SoGLLazyElement class is meant to optimize GL rendering.

This is just a wrap-around implementation for compatibility. It should (hopefully) work in the same way as the Inventor class though.

Constructor & Destructor Documentation

◆ ~SoGLLazyElement()

SoGLLazyElement::~SoGLLazyElement ( )
protected

Destructor.

Member Function Documentation

◆ createInstance()

void * SoGLLazyElement::createInstance ( void )
static

This API member is considered internal to the library, as it is not likely to be of interest to the application programmer.

Creates a new instance of the class type corresponding to the SoType object.

◆ disableBlendingElt()

void SoGLLazyElement::disableBlendingElt ( void )
virtual

Reimplemented from SoLazyElement.

◆ enableBlendingElt()

void SoGLLazyElement::enableBlendingElt ( int sfactor,
int dfactor,
int alpha_sfactor,
int alpha_dfactor )
virtual

Reimplemented from SoLazyElement.

◆ getClassStackIndex()

int SoGLLazyElement::getClassStackIndex ( void )
static

This static method returns the state stack index for the class.

◆ getClassTypeId()

SoType SoGLLazyElement::getClassTypeId ( void )
static

This static method returns the SoType object associated with objects of this class.

◆ init()

void SoGLLazyElement::init ( SoState * state)
virtual

This function initializes the element type in the given SoState. It is called for the first element of each enabled element type in SoState objects.

Reimplemented from SoLazyElement.

◆ initClass()

void SoGLLazyElement::initClass ( void )
static

Initialize relevant common data for all instances, like the type system.

◆ lazyDidntSet()

void SoGLLazyElement::lazyDidntSet ( uint32_t mask)
protectedvirtual

Reimplemented from SoLazyElement.

◆ lazyDidSet()

void SoGLLazyElement::lazyDidSet ( uint32_t mask)
protectedvirtual

Reimplemented from SoLazyElement.

◆ mergeCacheInfo()

void SoGLLazyElement::mergeCacheInfo ( SoState * state,
SoGLLazyElement::GLState * childprestate,
SoGLLazyElement::GLState * childpoststate )
static

Merge cache info from a child cache (when doing nested caching) into the current cache.

◆ pop()

void SoGLLazyElement::pop ( SoState * state,
const SoElement * prevTopElement )
virtual

This method is called when the state is popped, and the depth of the element is bigger than the current state depth. pop() is called on the new top of stack, and a pointer to the previous top of stack is passed in prevTopElement.

Override this method if you need to copy some state information from the previous top of stack.

Reimplemented from SoElement.

◆ push()

void SoGLLazyElement::push ( SoState * state)
virtual

This method is called every time a new element is required in one of the stacks. This happens when a writable element is requested, using SoState::getElement() or indirectly SoElement::getElement(), and the depth of the current element is less than the state depth.

Override this method if your element needs to copy data from the previous top of stack. The push() method is called on the new element, and the previous element can be found using SoElement::getNextInStack().

Reimplemented from SoLazyElement.

◆ reset()

void SoGLLazyElement::reset ( SoState * stateptr,
uint32_t mask ) const

Reset element GL state (set state to invalid). Use this method to notify this element when you use your own GL code that changes the OpenGL state.

◆ setAlphaTestElt()

void SoGLLazyElement::setAlphaTestElt ( int func,
float value )
virtual

Reimplemented from SoLazyElement.

◆ setAmbientElt()

void SoGLLazyElement::setAmbientElt ( const SbColor * color)
virtual

Reimplemented from SoLazyElement.

◆ setBackfaceCullingElt()

void SoGLLazyElement::setBackfaceCullingElt ( SbBool onoff)
virtual

Reimplemented from SoLazyElement.

◆ setColorIndexElt()

void SoGLLazyElement::setColorIndexElt ( SoNode * node,
int32_t numindices,
const int32_t * indices )
virtual

Reimplemented from SoLazyElement.

◆ setColorMaterialElt()

void SoGLLazyElement::setColorMaterialElt ( SbBool value)
virtual

Reimplemented from SoLazyElement.

◆ setDiffuseElt()

void SoGLLazyElement::setDiffuseElt ( SoNode * node,
int32_t numcolors,
const SbColor * colors,
SoColorPacker * packer )
virtual

Reimplemented from SoLazyElement.

◆ setEmissiveElt()

void SoGLLazyElement::setEmissiveElt ( const SbColor * color)
virtual

Reimplemented from SoLazyElement.

◆ setLightModelElt()

void SoGLLazyElement::setLightModelElt ( SoState * state,
int32_t model )
virtual

Reimplemented from SoLazyElement.

◆ setMaterialElt()

void SoGLLazyElement::setMaterialElt ( SoNode * node,
uint32_t bitmask,
SoColorPacker * packer,
const SbColor * diffuse,
const int numdiffuse,
const float * transp,
const int numtransp,
const SbColor & ambient,
const SbColor & emissive,
const SbColor & specular,
const float shininess,
const SbBool istransparent )
virtual

Reimplemented from SoLazyElement.

◆ setPackedElt()

void SoGLLazyElement::setPackedElt ( SoNode * node,
int32_t numcolors,
const uint32_t * colors,
const SbBool packedtransparency )
virtual

Reimplemented from SoLazyElement.

◆ setShadeModelElt()

void SoGLLazyElement::setShadeModelElt ( SbBool flatshading)
virtual

Reimplemented from SoLazyElement.

◆ setShininessElt()

void SoGLLazyElement::setShininessElt ( float value)
virtual

Reimplemented from SoLazyElement.

◆ setSpecularElt()

void SoGLLazyElement::setSpecularElt ( const SbColor * color)
virtual

Reimplemented from SoLazyElement.

◆ setTranspElt()

void SoGLLazyElement::setTranspElt ( SoNode * node,
int32_t numtransp,
const float * transp,
SoColorPacker * packer )
virtual

Reimplemented from SoLazyElement.

◆ setTranspTypeElt()

void SoGLLazyElement::setTranspTypeElt ( int32_t type)
virtual

Reimplemented from SoLazyElement.

◆ setTwosideLightingElt()

void SoGLLazyElement::setTwosideLightingElt ( SbBool onoff)
virtual

Reimplemented from SoLazyElement.

◆ setVertexOrderingElt()

void SoGLLazyElement::setVertexOrderingElt ( VertexOrdering ordering)
virtual

Reimplemented from SoLazyElement.


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