00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028
00029
00030
00031
00032
00033
00034
00035
00036
00037
00038
00039
00040
00041
00042
00043
00044
00045
00046
00047
00048
00049
00050 #ifndef _SO_VRMLVERTEX_LINE_
00051 #define _SO_VRMLVERTEX_LINE_
00052
00053 #include <Inventor/SbBasic.h>
00054
00055 #include <Inventor/fields/SoMFUInt32.h>
00056 #include <Inventor/fields/SoSFNode.h>
00057 #include <Inventor/fields/SoSFBool.h>
00058
00059 #include <Inventor/nodes/SoMaterialBinding.h>
00060 #include <Inventor/nodes/SoTextureCoordinateBinding.h>
00061 #include <Inventor/VRMLnodes/SoVRMLGeometry.h>
00062 #include <Inventor/elements/SoShapeStyleElement.h>
00063 #include <Inventor/elements/SoMaterialBindingElement.h>
00064
00065
00066
00067 #if defined(OIV_IGNORE_VRML_DEPRECATED)
00068 #include <SoDeprecationRules.h>
00069 #pragma push_macro("SoDEPRECATED_CLASS")
00070 #pragma push_macro("SoDEPRECATED_TYPEDEF")
00071 #undef SoDEPRECATED_CLASS
00072 #undef SoDEPRECATED_TYPEDEF
00073 #define SoDEPRECATED_CLASS(x,y)
00074 #define SoDEPRECATED_TYPEDEF(x,y)
00075 #endif
00076
00077 #ifndef HIDDEN_FROM_DOC
00078 class SoVRMLVertexLine;
00079
00080 typedef SoDEPRECATED WINGDIAPI void APIENTRY SoVPCacheFunc(const char *const);
00081
00085 SoVRMLLinePropertyCache {
00086 public:
00087
00088
00089
00090 SbBool mightNeedSomethingFromState(const SoShapeStyleElement *sse) const
00091 { return needFromState & sse->getRenderCaseMask(); }
00092
00093 void fillInCache(SoNode *, SoNode *, SoNode *,
00094 const int32_t *, const int32_t *,
00095 SbBool , SoState *);
00096
00097 int getRenderCase(const SoShapeStyleElement *sse) const
00098 { return renderCase & sse->getRenderCaseMask(); }
00099
00100 void sendVertex(const char *vp) const
00101 { (*vertexFunc)(vp); }
00102 void sendColor(const char *cp) const
00103 { (*colorFunc)(cp); }
00104
00105 int getNumVertices() const { return numVerts; }
00106 int getNumColors() const { return numColors; }
00107
00108 const char *getVertices(int i) const
00109 { return vertexPtr + vertexStride*i; }
00110 const char *getColors(int i) const
00111 { return colorPtr + colorStride*i; }
00112
00113 SbBool colorIsInVtxProp() const {return colorIsInVP;}
00114
00115
00116 SbBool transpIsInVtxProp() const {return transpIsInVP;}
00117
00118 void setTranspIsInVP(SbBool flag){ transpIsInVP = flag;}
00119
00120 int getVertexStride() const { return vertexStride; }
00121 int getColorStride() const { return colorStride; }
00122
00123
00124 SoMaterialBindingElement::Binding getMaterialBinding()
00125 { return (SoMaterialBindingElement::Binding)materialBinding; }
00126
00127
00128 void invalidate() { needFromState = ALL_FROM_STATE_BITS; }
00129
00130
00131 SoVRMLLinePropertyCache();
00132
00133 public:
00134
00135
00136 SoVPCacheFunc *vertexFunc;
00137 const char *vertexPtr;
00138 int vertexStride, numVerts;
00139 SoVPCacheFunc *colorFunc;
00140 const char *colorPtr;
00141 int colorStride, numColors;
00142
00143 unsigned char needFromState;
00144
00145
00146
00147
00148
00149
00150
00151
00152
00153
00154
00155
00156
00157
00158 private:
00159 enum {
00160 COLOR_BITS = 0x18,
00161 PART_COLOR = 0x8,
00162 FACE_COLOR = 0x10,
00163 VERTEX_COLOR = 0x18,
00164
00165 NORMAL_BITS = 0x6,
00166 PART_NORMAL = 0x2,
00167 FACE_NORMAL = 0x4,
00168 VERTEX_NORMAL = 0x6,
00169
00170 TEXCOORD_BIT = 0x1
00171 };
00172
00173
00174
00175
00176 enum {
00177 OVERRIDE_FROM_STATE_BIT = 0x40,
00178 COORD_FROM_STATE_BIT = 0x20,
00179 COLOR_FROM_STATE_BITS = COLOR_BITS,
00180 NORMAL_FROM_STATE_BITS = NORMAL_BITS,
00181 TEXCOORD_FROM_STATE_BIT = TEXCOORD_BIT,
00182 ALL_FROM_STATE_BITS = 0x7F
00183 };
00184 private:
00185
00186
00187
00188
00189
00190
00191
00192
00193
00194
00195
00196
00197
00198
00199
00200 unsigned char materialBinding;
00201 unsigned char renderCase;
00202 unsigned char colorIsInVP;
00203 SbBool transpIsInVP;
00204 };
00205
00206
00207 #endif // HIDDEN_FROM_DOC
00209 //
00210
00211
00212
00213
00214
00215
00216
00218
00219 class SoState;
00220 class SoVRMLLinePropertyCache;
00221 class SoDEPRECATED SoVRMLVertexLine : public SoVRMLGeometry {
00257
00258 SO_NODE_ABSTRACT_HEADER(SoVRMLVertexLine);
00259
00260 public:
00265 SoSFNode coord;
00271 SoSFNode color;
00277 SoSFBool colorPerVertex;
00278
00279
00280 private:
00281
00282 static void initClass();
00283 static void exitClass();
00284 virtual void doAction(SoAction *action);
00285 virtual void GLRender(SoGLRenderAction *action);
00286 virtual void search(SoSearchAction *action);
00287 virtual void getBoundingBox(SoGetBoundingBoxAction *action);
00288 virtual void callback(SoCallbackAction *action);
00289 virtual void pick(SoPickAction *action);
00290
00291 virtual SoChildList *getChildren() const;
00292
00293 virtual SbBool validateNewFieldValue(SoField *pField,
00294 void *newValue);
00295
00296
00297 virtual void notify(SoNotList *list);
00298
00299
00300
00301 virtual void copyContents(const SoFieldContainer *fromFC,
00302 SbBool copyConnections);
00303
00304 private:
00305 #if 0
00306 enum Binding {
00307 OVERALL = SoMaterialBindingElement::OVERALL,
00308 PER_PART = SoMaterialBindingElement::PER_PART,
00309 PER_PART_INDEXED = SoMaterialBindingElement::PER_PART_INDEXED,
00310 PER_FACE = SoMaterialBindingElement::PER_FACE,
00311 PER_FACE_INDEXED = SoMaterialBindingElement::PER_FACE_INDEXED,
00312 PER_VERTEX = SoMaterialBindingElement::PER_VERTEX,
00313 PER_VERTEX_INDEXED = SoMaterialBindingElement::PER_VERTEX_INDEXED
00314 };
00315 #endif
00316
00317 SoVRMLVertexLine();
00318
00319 virtual ~SoVRMLVertexLine();
00320
00321
00322
00323
00324 virtual SbBool shouldGLRender(SoGLRenderAction *action,
00325 SbBool isPointsOrLines);
00326
00327
00328
00329 SoVRMLLinePropertyCache vpCache;
00330
00331
00332
00333 SoChildList *children;
00334 friend class SoPath;
00335
00336
00337 SbThreadRWMutex *vpCacheMutex;
00338
00339 private:
00340 void rebuildChildrenList();
00341
00342 private:
00343 SoMFUInt32 orderedrgba;
00344 unsigned char materialBinding;
00345
00346 };
00347
00348
00349
00350 #if defined(OIV_IGNORE_VRML_DEPRECATED)
00351 #pragma pop_macro("SoDEPRECATED_TYPEDEF")
00352 #pragma pop_macro("SoDEPRECATED_CLASS")
00353 #endif
00354
00355 #endif
00356