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
00051 #ifndef _SO_VRMLSHAPE_
00052 #define _SO_VRMLSHAPE_
00053
00054 #include <Inventor/fields/SoSFEnum.h>
00055 #include <Inventor/fields/SoSFNode.h>
00056 #include <Inventor/fields/SoSFBool.h>
00057 #include <Inventor/nodes/SoNode.h>
00058 #include <Inventor/fields/SoSFVec3f.h>
00059 #include <Inventor/VRMLnodes/SoVRMLNode.h>
00060 #include <Inventor/SbRenderCaching.h>
00061
00062
00063 #if defined(OIV_IGNORE_VRML_DEPRECATED)
00064 #include <SoDeprecationRules.h>
00065 #pragma push_macro("SoDEPRECATED_CLASS")
00066 #pragma push_macro("SoDEPRECATED_TYPEDEF")
00067 #undef SoDEPRECATED_CLASS
00068 #undef SoDEPRECATED_TYPEDEF
00069 #define SoDEPRECATED_CLASS(x,y)
00070 #define SoDEPRECATED_TYPEDEF(x,y)
00071 #endif
00072
00073 class SoBoundingBoxCache;
00074 class SoGLCacheList;
00075 class SoPrimitiveCountCache;
00076 class SoColorPacker;
00077 class SoChildList;
00078 class SoMFColor;
00079 class SoMFFloat;
00080
00082
00083
00084
00085
00087 class SoDEPRECATED SoVRMLShape : public SoVRMLNode {
00172
00173 SO_NODE_HEADER(SoVRMLShape);
00174
00175 public:
00177 enum CacheEnabled {
00181 OFF = SO_RENDERCACHING_OFF,
00185 ON = SO_RENDERCACHING_ON,
00189 AUTO = SO_RENDERCACHING_AUTO
00190 };
00191
00195 SoSFNode appearance;
00196
00200 SoSFNode geometry;
00201
00206 SoSFVec3f bboxCenter;
00207
00212 SoSFVec3f bboxSize;
00213
00224 SoSFEnum renderCaching;
00225
00236 SoSFEnum boundingBoxCaching;
00237
00241 SoVRMLShape();
00242
00243 #if 1 SoDEPRECATED
00249 static void setNumRenderCaches(int howMany);
00250 SoDEPRECATED
00255 static int getNumRenderCaches();
00256
00257
00258 #endif
00263 inline virtual void setOverride(const SbBool state)
00264 { override.setValue(state); }
00265
00269 inline virtual SbBool isOverride() const
00270 { return override.getValue(); }
00271
00272 private:
00273
00274
00275 virtual SbBool affectsState() const;
00276
00277
00278 virtual void doAction(SoAction *action);
00279 virtual void callback(SoCallbackAction *action);
00280 virtual void GLRender(SoGLRenderAction *action);
00281 virtual void getBoundingBox(SoGetBoundingBoxAction *action);
00282
00283
00284
00285 virtual void rayPick(SoRayPickAction *action);
00286 virtual void search(SoSearchAction *action);
00287 virtual void getPrimitiveCount(SoGetPrimitiveCountAction *action);
00288
00289
00290 private:
00291 virtual SoChildList *getChildren() const;
00292 virtual SoChildList *internalGetChildren() const;
00293
00294 static void initClass();
00295 static void exitClass();
00296
00297 SoSFBool override;
00298
00299 virtual SbBool validateNewFieldValue(SoField *pField,
00300 void *newValue);
00301 virtual void notify(SoNotList *list);
00302
00303
00304
00305 virtual void copyContents(const SoFieldContainer *fromFC,
00306 SbBool copyConnections);
00307 private:
00308 virtual ~SoVRMLShape();
00309 SoColorPacker *colorPacker;
00310
00311 SoBoundingBoxCache *bboxCache;
00312 SoGLCacheList *cacheList;
00313 SoPrimitiveCountCache *primCountCache;
00314
00315
00316
00317
00318 SoChildList *children;
00319 friend class SoPath;
00320
00321 private:
00322 void rebuildChildrenList();
00323
00324
00325 static SoMFColor *m_diffuse;
00326 static SoMFColor *m_emissive;
00327 static SoMFColor *m_specular;
00328 static SoMFFloat *m_transparency;
00329 static SoMFFloat *m_shininess;
00330 static SoMFColor *m_ambient;
00331
00332
00333 static int instanceCounter;
00334
00335 int m_numRenderCaches;
00336
00337 friend class SoTraversalPassImpl;
00338 };
00339
00340
00341
00342 #if defined(OIV_IGNORE_VRML_DEPRECATED)
00343 #pragma pop_macro("SoDEPRECATED_TYPEDEF")
00344 #pragma pop_macro("SoDEPRECATED_CLASS")
00345 #endif
00346
00347 #endif
00348