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
00170 class SoLDMGlobalResourceParameters
00171 {
00172
00173 public:
00175
00176
00186 static void setMaxMainMemory( int maxMainMemory );
00187
00192 static int getMaxMainMemory();
00193
00204 static void setMaxTexMemory( int maxTexMemory );
00205
00210 static int getMaxTexMemory();
00211
00228 static void setTex3LoadRate( int loadRate );
00229
00235 static int getTex3LoadRate();
00236
00250 static void setTex2LoadRate( int loadRate );
00251
00257 static int getTex2LoadRate();
00258
00273 static void setNumIO(unsigned int numIO);
00274
00279 static unsigned int getNumIO();
00280
00282
00283
00288 enum VisualFeedbackParam {
00292 DRAW_TILES,
00296 DRAW_SLICES_TEX,
00305 DRAW_TOPOLOGY,
00312 DRAW_TILE_OUTLINE,
00322 SHOW_TILES_VALUATED,
00327 SHOW_LOAD_UNLOAD_TILES,
00334 USE_FAKE_DATA
00335 };
00336
00340 static void setVisualFeedbackParam( VisualFeedbackParam param, SbBool state );
00341
00345 static SbBool getVisualFeedbackParam( VisualFeedbackParam param );
00346
00347
00349
00350
00357 static void setViewCulling( SbBool state, SbBool forceRedraw = TRUE );
00358
00363 static SbBool getViewCulling();
00364
00375 static void setScreenResolutionCulling( SbBool flag );
00376
00381 static SbBool getScreenResolutionCulling();
00382
00390 static void setIgnoreFullyTransparentTiles( SbBool state );
00391
00396 static SbBool getIgnoreFullyTransparentTiles();
00397
00405 static void setViewpointRefinement( SbBool state );
00406
00411 static SbBool getViewpointRefinement();
00412
00432 static void setSliceEqualResolution( SbBool state, SbBool forceRedraw = TRUE );
00433
00438 static SbBool getSliceEqualResolution();
00439
00447 static void setLoadNotificationRate(int);
00448
00453 static int getLoadNotificationRate();
00454
00464 static void setLoadCB( SoLDMLoadCB *func, void *userData = NULL );
00465
00474 static void setMonitoringCB( SoLDMMonitoringCB *func, int memAmount, void *userData = NULL );
00475
00479 static inline int64_t getDefaultMaxTexMem() { return s_defaultMaxTexMemMB; }
00480
00484 static inline int64_t getDefaultMaxMainMem() { return s_defaultMaxMainMemMB; }
00485
00496 static void setMax2DTexMemory(uint64_t maxMemory);
00497
00502 static uint64_t getMax2DTexMemory();
00503
00504 #if 1 SoDEPRECATED
00511 static void setMoveLowResolution( SbBool state );
00512 SoDEPRECATED
00518 static SbBool getMoveLowResolution();
00519
00520 #endif
00522 private:
00523
00524
00525
00526 enum Cmd{
00527 SET_VISUAL_FEEDBACK_PARAM = 0,
00528 SET_MAX_MAIN_MEMORY = 1,
00529 SET_MAX_TEX_MEMORY = 2,
00530 SET_MAX_2D_TEXTURES = 3,
00531 SET_MAX_NUM_TRIANGLES = 4,
00532 SET_TEX3_LOAD_RATE = 5,
00533 SET_TEX2_LOAD_RATE = 6,
00534 SET_NUMIO = 7,
00535 SET_WRITE_ALTERNATE_REP = 8,
00536 SET_READ_ALTERNATE_REP = 9,
00537 SET_DELAYED_RENDERING = 10,
00538 SET_VIEW_CULLING = 11,
00539 SET_SCREEN_RESOLUTION_CULLING = 12,
00540 SET_VIEWPOINT_REFINEMENT = 13,
00541 SET_IGNORE_FULLY_TRANSPARENT_TILES = 14,
00542 SET_SLICE_EQUAL_RES = 15,
00543 SET_MOVE_LOW_RES = 16,
00544 SET_LOAD_NOTIFICATION_RATE = 17
00545 };
00546
00547 static void initClass();
00548
00552 static bool isDrawingOutlines();
00553
00554 #if 1 SoDEPRECATED
00558 static size_t getMaxTextureSizeBytes();
00559
00560 #endif
00562 private:
00563
00564
00565
00566 static SbBool s_drawTiles;
00567 static SbBool s_drawSlicesTex;
00568 static SbBool s_drawTopology;
00569 static SbBool s_drawTileOutline;
00570 static SbBool s_showTilesLoaded;
00571 static SbBool s_showLoadUnloadTiles;
00572 static SbBool s_useFakeData;
00573
00574
00575 static SbBool s_ignoreFullyTransparentTiles;
00576 static SbBool s_viewCulling;
00577 static SbBool s_screenResolutionCulling;
00578 static SbBool s_viewpointRefinement;
00579 static SbBool s_sliceEqualResolution;
00580 static SbBool s_moveLowResolution;
00581
00582 static int64_t s_defaultMaxTexMemMB;
00583 static int64_t s_defaultMaxMainMemMB;
00584
00585 };
00586 #endif // _SO_LDM_GLOBAL_RESOURCE_PARAM_
00587
00588
00589