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 #ifndef _SO_OCTREE_ORDERING_HH
00039 #define _SO_OCTREE_ORDERING_HH 1
00040
00041 #include <Inventor/fields/SoSFBool.h>
00042 #include <Inventor/nodes/SoRenderList.h>
00043 #include <Inventor/threads/SbThread.h>
00044 #include <Inventor/actions/SoGetBoundingBoxAction.h>
00045
00046 #ifndef HIDDEN_FROM_DOC
00047 class _SoOctreeRenderObjectTree;
00048
00049
00050 class SoDEPRECATED SoOctreeRenderObject : public SoRenderObject
00052 {
00053
00054 public:
00055
00056 SoOctreeRenderObject(const SoPath *p) : SoRenderObject(p)
00057 {
00058
00059 flags.rendered = FALSE; flags.inOctree = FALSE;
00060 flags.inMoving = FALSE; flags.moving = FALSE;
00061
00062 name = p->getTail()->getName();
00063 };
00064
00065 virtual ~SoOctreeRenderObject() { };
00066
00067 struct
00068 {
00069 unsigned int rendered : 1;
00070 unsigned int inOctree : 1;
00071 unsigned int inMoving : 1;
00072 unsigned int moving : 1;
00073 } flags;
00074
00075
00076 SbName getName(void) { return name; };
00077
00078 private :
00079
00080 SbName name;
00081
00082 };
00083 #endif // HIDDEN_FROM_DOC
00084
00085
00086 class SoOctreeOrdering;
00094 typedef SoDEPRECATED void SoReportCB(SoOctreeOrdering *node,
00095 int numObj,
00096 int objRendered,
00097 void *userData);
00098
00099 class SoDEPRECATED SoOctreeOrdering : public SoRenderList
00172 {
00173
00174 SO_NODE_HEADER(SoOctreeOrdering);
00175
00176 public:
00177
00189 SoOctreeOrdering();
00190
00202 SoOctreeOrdering(int numChildren);
00203
00204
00208 SoSFBool dropCulling;
00209
00213 SoSFUInt32 dropScreenArea;
00214
00219 SoSFBool boundingBoxSubstitutes;
00220
00228 SoSFBool useMovingQueue;
00229
00235 SoSFBool adjustDecimation;
00236
00246 static void setReportCB(SoReportCB *func, void *userData);
00247
00254 void setOctreeDrawing(SbBool enable);
00255
00259 SbBool isOctreeDrawing(void);
00260
00264 SbBool isChainingOn(void)
00265 { return (coworker != NULL); };
00266
00271 void setHandleTransparency(SbBool handle);
00272 SbBool getHandleTransparency();
00273
00277 void reset();
00278
00279 private:
00280
00281 virtual void getBoundingBox(SoGetBoundingBoxAction *action);
00282 virtual void GLRenderBelowPath(SoGLRenderAction *action);
00283 virtual void rayPick(SoRayPickAction *action);
00284 virtual void getPrimitiveCount(SoGetPrimitiveCountAction *action);
00285
00286 private:
00287
00288 static void initClass();
00289 static void exitClass();
00290
00291
00292 static SbBool m_internalGetBBox;
00293
00294 private:
00295 SbBool m_handleTransparency;
00296 SbBool m_reset;
00297
00298
00299
00300 virtual void doStandardTraversal(SoAction *action);
00301
00302
00303 virtual void doSpatialTraversal(SoAction *action);
00304
00305
00306 virtual SoRenderObject *createRenderObject(const SoPath *path);
00307 virtual void removingRenderObject(SoRenderObject *);
00308 virtual void renderObjectChanged(SoRenderObject *);
00309 virtual void ourFieldChanged(SoField *);
00310
00311
00312 virtual ~SoOctreeOrdering();
00313
00314 private:
00315
00316 static SoReportCB *m_reportCB;
00317 static void *m_reportUserData;
00318
00319
00320 void commonConstructor();
00321
00322 SoGetBoundingBoxAction *bbAction;
00323 SoGetPrimitiveCountAction *countAction;
00324
00325 SbPList movingQueue;
00326 SbPList changeQueue;
00327
00328 void insertInChangedQueue(void *);
00329 void updateChangedQueue();
00330 void updateRenderObject(SoOctreeRenderObject *);
00331
00332 _SoOctreeRenderObjectTree *octreeTree;
00333
00334 SbThreadMutex *octreeMutex;
00335
00336
00337 int numObjects;
00338
00339 SbBool seeOctree;
00340
00341
00342 float calculateDecimation(float,float);
00343
00344 void renderTransparentObjs(SoAction *action,
00345 SoRenderObjectList *visibleTransparentObject);
00346
00347 void handleMovingQueue(SoAction *action,SbBool);
00348
00349
00350 SbBool isEnvOn;
00351 };
00352
00353 #endif
00354
00355