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_VRMLGRID_SHAPE_
00051 #define _SO_VRMLGRID_SHAPE_
00052
00053 #include <Inventor/fields/SoSFInt32.h>
00054 #include <Inventor/fields/SoMFFloat.h>
00055 #include <Inventor/fields/SoSFFloat.h>
00056 #include <Inventor/fields/SoMFUInt32.h>
00057 #include <Inventor/fields/SoSFNode.h>
00058 #include <Inventor/fields/SoSFBool.h>
00059 #include <Inventor/nodes/SoNode.h>
00060 #include <Inventor/nodes/SoNormalBinding.h>
00061 #include <Inventor/nodes/SoMaterialBinding.h>
00062 #include <Inventor/nodes/SoTextureCoordinateBinding.h>
00063 #include <Inventor/VRMLnodes/SoVRMLGeometry.h>
00064 #include <Inventor/VRMLnodes/SoVRMLCoordinate.h>
00065 #include <Inventor/elements/SoShapeStyleElement.h>
00066 #include <Inventor/elements/SoMaterialBindingElement.h>
00067 #include <Inventor/elements/SoNormalBindingElement.h>
00068 #include <Inventor/threads/SbThreadRWMutex.h>
00069
00070
00071 #if defined(OIV_IGNORE_VRML_DEPRECATED)
00072 #include <SoDeprecationRules.h>
00073 #pragma push_macro("SoDEPRECATED_CLASS")
00074 #pragma push_macro("SoDEPRECATED_TYPEDEF")
00075 #undef SoDEPRECATED_CLASS
00076 #undef SoDEPRECATED_TYPEDEF
00077 #define SoDEPRECATED_CLASS(x,y)
00078 #define SoDEPRECATED_TYPEDEF(x,y)
00079 #endif
00080
00082
00083
00084
00085
00086
00087
00088
00089
00091
00092 class SoNormalBundle;
00093 class SoNormalCache;
00094 class SoState;
00095 class SoDEPRECATED SoVRMLGridShape : public SoVRMLGeometry {
00136
00137 SO_NODE_ABSTRACT_HEADER(SoVRMLGridShape);
00138
00139 public:
00144 SoSFInt32 zDimension;
00149 SoSFInt32 xDimension;
00154 SoSFFloat zSpacing;
00159 SoSFFloat xSpacing;
00165 SoMFFloat height;
00170 SoSFNode texCoord;
00176 SoSFNode normal;
00182 SoSFNode color;
00188 SoSFBool colorPerVertex;
00194 SoSFBool normalPerVertex;
00195
00196 private:
00197
00198 enum Binding {
00199 OVERALL = SoMaterialBindingElement::OVERALL,
00200 PER_PART = SoMaterialBindingElement::PER_PART,
00201 PER_PART_INDEXED = SoMaterialBindingElement::PER_PART_INDEXED,
00202 PER_FACE = SoMaterialBindingElement::PER_FACE,
00203 PER_FACE_INDEXED = SoMaterialBindingElement::PER_FACE_INDEXED,
00204 PER_VERTEX = SoMaterialBindingElement::PER_VERTEX,
00205 PER_VERTEX_INDEXED = SoMaterialBindingElement::PER_VERTEX_INDEXED
00206 };
00207
00208
00209
00210
00211 virtual SbBool generateDefaultNormals(SoState *state,
00212 SoNormalBundle *nb);
00213
00214 private:
00215 SoMFUInt32 orderedrgba;
00216 unsigned char normalBinding;
00217 unsigned char materialBinding;
00218 SoVRMLCoordinate *myCoord;
00219 static void initClass();
00220 static void exitClass();
00221 virtual void doAction(SoAction *action);
00222 virtual void search(SoSearchAction *action);
00223
00224 virtual void getBoundingBox(SoGetBoundingBoxAction *action);
00225 virtual void callback(SoCallbackAction *action);
00226 virtual void pick(SoPickAction *action);
00227
00228 virtual SoChildList *getChildren() const;
00229
00230 virtual SbBool validateNewFieldValue(SoField *pField,
00231 void *newValue);
00232
00233
00234 virtual void notify(SoNotList *list);
00235
00236
00237
00238 virtual void copyContents(const SoFieldContainer *fromFC,
00239 SbBool copyConnections);
00240
00241 private:
00242
00243 SoVRMLGridShape();
00244
00245 virtual ~SoVRMLGridShape();
00246
00247
00248
00249
00250 virtual SbBool shouldGLRender(SoGLRenderAction *action,
00251 SbBool isPointsOrLines);
00252
00253
00254
00255 SoVRMLVertexPropertyCache vpCache;
00256
00257
00258
00259 void setNormalCache(SoState *state,
00260 int numNormals,
00261 const SbVec3f *normals,
00262 const SoNormalBindingElement::Binding binding
00263 );
00264
00265
00266 SoNormalCache *getNormalCache() const { return normalCache; }
00267
00268
00269
00270 SoChildList *children;
00271 friend class SoPath;
00272
00273
00274 SbThreadRWMutex *normalCacheMutex;
00275
00276 private:
00277 void rebuildChildrenList();
00278
00279
00280 SoNormalCache *normalCache;
00281
00282 };
00283
00284
00285
00286 #if defined(OIV_IGNORE_VRML_DEPRECATED)
00287 #pragma pop_macro("SoDEPRECATED_TYPEDEF")
00288 #pragma pop_macro("SoDEPRECATED_CLASS")
00289 #endif
00290
00291 #endif
00292