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(SoDataSet *dataSet, double elapsedTime, double memLoaded, void *userData);
00047
00163 class SoLDMGlobalResourceParameters
00164 {
00165
00166 public:
00168
00169
00179 static void setMaxMainMemory( int maxMainMemory );
00180
00185 static int getMaxMainMemory();
00186
00197 static void setMaxTexMemory( int maxTexMemory );
00198
00203 static int getMaxTexMemory();
00204
00221 static void setTex3LoadRate( int loadRate );
00222
00228 static int getTex3LoadRate();
00229
00243 static void setTex2LoadRate( int loadRate );
00244
00250 static int getTex2LoadRate();
00251
00266 static void setNumIO(unsigned int numIO);
00267
00272 static unsigned int getNumIO();
00273
00275
00276
00281 enum VisualFeedbackParam {
00285 DRAW_TILES,
00289 DRAW_SLICES_TEX,
00298 DRAW_TOPOLOGY,
00305 DRAW_TILE_OUTLINE,
00315 SHOW_TILES_VALUATED,
00320 SHOW_LOAD_UNLOAD_TILES,
00327 USE_FAKE_DATA
00328 };
00329
00333 static void setVisualFeedbackParam( VisualFeedbackParam param, SbBool state );
00334
00338 static SbBool getVisualFeedbackParam( VisualFeedbackParam param );
00339
00340
00342
00343
00350 static void setViewCulling( SbBool state, SbBool forceRedraw = TRUE );
00351
00356 static SbBool getViewCulling();
00357
00368 static void setScreenResolutionCulling( SbBool flag );
00369
00374 static SbBool getScreenResolutionCulling();
00375
00383 static void setIgnoreFullyTransparentTiles( SbBool state );
00384
00389 static SbBool getIgnoreFullyTransparentTiles();
00390
00398 static void setViewpointRefinement( SbBool state );
00399
00404 static SbBool getViewpointRefinement();
00405
00425 static void setSliceEqualResolution( SbBool state, SbBool forceRedraw = TRUE );
00426
00431 static SbBool getSliceEqualResolution();
00432
00440 static void setLoadNotificationRate(int);
00441
00446 static int getLoadNotificationRate();
00447
00457 static void setLoadCB( SoLDMLoadCB *func, void *userData = NULL );
00458
00467 static void setMonitoringCB( SoLDMMonitoringCB *func, int memAmount, void *userData = NULL );
00468
00472 static inline int64_t getDefaultMaxTexMem() { return s_defaultMaxTexMemMB; }
00473
00477 static inline int64_t getDefaultMaxMainMem() { return s_defaultMaxMainMemMB; }
00478
00490 static void setMax2DTexMemory(uint64_t maxMemory);
00491
00496 static uint64_t getMax2DTexMemory();
00497
00498 #if 1 SoDEPRECATED
00505 static void setMoveLowResolution( SbBool state );
00506 SoDEPRECATED
00512 static SbBool getMoveLowResolution();
00513
00514 #endif
00516 private:
00517
00518
00519
00520 enum Cmd{
00521 SET_VISUAL_FEEDBACK_PARAM = 0,
00522 SET_MAX_MAIN_MEMORY = 1,
00523 SET_MAX_TEX_MEMORY = 2,
00524 SET_MAX_2D_TEXTURES = 3,
00525 SET_MAX_NUM_TRIANGLES = 4,
00526 SET_TEX3_LOAD_RATE = 5,
00527 SET_TEX2_LOAD_RATE = 6,
00528 SET_NUMIO = 7,
00529 SET_WRITE_ALTERNATE_REP = 8,
00530 SET_READ_ALTERNATE_REP = 9,
00531 SET_DELAYED_RENDERING = 10,
00532 SET_VIEW_CULLING = 11,
00533 SET_SCREEN_RESOLUTION_CULLING = 12,
00534 SET_VIEWPOINT_REFINEMENT = 13,
00535 SET_IGNORE_FULLY_TRANSPARENT_TILES = 14,
00536 SET_SLICE_EQUAL_RES = 15,
00537 SET_MOVE_LOW_RES = 16,
00538 SET_LOAD_NOTIFICATION_RATE = 17
00539 };
00540
00541 static void initClass();
00542
00546 static bool isDrawingOutlines();
00547
00548 #if 1 SoDEPRECATED
00552 static size_t getMaxTextureSizeBytes();
00553
00554 #endif
00556 private:
00557
00558
00559
00560 static SbBool s_drawTiles;
00561 static SbBool s_drawSlicesTex;
00562 static SbBool s_drawTopology;
00563 static SbBool s_drawTileOutline;
00564 static SbBool s_showTilesLoaded;
00565 static SbBool s_showLoadUnloadTiles;
00566 static SbBool s_useFakeData;
00567
00568
00569 static SbBool s_ignoreFullyTransparentTiles;
00570 static SbBool s_viewCulling;
00571 static SbBool s_screenResolutionCulling;
00572 static SbBool s_viewpointRefinement;
00573 static SbBool s_sliceEqualResolution;
00574 static SbBool s_moveLowResolution;
00575
00576 static int64_t s_defaultMaxTexMemMB;
00577 static int64_t s_defaultMaxMainMemMB;
00578
00579 };
00580 #endif // _SO_LDM_GLOBAL_RESOURCE_PARAM_
00581
00582
00583