Open Inventor Release 2024.2.0
 
Loading...
Searching...
No Matches
SoLDMResourceParameters.h
1/*=======================================================================
2 *** THE CONTENT OF THIS WORK IS PROPRIETARY TO FEI S.A.S, (FEI S.A.S.), ***
3 *** AND IS DISTRIBUTED UNDER A LICENSE AGREEMENT. ***
4 *** ***
5 *** REPRODUCTION, DISCLOSURE, OR USE, IN WHOLE OR IN PART, OTHER THAN AS ***
6 *** SPECIFIED IN THE LICENSE ARE NOT TO BE UNDERTAKEN EXCEPT WITH PRIOR ***
7 *** WRITTEN AUTHORIZATION OF FEI S.A.S. ***
8 *** ***
9 *** RESTRICTED RIGHTS LEGEND ***
10 *** USE, DUPLICATION, OR DISCLOSURE BY THE GOVERNMENT OF THE CONTENT OF THIS ***
11 *** WORK OR RELATED DOCUMENTATION IS SUBJECT TO RESTRICTIONS AS SET FORTH IN ***
12 *** SUBPARAGRAPH (C)(1) OF THE COMMERCIAL COMPUTER SOFTWARE RESTRICTED RIGHT ***
13 *** CLAUSE AT FAR 52.227-19 OR SUBPARAGRAPH (C)(1)(II) OF THE RIGHTS IN ***
14 *** TECHNICAL DATA AND COMPUTER SOFTWARE CLAUSE AT DFARS 52.227-7013. ***
15 *** ***
16 *** COPYRIGHT (C) 1996-2024 BY FEI S.A.S, ***
17 *** BORDEAUX, FRANCE ***
18 *** ALL RIGHTS RESERVED ***
19**=======================================================================*/
20/*=======================================================================
21** Author : VSG (MMM YYYY)
22**=======================================================================*/
23
24
25#ifndef LDM_RESOURCE_PARAMETER_H
26#define LDM_RESOURCE_PARAMETER_H
27
28#ifdef _MSC_VER
29#pragma warning( push )
30#pragma warning(disable:4251)
31#endif
32
33#include <Inventor/fields/SoFieldContainer.h>
34#include <Inventor/fields/SoSubFieldContainer.h>
35
36#include <Inventor/fields/SoSFString.h>
37#include <Inventor/fields/SoSFUShort.h>
38#include <Inventor/fields/SoSFInt32.h>
39#include <Inventor/fields/SoSFFloat.h>
40#include <Inventor/fields/SoSFBool.h>
41#include <Inventor/fields/SoSFEnum.h>
42#include <Inventor/fields/SoSFString.h>
43#include <Inventor/fields/SoSFVec3i32.h>
44
45#include <Inventor/SbBox.h>
46
47#include <Inventor/STL/vector>
48#include <Inventor/STL/cassert>
49
50class SoDataSet;
51class SoLDMMediator;
52class SoLDMTileVisitor;
54
73{
74 SO_FIELDCONTAINER_HEADER(SoLDMResourceParameters);
75
76public:
85 {
121 ABORT
122 };
145 };
146
152
166
229
230
235
240
256
272
284
293
319
343
367
384
393
433
446
465
476
486
509
516
546
569
594
604
632
642
652 void setMovingTimeOut(float timeout);
653
661
666
680
694 void setGeometryPriority(SoType geometryType, float priority);
695
700 SbBool getGeometryPriority(SoType geometryType, float& priority);
701
702private:
703 typedef struct GeomPriority
704 {
705 float m_weight;
706 SoType m_geomId;
707 } GeomPriority;
708
712 void setDataSet(SoDataSet *ds);
713
717 void copyParameters(SoLDMMediator *mediator);
718
722 void fprintfResourceManager(FILE *f);
723
727 void invalidateData();
728
735 void setNumTiles(int numTiles);
736
740 int getNumTiles();
741
746 SbBox3i32 XYZToVoxel(const SbBox3f &dataBox);
747
748
752 bool isReportDisabled();
753 void setReportDisabled(bool flag);
754 FixedResolutionCB* getFixedResCB();
755 int getNumTilesLoaded();
756 bool toReport();
757 void setToReport(bool flag);
758 void increaseNumTilesLoaded();
759 void decreaseNumTilesLoaded();
760 void resetNumTilesLoaded();
761 void resetFixedResVar();
762
763 void sendToLdm(SoDataSet* ds);
764
765 void enableParamsNotify(SbBool state);
766
767 virtual void notify(SoNotList*);
768
769 inline void setResourceManager(SoLDMResourceManager* resourceManager);
770
776 inline void forceFixedResolution(bool flag);
777
782 inline bool isFixedResolutionForced() const;
783
789 enum Resolution {
794 BEST = -1,
798 FULL = 0
799 };
800
801private:
802
803#if 1 SoDEPRECATED
810 SoSFInt32 overlapping;
811
812#endif
814#if 1 SoDEPRECATED
826 SoSFInt32 maxTilesInMainMem;
827SoDEPRECATED
838 SoSFInt32 maxTilesInTexMem;
839SoDEPRECATED
853 SoSFBool fixedParams;
854
855#endif
857#if 1 SoDEPRECATED
878 SoSFInt32 max2DTextures;
879
880 // TODO: the following friend dependencies should be removed once internal dependencies are removed
882#endif
884 // Deprecated in 9700 and removed (hidden) in 10000.
885 // No longer used by the default heightfield rendering algorithm( SoHeightFieldRender )
886 // Use SoComplexity instead.
887 SoSFInt32 maxNumTriangles;
888
889 bool m_forceFixedResolution;
890
894 SoLDMResourceParameters& operator=(const SoLDMResourceParameters& ldmrp);
896
897 //Methods used in ldmParameterChangedCB
898 void updateTileHalfLife(float timeInSec);
899 void updateTileSize();
900 void updateMaxResolutionThreshold( int threshold );
901 void updateMinResolutionThreshold( int threshold );
902 void updateLoadPolicy( LoadPolicy loadPolicy );
903 void updateEnableFixedResolutionMode(int resolution, FixedResolutionCB* func);
904 void updateDisableFixedResolutionMode();
905
906 SoDataSet* m_ds;
907 SoLDMResourceManager* m_resourceMgr;
908
909 FixedResolutionCB* m_fixedResCB;
910 int m_numTilesLoaded;
911 int m_numTilesNeeded;
912 bool m_toReport;
913 bool m_reportDisable;
914 bool m_isFixedRes;
915 bool m_bLdmParamDebug;
916
918 int m_previousMinThreshold;
919
920 //to save current system state before using fixed res mode
921 LoadPolicy m_policyUsed;
922 int m_resolution;
923 SoLDMTileVisitor* m_fixedResVisitor;
924 SoLDMTileVisitor* m_beforeFixedResVisitor;
925 bool m_beforeFixedResVisitorFlag;
926
927 float m_movingTimeOut; //keep not loading for timeOut sec after the user stopped interacting.
928
929 std::vector<GeomPriority> m_geomPriority;
930 int getGeometryIndex(SoType geometryType);
931
932 static bool s_artForceFixed;
933};
934
935/***************************************************************************/
936inline bool
937SoLDMResourceParameters::isReportDisabled()
938{
939 return m_reportDisable;
940}
941
942/***************************************************************************/
943inline void
944SoLDMResourceParameters::setReportDisabled(bool flag)
945{
946 m_reportDisable = flag;
947}
948
949/***************************************************************************/
951SoLDMResourceParameters::getFixedResCB()
952{
953 return m_fixedResCB;
954}
955
956/***************************************************************************/
957inline int
958SoLDMResourceParameters::getNumTilesLoaded()
959{
960 return m_numTilesLoaded;
961}
962
963/***************************************************************************/
964inline bool
965SoLDMResourceParameters::toReport()
966{
967 return m_toReport;
968}
969
970/***************************************************************************/
971inline void
972SoLDMResourceParameters::setToReport(bool flag)
973{
974 m_toReport = flag;
975}
976
977/***************************************************************************/
978inline void
979SoLDMResourceParameters::increaseNumTilesLoaded()
980{
981 m_numTilesLoaded++;
982}
983
984/***************************************************************************/
985inline void
986SoLDMResourceParameters::decreaseNumTilesLoaded()
987{
988 m_numTilesLoaded--;
989}
990
991/***************************************************************************/
992inline void
993SoLDMResourceParameters::resetNumTilesLoaded()
994{
995 m_numTilesLoaded = 0;
996}
997
998/***************************************************************************/
999inline void
1000SoLDMResourceParameters::setResourceManager(SoLDMResourceManager* resourceManager)
1001{
1002 m_resourceMgr = resourceManager;
1003}
1004
1005/***************************************************************************/
1007SoLDMResourceParameters::operator=(const SoLDMResourceParameters& )
1008{
1009 assert(0);
1010 return *this;
1011}
1012
1013/***************************************************************************/
1014inline void
1015SoLDMResourceParameters::forceFixedResolution(bool flag)
1016{
1017 m_forceFixedResolution = flag;
1018}
1019
1020/***************************************************************************/
1021inline bool
1022SoLDMResourceParameters::isFixedResolutionForced() const
1023{
1024 return m_forceFixedResolution || s_artForceFixed;
1025}
1026
1027/***************************************************************************/
1028extern std::ostream& operator << (std::ostream& os, const SoLDMResourceParameters& p);
1029
1030#ifdef _MSC_VER
1031#pragma warning( pop )
1032#endif
1033
1034#endif
1035
1036
3D box class.
Definition SbBox.h:649
<a href="IconLegend.html"><img src="extTGS.gif" alt="VSG extension" border="0"></a> 3D box class.
Definition SbBox.h:96
<a href="IconLegend.html"><img src="extLDM.gif" alt="Large Data Management" border="0"></a> Data set...
Definition SoDataSet.h:139
Abstract base class for objects that contain fields.
<a href="IconLegend.html"><img src="extLDM.gif" alt="Large Data Management" border="0"></a> Resource...
<a href="IconLegend.html"><img src="extLDM.gif" alt="Large Data Management" border="0"></a> Defines ...
SoSFInt32 numPrefetchThread
Number of threads used by the tile prefetch mechanism.
ViewpointRefinementPolicy
Viewpoint refinement policies.
@ VIEWPOINT_REFINEMENT_ON
The refinement of tiles will depend on the viewpoint.
@ VIEWPOINT_REFINEMENT_INHERITED_FROM_GLOBAL
The refinement of tiles will depend on the viewpoint or not according to the flag returned by SoLDMGl...
@ VIEWPOINT_REFINEMENT_OFF
Viewpoint will not affect tile loading priorities.
SoSFBool tileBorders
Defines whether or not to generate borders around tiles.
SoSFInt32 minTilesToLoad
Minimum number of tiles that must be loaded in memory before rendering.
void enableFixedResolutionMode(int resolution, FixedResolutionCB *func)
This method is used to specify a callback that gives feedback while the rendering tries to reach an...
SoSFInt32 resolution
Specifies the resolution level when fixedResolution is TRUE.
int getDataSize()
Gets the size of a voxel in bytes.
SbBool getGeometryPriority(SoType geometryType, float &priority)
Returns the priority of the specified geometry type.
SoSFInt32 minResolutionThreshold
Minimum loading threshold for LDM module.
SoSFVec3i32 subTileDimension
Size of subtiles used by some accelerated algorithms.
SoSFEnum viewpointRefinementPolicy
Defines the viewpoint refinement policy.
TileCachePolicy
Tile cache management policy.
@ NONE
For non-tiled data such as DICOM or SEGY or an in-memory volume, tiles are created when needed (to se...
@ LOWRES_ONLY
For non-tiled data such as DICOM or SEGY or in-memory volume, tiles are created when needed (to send ...
@ ALL
For non-tiled data such as DICOM or SEGY or in-memory volume, tiles are created when needed (to send ...
SoSFInt32 loadNotificationRate
Tile loading notification rate.
ScreenResolutionCullingPolicy
Screen resolution culling policies.
@ SCREEN_RESOLUTION_CULLING_INHERITED_FROM_GLOBAL
Screen resolution culling will be enabled or not according to the flag returned by SoLDMGlobalResourc...
@ SCREEN_RESOLUTION_CULLING_ON
Screen resolution culling is enabled.
@ SCREEN_RESOLUTION_CULLING_OFF
Screen resolution culling is disabled.
SoSFInt32 maxTexMemory
Maximum allowed texture (GPU) memory in MB for this data set.
SoSFInt32 max2DTexMemory
Maximum of 2D textures memory in MB for this data set.
SoSFInt32 maxMainMemory
Maximum allowed main memory in MB that LDM is allowed to use for this data set.
SoLDMResourceParameters()
Constructor.
SoSFFloat tileHalfLife
Tile half-life (seconds).
SoSFInt32 tex3LoadRate
Maximum number of 3D tiles to be loaded into texture memory per frame for this data set.
SoSFVec3i32 tileDimension
Sets the tile size.
SoSFBool fixedResolution
Specifies if a single resolution or several resolutions are used when the rendering is stabilized.
SoSFEnum tileCachePolicy
Specify how LDM store the tiles in memory.
float getMovingTimeOut()
Returns the amount of time during which LDM continues not loading data once a user stops interaction.
@ NO_USER_INTERACTION
Load tiles only when when there is no user interaction, i.e., application idles.
void FixedResolutionCB(FixedResolutionReport &, void *)
When fixedResolution is TRUE and resolution is not -1, this callback is used by the application to ...
SoSFInt32 maxResolutionThreshold
Maximum loading threshold for the LDM module.
SoSFInt32 tex2LoadRate
Maximum number of 2D tiles to be loaded in texture memory per frame.
void setMovingTimeOut(float timeout)
Sets the amount of time (in seconds) during which LDM continues not loading once a user stops interac...
void setGeometryPriority(SoType geometryType, float priority)
Sets the importance of one type of geometry relative to others.
virtual ~SoLDMResourceParameters()
Destructor.
SoSFEnum loadPolicy
Tile loading policy.
SoSFEnum screenResolutionCullingPolicy
Defines the screen resolution culling policy.
Field containing a single Boolean value.
Definition SoSFBool.h:79
Field containing an enumerated value.
Definition SoSFEnum.h:89
Field containing a floating-point value.
Definition SoSFFloat.h:78
Field containing a int32_t integer.
Definition SoSFInt32.h:80
<a href="IconLegend.html"><img src="extTGS.gif" alt="VSG extension" border="0"></a> Field containing...
Definition SoSFVec3i32.h:48
Stores runtime type information.
Definition SoType.h:98
int SbBool
Boolean type.
Definition SbBase.h:87
This structure returns information to the application when fixedResolution is TRUE and resolution is ...
int numTilesLoaded
Number of tiles LDM has already loaded.
int numTilesToLoad
How many tiles need to be loaded.
int numTilesToAdd
How many more tiles need to be allowed in main memory.
@ ABORT
If LDM cannot grant a fixed resolution request, the callback function is called with an ABORT repor...