Open Inventor Release 2024.1.1
 
Loading...
Searching...
No Matches
SoVRLdmFileReader.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-2023 BY FEI S.A.S, ***
17 *** BORDEAUX, FRANCE ***
18 *** ALL RIGHTS RESERVED ***
19**=======================================================================*/
20/*=======================================================================
21** Author : J. Hummel (Apr 2003)
22**=======================================================================*/
23#ifndef _SO_VR_LDM_FILE_READER_
24#define _SO_VR_LDM_FILE_READER_
25
26#include <Inventor/STL/string>
27#include <LDM/readers/SoLDMReader.h>
28#include <Inventor/threads/SbThread.h>
29#include <Inventor/STL/vector>
30
31#ifdef _MSC_VER
32#pragma warning( push )
33#pragma warning(disable:4251)
34#endif
35
36class SbThreadMutex;
37class SiBitFile;
38
39
70{
71 SO_FIELDCONTAINER_HEADER(SoVRLdmFileReader);
72
74
75public:
78
82 virtual ReadError getDataChar( SbBox3f &size, SoDataSet::DataType &type, SbVec3i32 &dim ) override;
83
87 virtual SbBool getMinMax(int64_t & min, int64_t & max);
88
93 virtual SbBool getMinMax(double & min, double & max);
94
101 virtual SbBool getHistogram(std::vector<int64_t>& numVox);
102
107 virtual int getNumSignificantBits() { return m_numSignificantBits; }
108
110 virtual SbBool isThreadSafe() const;
111
112#if 1 SoDEPRECATED
115 void getSubSlice( const SbBox2i32& subSlice, int sliceNumber, void * data );
116
117#endif
119#if 1 SoDEPRECATED
126 virtual SbBool getMinMax(int & min, int & max);
127
128#endif
130 private:
131
132 //returns histo and values. bool returned whether some values are set or not
133 virtual SbBool getHistogramAndValues(std::vector<int64_t>& numVox, std::vector<double>& values);
134
135 // Internal use only. Return true if reader has an histogram (check m_entries size).
136 virtual SbBool hasHistogram();
137
138 virtual void saveCustomsTags(FILE* ldmHeader);
139
146 virtual SbBool setOutputDataType( SbBool doChange, SoDataSet::DataType type );
147
148 private:
149 bool m_isDataSigned;
150 bool m_isDataFloat;
151
152 SoDataSet::DataType m_type;
153
154 int m_numSignificantBits;
155
156 //min, max
157 int64_t m_dataMin , m_dataMax;
158 double m_dataMinD, m_dataMaxD;
159
160 //histo
161 std::vector<int> m_entries;
162 std::vector<int64_t> m_values;
163 std::vector<double> m_valuesD;
164 std::vector<int64_t> m_numVoxels;
165
166 virtual int handleHeader(TiXmlElement *);
167
168private:
169 void internalInit();
170 bool isTagCustom(const SbString& tagValue );
171
172 SoDataSet* m_ds;
173 bool m_changeFormat;
174 SoDataSet::DataType m_typeOut;
175 std::set<SbString> ldmKnownTags;
176};
177
178#ifdef _MSC_VER
179#pragma warning( pop )
180#endif
181
182#endif // _SO_VR_LDM_FILE_READER_
183
184
2D box class.
Definition SbBox.h:2383
3D box class.
Definition SbBox.h:649
Class for smart character strings.
Definition SbString.h:202
<a href="IconLegend.html"><img src="extTGS.gif" alt="VSG extension" border="0"></a> Portable mutex c...
3D vector class.
Definition SbVec.h:1517
<a href="IconLegend.html"><img src="extLDM.gif" alt="Large Data Management" border="0"></a> Data set...
Definition SoDataSet.h:139
DataType
Supported data type.
Definition SoDataSet.h:604
<a href="IconLegend.html"><img src="extLDM.gif" alt="Large Data Management" border="0"></a> Base cla...
Definition SoLDMReader.h:98
virtual ReadError getDataChar(SbBox3f &size, SoDataSet::DataType &type, SbVec3i32 &dim) override
Gets the characteristics (file header) of the data volume.
<a href="IconLegend.html"><img src="extLDM.gif" alt="Large Data Management" border="0"></a> LDM file...
virtual SbBool getMinMax(int64_t &min, int64_t &max)
Returns the minimum and maximum data values.
virtual ReadError getDataChar(SbBox3f &size, SoDataSet::DataType &type, SbVec3i32 &dim) override
Gets the characteristics (file header) of the data volume.
virtual SbBool getHistogram(std::vector< int64_t > &numVox)
Returns the distribution of data values, i.e., the number of voxels per data value.
virtual SbBool isThreadSafe() const
Return true as this reader is thread safe.
SoVRLdmFileReader()
Default constructor.
SoDEPRECATED void getSubSlice(const SbBox2i32 &subSlice, int sliceNumber, void *data)
virtual SoDEPRECATED SbBool getMinMax(int &min, int &max)
Returns the minimum and maximum data values.
virtual int getNumSignificantBits()
Returns the number of significant bits.
virtual SbBool getMinMax(double &min, double &max)
Returns the minimum and maximum data values (for float values).
ReadError
Read error.
int SbBool
Boolean type.
Definition SbBase.h:87