Open Inventor Release 2023.2.3
 
Loading...
Searching...
No Matches
SoLDMResourceParameters.h
Go to the documentation of this file.
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
35
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
74{
76
77public:
86 {
122 ABORT
123 };
146 };
147
153
167
232
233
238
243
259
275
287
299
325
349
373
390
399
439
452
471
482
492
515
522
552
575
600
610
638
648
658 void setMovingTimeOut(float timeout);
659
667
672
686
700 void setGeometryPriority(SoType geometryType, float priority);
701
706 SbBool getGeometryPriority(SoType geometryType, float& priority);
707
708private:
709 typedef struct GeomPriority
710 {
711 float m_weight;
712 SoType m_geomId;
713 } GeomPriority;
714
718 void setDataSet(SoDataSet *ds);
719
723 void copyParameters(SoLDMMediator *mediator);
724
728 void fprintfResourceManager(FILE *f);
729
733 void invalidateData();
734
741 void setNumTiles(int numTiles);
742
746 int getNumTiles();
747
752 SbBox3i32 XYZToVoxel(const SbBox3f &dataBox);
753
754
758 bool isReportDisabled();
759 void setReportDisabled(bool flag);
760 FixedResolutionCB* getFixedResCB();
761 int getNumTilesLoaded();
762 bool toReport();
763 void setToReport(bool flag);
764 void increaseNumTilesLoaded();
765 void decreaseNumTilesLoaded();
766 void resetNumTilesLoaded();
767 void resetFixedResVar();
768
769 void sendToLdm(SoDataSet* ds);
770
771 void enableParamsNotify(SbBool state);
772
773 virtual void notify(SoNotList*);
774
775 inline void setResourceManager(SoLDMResourceManager* resourceManager);
776
782 inline void forceFixedResolution(bool flag);
783
788 inline bool isFixedResolutionForced() const;
789
795 enum Resolution {
800 BEST = -1,
804 FULL = 0
805 };
806
807private:
808
809#if 1 SoDEPRECATED
816 SoSFInt32 overlapping;
817
818#endif
820#if 1 SoDEPRECATED
832 SoSFInt32 maxTilesInMainMem;
833SoDEPRECATED
844 SoSFInt32 maxTilesInTexMem;
845SoDEPRECATED
859 SoSFBool fixedParams;
860
861#endif
863#if 1 SoDEPRECATED
884 SoSFInt32 max2DTextures;
885
886 // TODO: the following friend dependencies should be removed once internal dependencies are removed
888#endif
890 // Deprecated in 9700 and removed (hidden) in 10000.
891 // No longer used by the default heightfield rendering algorithm( SoHeightFieldRender )
892 // Use SoComplexity instead.
893 SoSFInt32 maxNumTriangles;
894
895 bool m_forceFixedResolution;
896
902
903 //Methods used in ldmParameterChangedCB
904 void updateTileHalfLife(float timeInSec);
905 void updateTileSize();
906 void updateMaxResolutionThreshold( int threshold );
907 void updateMinResolutionThreshold( int threshold );
908 void updateLoadPolicy( LoadPolicy loadPolicy );
909 void updateEnableFixedResolutionMode(int resolution, FixedResolutionCB* func);
910 void updateDisableFixedResolutionMode();
911
912 SoDataSet* m_ds;
913 SoLDMResourceManager* m_resourceMgr;
914
915 FixedResolutionCB* m_fixedResCB;
916 int m_numTilesLoaded;
917 int m_numTilesNeeded;
918 bool m_toReport;
919 bool m_reportDisable;
920 bool m_isFixedRes;
921 bool m_bLdmParamDebug;
922
924 int m_previousMinThreshold;
925
926 //to save current system state before using fixed res mode
927 LoadPolicy m_policyUsed;
928 int m_resolution;
929 SoLDMTileVisitor* m_fixedResVisitor;
930 SoLDMTileVisitor* m_beforeFixedResVisitor;
931 bool m_beforeFixedResVisitorFlag;
932
933 float m_movingTimeOut; //keep not loading for timeOut sec after the user stopped interacting.
934
935 std::vector<GeomPriority> m_geomPriority;
936 int getGeometryIndex(SoType geometryType);
937
938 static bool s_artForceFixed;
939};
940
941/***************************************************************************/
942inline bool
943SoLDMResourceParameters::isReportDisabled()
944{
945 return m_reportDisable;
946}
947
948/***************************************************************************/
949inline void
950SoLDMResourceParameters::setReportDisabled(bool flag)
951{
952 m_reportDisable = flag;
953}
954
955/***************************************************************************/
957SoLDMResourceParameters::getFixedResCB()
958{
959 return m_fixedResCB;
960}
961
962/***************************************************************************/
963inline int
964SoLDMResourceParameters::getNumTilesLoaded()
965{
966 return m_numTilesLoaded;
967}
968
969/***************************************************************************/
970inline bool
971SoLDMResourceParameters::toReport()
972{
973 return m_toReport;
974}
975
976/***************************************************************************/
977inline void
978SoLDMResourceParameters::setToReport(bool flag)
979{
980 m_toReport = flag;
981}
982
983/***************************************************************************/
984inline void
985SoLDMResourceParameters::increaseNumTilesLoaded()
986{
987 m_numTilesLoaded++;
988}
989
990/***************************************************************************/
991inline void
992SoLDMResourceParameters::decreaseNumTilesLoaded()
993{
994 m_numTilesLoaded--;
995}
996
997/***************************************************************************/
998inline void
999SoLDMResourceParameters::resetNumTilesLoaded()
1000{
1001 m_numTilesLoaded = 0;
1002}
1003
1004/***************************************************************************/
1005inline void
1006SoLDMResourceParameters::setResourceManager(SoLDMResourceManager* resourceManager)
1007{
1008 m_resourceMgr = resourceManager;
1009}
1010
1011/***************************************************************************/
1013SoLDMResourceParameters::operator=(const SoLDMResourceParameters& )
1014{
1015 assert(0);
1016 return *this;
1017}
1018
1019/***************************************************************************/
1020inline void
1021SoLDMResourceParameters::forceFixedResolution(bool flag)
1022{
1023 m_forceFixedResolution = flag;
1024}
1025
1026/***************************************************************************/
1027inline bool
1028SoLDMResourceParameters::isFixedResolutionForced() const
1029{
1030 return m_forceFixedResolution || s_artForceFixed;
1031}
1032
1033/***************************************************************************/
1034extern std::ostream& operator << (std::ostream& os, const SoLDMResourceParameters& p);
1035
1036#ifdef _MSC_VER
1037#pragma warning( pop )
1038#endif
1039
1040#endif
1041
1042
std::ostream & operator<<(std::ostream &os, const SoLDMResourceParameters &p)
valueRef operator=(valueRef newValue)
Sets this field to newValue.
Definition SoSubField.h:242
#define SO_FIELDCONTAINER_HEADER(className)
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 (see the Memory Management section above for more information).
@ NONE
For non-tiled data like DICOM or SEGY or an in-memory volume, tiles are created when needed (to send ...
@ LOWRES_ONLY
For non-tiled data like DICOM or SEGY or in-memory volume, tiles are created when needed (to send dat...
@ ALL
For non-tiled data like DICOM or SEGY or in-memory volume, tiles are created when needed (to send dat...
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 which tiles should be cached in LDM 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...