1 #ifndef COIN_SOGLLAZYELEMENT_H 2 #define COIN_SOGLLAZYELEMENT_H 36 #include <Inventor/elements/SoLazyElement.h> 37 #include <Inventor/C/glue/gl.h> 40 class SoGLLazyElementP;
58 static void sendAllMaterial(
SoState * state);
59 static void sendNoMaterial(
SoState * state);
60 static void sendOnlyDiffuseColor(
SoState * state);
61 static void sendLightModel(
SoState * state,
const int32_t model);
62 static void sendPackedDiffuse(
SoState * state,
const uint32_t diffuse);
63 static void sendFlatshading(
SoState * state,
const SbBool onoff);
64 static void sendVertexOrdering(
SoState * state,
const VertexOrdering ordering);
65 static void sendTwosideLighting(
SoState * state,
const SbBool onoff);
66 static void sendBackfaceCulling(
SoState * state,
const SbBool onoff);
68 void sendDiffuseByIndex(
const int index)
const;
69 static SbBool isColorIndex(
SoState *state);
71 void send(
const SoState *state, uint32_t mask)
const;
73 void sendVPPacked(
SoState* state,
const unsigned char* pcolor);
75 void reset(
SoState* state, uint32_t bitmask)
const;
77 typedef struct COIN_DLL_API {
78 uint32_t cachebitmask;
86 int32_t blend_sfactor;
87 int32_t blend_dfactor;
88 int32_t alpha_blend_sfactor;
89 int32_t alpha_blend_dfactor;
91 int32_t vertexordering;
95 int32_t alphatestfunc;
97 uint32_t diffusenodeid;
98 uint32_t transpnodeid;
102 virtual void setDiffuseElt(
SoNode*, int32_t numcolors,
103 const SbColor * colors, SoColorPacker * packer);
104 virtual void setPackedElt(
SoNode * node, int32_t numcolors,
105 const uint32_t * colors,
const SbBool packedtransparency);
106 virtual void setColorIndexElt(
SoNode * node, int32_t numindices,
107 const int32_t * indices);
108 virtual void setTranspElt(
SoNode * node, int32_t numtransp,
109 const float * transp, SoColorPacker * packer);
111 virtual void setTranspTypeElt(int32_t type);
112 virtual void setAmbientElt(
const SbColor* color);
113 virtual void setEmissiveElt(
const SbColor* color);
114 virtual void setSpecularElt(
const SbColor* color);
115 virtual void setShininessElt(
float value);
116 virtual void setColorMaterialElt(SbBool value);
117 virtual void enableBlendingElt(
int sfactor,
int dfactor,
int alpha_sfactor,
int alpha_dfactor);
118 virtual void disableBlendingElt(
void);
119 virtual void setLightModelElt(
SoState *state, int32_t model);
120 virtual void setMaterialElt(
SoNode * node, uint32_t bitmask,
121 SoColorPacker * packer,
122 const SbColor * diffuse,
const int numdiffuse,
123 const float * transp,
const int numtransp,
127 const float shininess,
128 const SbBool istransparent);
129 virtual void setVertexOrderingElt(VertexOrdering ordering);
130 virtual void setBackfaceCullingElt(SbBool onoff);
131 virtual void setTwosideLightingElt(SbBool onoff);
132 virtual void setShadeModelElt(SbBool flatshading);
133 virtual void setAlphaTestElt(
int func,
float value);
135 static void beginCaching(
SoState * state,
136 SoGLLazyElement::GLState * prestate,
137 SoGLLazyElement::GLState * poststate);
138 static void endCaching(
SoState * state);
140 static SbBool preCacheCall(
const SoState * state,
const SoGLLazyElement::GLState * prestate);
141 static void postCacheCall(
const SoState * state,
const SoGLLazyElement::GLState * poststate);
143 static void mergeCacheInfo(
SoState * state,
144 SoGLLazyElement::GLState * childprestate,
145 SoGLLazyElement::GLState * childpoststate);
147 void updateColorVBO(SoVBO * vbo);
150 virtual void lazyDidSet(uint32_t mask);
151 virtual void lazyDidntSet(uint32_t mask);
154 void sendPackedDiffuse(
const uint32_t diffuse)
const;
155 void sendAmbient(
const SbColor & color)
const;
156 void sendEmissive(
const SbColor & color)
const;
157 void sendSpecular(
const SbColor & specular)
const;
158 void sendShininess(
const float shininess)
const;
159 void sendTransparency(
const int stipplenum)
const;
160 void enableBlending(
const int sfactor,
const int dfactor)
const;
161 void enableSeparateBlending(
const cc_glglue * glue,
162 const int sfactor,
const int dfactor,
163 const int alpha_sfactor,
const int alpha_dfactor)
const;
164 void disableBlending(
void)
const;
166 void sendLightModel(
const int32_t model)
const;
167 void sendFlatshading(
const SbBool onoff)
const;
168 void sendVertexOrdering(
const VertexOrdering ordering)
const;
169 void sendTwosideLighting(
const SbBool onoff)
const;
170 void sendBackfaceCulling(
const SbBool onoff)
const;
171 void sendAlphaTest(
int func,
float value)
const;
173 void packColors(SoColorPacker * packer)
const;
175 mutable uint32_t didsetbitmask;
176 mutable uint32_t didntsetbitmask;
177 mutable uint32_t cachebitmask;
178 mutable uint32_t opencacheflags;
180 mutable GLState glstate;
181 GLState * postcachestate;
182 GLState * precachestate;
184 mutable SoColorPacker * colorpacker;
185 mutable const uint32_t * packedpointer;
188 SoGLLazyElementP * pimpl;
191 #endif // !COIN_SOGLLAZYELEMENT_H The SbColor class contains the red, green and blue components which make up a color value...
Definition: SbColor.h:39
The SoNode class is the base class for nodes used in scene graphs.Coin is a retained mode 3D visualiz...
Definition: SoNode.h:56
SoElement is the abstract base class for all elements.
Definition: SoElement.h:43
virtual void push(SoState *state)
Definition: SoLazyElement.cpp:196
The SoState class manages the Coin scenegraph traversal state data.The SoState class is used by actio...
Definition: SoState.h:44
The SoGLLazyElement class is meant to optimize GL rendering.This is just a wrap-around implementation...
Definition: SoGLLazyElement.h:43
static void initClass()
Definition: SoLazyElement.cpp:132
virtual void init(SoState *state)
Definition: SoLazyElement.cpp:161
The SoLazyElement class is used to handle material and shape properties.So[GL]LazyElement is...
Definition: SoLazyElement.h:48
The SoGLRenderCache class is used to cache OpenGL calls.
Definition: SoGLRenderCache.h:43
virtual void pop(SoState *state, const SoElement *prevTopElement)
Definition: SoElement.cpp:584