Open Inventor Release 2024.1.0
 
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
230
231
236
241
257
273
285
294
320
344
368
385
394
434
447
466
477
487
510
517
547
570
595
605
633
643
653 void setMovingTimeOut(float timeout);
654
662
667
681
695 void setGeometryPriority(SoType geometryType, float priority);
696
701 SbBool getGeometryPriority(SoType geometryType, float& priority);
702
703private:
704 typedef struct GeomPriority
705 {
706 float m_weight;
707 SoType m_geomId;
708 } GeomPriority;
709
713 void setDataSet(SoDataSet *ds);
714
718 void copyParameters(SoLDMMediator *mediator);
719
723 void fprintfResourceManager(FILE *f);
724
728 void invalidateData();
729
736 void setNumTiles(int numTiles);
737
741 int getNumTiles();
742
747 SbBox3i32 XYZToVoxel(const SbBox3f &dataBox);
748
749
753 bool isReportDisabled();
754 void setReportDisabled(bool flag);
755 FixedResolutionCB* getFixedResCB();
756 int getNumTilesLoaded();
757 bool toReport();
758 void setToReport(bool flag);
759 void increaseNumTilesLoaded();
760 void decreaseNumTilesLoaded();
761 void resetNumTilesLoaded();
762 void resetFixedResVar();
763
764 void sendToLdm(SoDataSet* ds);
765
766 void enableParamsNotify(SbBool state);
767
768 virtual void notify(SoNotList*);
769
770 inline void setResourceManager(SoLDMResourceManager* resourceManager);
771
777 inline void forceFixedResolution(bool flag);
778
783 inline bool isFixedResolutionForced() const;
784
790 enum Resolution {
795 BEST = -1,
799 FULL = 0
800 };
801
802private:
803
804#if 1 SoDEPRECATED
811 SoSFInt32 overlapping;
812
813#endif
815#if 1 SoDEPRECATED
827 SoSFInt32 maxTilesInMainMem;
828SoDEPRECATED
839 SoSFInt32 maxTilesInTexMem;
840SoDEPRECATED
854 SoSFBool fixedParams;
855
856#endif
858#if 1 SoDEPRECATED
879 SoSFInt32 max2DTextures;
880
881 // TODO: the following friend dependencies should be removed once internal dependencies are removed
883#endif
885 // Deprecated in 9700 and removed (hidden) in 10000.
886 // No longer used by the default heightfield rendering algorithm( SoHeightFieldRender )
887 // Use SoComplexity instead.
888 SoSFInt32 maxNumTriangles;
889
890 bool m_forceFixedResolution;
891
897
898 //Methods used in ldmParameterChangedCB
899 void updateTileHalfLife(float timeInSec);
900 void updateTileSize();
901 void updateMaxResolutionThreshold( int threshold );
902 void updateMinResolutionThreshold( int threshold );
903 void updateLoadPolicy( LoadPolicy loadPolicy );
904 void updateEnableFixedResolutionMode(int resolution, FixedResolutionCB* func);
905 void updateDisableFixedResolutionMode();
906
907 SoDataSet* m_ds;
908 SoLDMResourceManager* m_resourceMgr;
909
910 FixedResolutionCB* m_fixedResCB;
911 int m_numTilesLoaded;
912 int m_numTilesNeeded;
913 bool m_toReport;
914 bool m_reportDisable;
915 bool m_isFixedRes;
916 bool m_bLdmParamDebug;
917
919 int m_previousMinThreshold;
920
921 //to save current system state before using fixed res mode
922 LoadPolicy m_policyUsed;
923 int m_resolution;
924 SoLDMTileVisitor* m_fixedResVisitor;
925 SoLDMTileVisitor* m_beforeFixedResVisitor;
926 bool m_beforeFixedResVisitorFlag;
927
928 float m_movingTimeOut; //keep not loading for timeOut sec after the user stopped interacting.
929
930 std::vector<GeomPriority> m_geomPriority;
931 int getGeometryIndex(SoType geometryType);
932
933 static bool s_artForceFixed;
934};
935
936/***************************************************************************/
937inline bool
938SoLDMResourceParameters::isReportDisabled()
939{
940 return m_reportDisable;
941}
942
943/***************************************************************************/
944inline void
945SoLDMResourceParameters::setReportDisabled(bool flag)
946{
947 m_reportDisable = flag;
948}
949
950/***************************************************************************/
952SoLDMResourceParameters::getFixedResCB()
953{
954 return m_fixedResCB;
955}
956
957/***************************************************************************/
958inline int
959SoLDMResourceParameters::getNumTilesLoaded()
960{
961 return m_numTilesLoaded;
962}
963
964/***************************************************************************/
965inline bool
966SoLDMResourceParameters::toReport()
967{
968 return m_toReport;
969}
970
971/***************************************************************************/
972inline void
973SoLDMResourceParameters::setToReport(bool flag)
974{
975 m_toReport = flag;
976}
977
978/***************************************************************************/
979inline void
980SoLDMResourceParameters::increaseNumTilesLoaded()
981{
982 m_numTilesLoaded++;
983}
984
985/***************************************************************************/
986inline void
987SoLDMResourceParameters::decreaseNumTilesLoaded()
988{
989 m_numTilesLoaded--;
990}
991
992/***************************************************************************/
993inline void
994SoLDMResourceParameters::resetNumTilesLoaded()
995{
996 m_numTilesLoaded = 0;
997}
998
999/***************************************************************************/
1000inline void
1001SoLDMResourceParameters::setResourceManager(SoLDMResourceManager* resourceManager)
1002{
1003 m_resourceMgr = resourceManager;
1004}
1005
1006/***************************************************************************/
1008SoLDMResourceParameters::operator=(const SoLDMResourceParameters& )
1009{
1010 assert(0);
1011 return *this;
1012}
1013
1014/***************************************************************************/
1015inline void
1016SoLDMResourceParameters::forceFixedResolution(bool flag)
1017{
1018 m_forceFixedResolution = flag;
1019}
1020
1021/***************************************************************************/
1022inline bool
1023SoLDMResourceParameters::isFixedResolutionForced() const
1024{
1025 return m_forceFixedResolution || s_artForceFixed;
1026}
1027
1028/***************************************************************************/
1029extern std::ostream& operator << (std::ostream& os, const SoLDMResourceParameters& p);
1030
1031#ifdef _MSC_VER
1032#pragma warning( pop )
1033#endif
1034
1035#endif
1036
1037
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.
@ 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 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...