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 #ifndef SO_OCC_CULLING_H
00035 #define SO_OCC_CULLING_H
00036
00037 #include <Inventor/nodes/SoRenderList.h>
00038 #include <Inventor/actions/SoGetBoundingBoxAction.h>
00039
00040
00041
00042 class SoOcclusionCulling;
00043
00049 typedef SoDEPRECATED void SoOcclusionReportCB(SoOcclusionCulling *,
00050 int numObj,
00051 int numRendered,
00052 int numOccluders,
00053 void *userData);
00054 class SoDEPRECATED SoOcclusionCulling : public SoRenderList
00106 {
00107 SO_NODE_HEADER(SoOcclusionCulling);
00108
00109 public:
00110
00122 SoOcclusionCulling();
00123
00130 static void setReportCB(SoOcclusionReportCB *func, void *data);
00131
00137 void setThreshold(unsigned int threshold);
00138
00142 unsigned int getThreshold(void);
00143
00151 void setApproximateOcclusion(SbBool enable);
00152
00156 SbBool isApproximateOcclusion(void);
00157
00162 void setNumFrame(unsigned int num);
00163
00168 unsigned int getNumFrame(void);
00169
00177 void setUseHPExtension(SbBool enable);
00178
00179
00184 SbBool getUseHPExtension(void)
00185 { return useHP; }
00186
00187 private:
00188
00189 virtual void getBoundingBox(SoGetBoundingBoxAction *action);
00190 virtual void rayPick(SoRayPickAction *action);
00191 virtual void getPrimitiveCount(SoGetPrimitiveCountAction *action);
00192 virtual void GLRenderBelowPath(SoGLRenderAction *action);
00193
00194 private:
00198 static void initClass();
00199 static void exitClass();
00200
00201 private:
00202
00203
00204 virtual void doStandardTraversal(SoAction *action);
00205
00206
00207 virtual void doSpatialTraversal(SoAction *action);
00208
00209 virtual ~SoOcclusionCulling();
00210
00211 int renderTransObjs(SoAction* action, SoRenderObjectList* vTransObject, SbBool);
00212 int occlusionTestNV(SoAction*, SoRenderObjectList *list, SoRenderObjectList *transparencyList, SbBool);
00213 int occlusionTestHP(SoAction*, SoRenderObjectList *list, SoRenderObjectList *transparencyList, SbBool, int startIndex);
00214
00215 private :
00216 void commonConstructor();
00217
00218 static SoOcclusionReportCB* userReportCB;
00219 static void *userData;
00220
00221 unsigned int pixelThreshold;
00222 unsigned int frameCounter;
00223 unsigned int numFrame;
00224 SbBool approximateOcclusion;
00225 SbBool useHP;
00226 SbBool turnedOff;
00227 SbBool notSorted;
00228 };
00229
00230 #endif
00231
00232