00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023 #ifndef _SO_LDM_GLOBAL_RESOURCE_PARAM_
00024 #define _SO_LDM_GLOBAL_RESOURCE_PARAM_
00025
00026 class SoLDMTileManager;
00027
00028 #include <LDM/SoLDM.h>
00029 #include <Inventor/nodes/SoSubNode.h>
00030
00031
00038 typedef void SoLDMLoadCB( SbBool startLoading, void *userData );
00039
00046 typedef void SoLDMMonitoringCB(SoLDMTileManager *tm, double elapsedTime, double memLoaded, void *userData);
00047
00163 class SoLDMGlobalResourceParameters
00164 {
00165
00166 public:
00168
00169
00170 #if 1 SoDEPRECATED
00186 static void setMaxNumTriangles(int maxNumTriangles);
00187 SoDEPRECATED
00193 static int getMaxNumTriangles();
00194 #endif
00205 static void setMaxMainMemory( int maxMainMemory );
00206
00211 static int getMaxMainMemory();
00212
00223 static void setMaxTexMemory( int maxTexMemory );
00224
00229 static int getMaxTexMemory();
00230
00247 static void setTex3LoadRate( int loadRate );
00248
00254 static int getTex3LoadRate();
00255
00269 static void setTex2LoadRate( int loadRate );
00270
00276 static int getTex2LoadRate();
00277
00292 static void setNumIO(unsigned int numIO);
00293
00298 static unsigned int getNumIO();
00299
00301
00302
00307 enum VisualFeedbackParam {
00311 DRAW_TILES,
00315 DRAW_SLICES_TEX,
00324 DRAW_TOPOLOGY,
00331 DRAW_TILE_OUTLINE,
00341 SHOW_TILES_VALUATED,
00346 SHOW_LOAD_UNLOAD_TILES,
00353 USE_FAKE_DATA
00354 };
00355
00359 static void setVisualFeedbackParam( VisualFeedbackParam param, SbBool state );
00360
00364 static SbBool getVisualFeedbackParam( VisualFeedbackParam param );
00365
00366 #if 1 SoDEPRECATED enum
00381 TileCacheType {
00399 NONE,
00418 FULLRES_ONLY,
00435 ALL,
00440 LOWRES_ONLY=FULLRES_ONLY
00441 };
00442 SoDEPRECATED
00454 static void setTileCacheType( TileCacheType cacheType );
00455 SoDEPRECATED
00461 static TileCacheType getTileCacheType();
00462
00463 #endif
00465
00466 // Viewing Parameters section
00467
00474 static void setViewCulling( SbBool state, SbBool forceRedraw = TRUE );
00475
00480 static SbBool getViewCulling();
00481
00492 static void setScreenResolutionCulling( SbBool flag );
00493
00498 static SbBool getScreenResolutionCulling();
00499
00507 static void setIgnoreFullyTransparentTiles( SbBool state );
00508
00513 static SbBool getIgnoreFullyTransparentTiles();
00514
00522 static void setViewpointRefinement( SbBool state );
00523
00528 static SbBool getViewpointRefinement();
00529
00549 static void setSliceEqualResolution( SbBool state, SbBool forceRedraw = TRUE );
00550
00555 static SbBool getSliceEqualResolution();
00556
00564 static void setLoadNotificationRate(int);
00565
00570 static int getLoadNotificationRate();
00571
00581 static void setLoadCB( SoLDMLoadCB *func, void *userData = NULL );
00582
00591 static void setMonitoringCB( SoLDMMonitoringCB *func, int memAmount, void *userData = NULL );
00592
00596 static inline int64_t getDefaultMaxTexMem() { return s_defaultMaxTexMemMB; }
00597
00601 static inline int64_t getDefaultMaxMainMem() { return s_defaultMaxMainMemMB; }
00602
00613 static void setMax2DTexMemory(uint64_t maxMemory);
00614
00619 static uint64_t getMax2DTexMemory();
00620
00621 #if 1 SoDEPRECATED
00634 static void setMax2DTextures(int numTextures);
00635 SoDEPRECATED
00642 static int getMax2DTextures();
00643 SoDEPRECATED
00648 static int64_t getDefaultMaxTex2D();
00649
00650 #endif
00652 #if 1 SoDEPRECATED
00659 static void setMoveLowResolution( SbBool state );
00660 SoDEPRECATED
00666 static SbBool getMoveLowResolution();
00667
00668 #endif
00670 private:
00671 enum Cmd{
00672 SET_VISUAL_FEEDBACK_PARAM = 0,
00673 SET_MAX_MAIN_MEMORY,
00674 SET_MAX_TEX_MEMORY,
00675 SET_MAX_2D_TEXTURES,
00676 SET_MAX_NUM_TRIANGLES,
00677 SET_TEX3_LOAD_RATE,
00678 SET_TEX2_LOAD_RATE,
00679 SET_NUMIO,
00680 SET_WRITE_ALTERNATE_REP,
00681 SET_READ_ALTERNATE_REP,
00682 SET_DELAYED_RENDERING,
00683 SET_VIEW_CULLING,
00684 SET_SCREEN_RESOLUTION_CULLING,
00685 SET_VIEWPOINT_REFINEMENT,
00686 SET_IGNORE_FULLY_TRANSPARENT_TILES,
00687 SET_SLICE_EQUAL_RES,
00688 SET_MOVE_LOW_RES,
00689 SET_LOAD_NOTIFICATION_RATE
00690 };
00691
00692 static void initClass();
00693
00697 static bool isDrawingOutlines();
00698
00699 #if 1 SoDEPRECATED
00703 static size_t getMaxTextureSizeBytes();
00704
00705 #endif
00707 private:
00708
00709
00710
00711 static SbBool s_drawTiles;
00712 static SbBool s_drawSlicesTex;
00713 static SbBool s_drawTopology;
00714 static SbBool s_drawTileOutline;
00715 static SbBool s_showTilesLoaded;
00716 static SbBool s_showLoadUnloadTiles;
00717 static SbBool s_useFakeData;
00718
00719
00720 static SbBool s_ignoreFullyTransparentTiles;
00721 static SbBool s_viewCulling;
00722 static SbBool s_screenResolutionCulling;
00723 static SbBool s_viewpointRefinement;
00724 static SbBool s_sliceEqualResolution;
00725 static SbBool s_moveLowResolution;
00726
00727 static int64_t s_defaultMaxTexMemMB;
00728 static int64_t s_defaultMaxMainMemMB;
00729
00730 static TileCacheType s_TileCacheType;
00731
00732 };
00733 #endif // _SO_LDM_GLOBAL_RESOURCE_PARAM_
00734
00735
00736