Open Inventor Release 2023.2.3
 
Loading...
Searching...
No Matches
SoBaseLDMConverter.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-2014 BY FEI S.A.S, ***
17 *** BORDEAUX, FRANCE ***
18 *** ALL RIGHTS RESERVED ***
19**=======================================================================*/
20/*=======================================================================
21** Author : VSG (Apr 2003)
22**=======================================================================*/
23
24#ifndef _SO_LDM_CONVERTER_
25#define _SO_LDM_CONVERTER_
26
28class SoVolumeReader;
29
30#ifdef _WIN32
31#pragma warning( push )
32#pragma warning(disable:4251)
33#endif
34
64{
65
66public:
71
80 virtual SoVolumeReader* getReader( const SbString& filename, const SbString& fileExt );
81
86
87
88private:
89
91 virtual void instanciateReader(SoConverter::ConverterError& error);
92
93
94 virtual void getSubSlice( const SbBox2i32& subSlice, int sliceNumber, void * data ) ;
95
96 //error returned : 0 = ok, 1 = pb = return
97 virtual SbBox3f getSize(int& error) ;
98 virtual std::vector<SoDataSet::DatumElement> getDatum(int& error) ;
99 virtual SbVec3i32 getDimension(int& error) ;
100 virtual int getRange( double & rangeMin, double & rangeMax );
101 virtual SoVolumeHistogram* getHistogram();
102 virtual std::vector<SbVec2d>& getTileMinMax(int numTiles);
103 virtual void closeInputFileHandles();
104
105 // Method to retrieve num significant bits. Init the reader (if needed) and retrieve
106 // value from it. Return true if value could have been retrieved, false otherwise.
107 // if true is returned, numsigbits varaible contains the value
108 virtual bool getNumSignificantBits(int& numsigbits);
109
110 virtual void outputHeader( FILE* );
112
122 virtual void sampleTile( const SbVec3i32& tileDim, int border,
123 const void* const octantTile[8],
124 const int octantExists[8],
125 void *parentTile );
126
136 virtual void sampleTile( const SbVec3i32& tileDim, int type, int border,
137 const void* const octantTile[8],
138 const int octantExists[8],
139 void *parentTile );
140
148 virtual void sampleAverage( const SbVec3i32& tileDim, int type, int border,
149 const void* const octantTile[8], const int octantExists[8],
150 void *parentTile );
151
158 virtual void sampleDecimation(const SbVec3i32& tileDim, int dataType, int border,
159 const void* const octantTile[8],
160 const int octantExists[8],
161 void *parentTile );
162
163 virtual void adjustParameters();
164 virtual void handleCustomTags(FILE* filePtr);
165
166 // perform some clean if needed
167 virtual void endConversion();
168
169private:
170 static void sampleAverageS(
171 int pondCoef,const SbVec3i32& tileDim, int type,
172 const void* const childTile,
173 void *parentTile,
174 int octant, const int octantExists[8]);
175
176 static void sampleDecimationS(
177 const SbVec3i32& tileDim, int type,
178 const void* const childTile,
179 void *parentTile,
180 int octant, const int octantExists[8]);
181
182private:
183 template <typename T>
184 static void sampleAverage(int pondCoef, const SbVec3i32& tileDim, const void* const childTile,
185 void *parentTile, int octant, const int octantExists[8]);
186
187 static void sampleAverageRGBA(int pondCoef, const SbVec3i32& tileDim, const void* const childTile,
188 void *parentTile, int octant, const int octantExists[8]);
189 template <typename T>
190 static void sampleDecimation(const SbVec3i32& tileDim, const void* const childTile,
191 void *parentTile, int octant, const int octantExists[8]);
192
193 static void getShiftAndHalfTileDim(SbVec2i32& shiftParentOctant,
194 SbVec3i32& halfTileDim,
195 const SbVec3i32& tileDim,
196 int octant);
197
198 static void getRatio ( SbVec3f &ratio,
199 SbVec3i32 &shiftOctant,
200 SbVec3i32 tileDim,
201 SbVec3i32 halfTileDim,
202 int octant,
203 const int octantExists[8]);
204
205 SoDataSet::DataType m_dataType; //one data only for this type of conversion
206};
207
208inline SoVolumeReader*
210{
211 return NULL;
212}
213
214#if defined(_WIN32)
215#pragma warning( pop )
216#pragma warning(disable:4251)
217#endif
218
219#endif // _SO_LDM_CONVERTER_
220
221
virtual size_t getSize()
Return the max size of the cache (number of buffers).
2D box class.
Definition SbBox.h:2383
3D box class.
Definition SbBox.h:649
Class for smart character strings.
Definition SbString.h:202
2D vector class.
Definition SbVec.h:517
3D vector class.
Definition SbVec.h:932
3D vector class.
Definition SbVec.h:1517
<a href="IconLegend.html"><img src="extLDM.gif" alt="Large Data Management" border="0"></a> Base cla...
virtual SoVolumeReader * getReader(const SbString &filename, const SbString &fileExt)
Returns a custom reader according to the given filename and extension.
SoBaseLDMConverter()
Constructor.
virtual ~SoBaseLDMConverter()
Destructor.
<a href="IconLegend.html"><img src="extLDM.gif" alt="Large Data Management" border="0"></a> Abstract...
ConverterError
Converter errors.
DataType
Supported data type.
Definition SoDataSet.h:604
Volume Data Histogram.
<a href="IconLegend.html"><img src="extLDM.gif" alt="Large Data Management" border="0"></a> Abstract...