Open Inventor Release 2024.2.1
 
Loading...
Searching...
No Matches
SoConverterParameters.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 : VSG3D (Jun 2009)
22**=======================================================================*/
23
24
25#ifndef _SO_BASE_CONVERTER_PARAMETERS
26#define _SO_BASE_CONVERTER_PARAMETERS
27
28#ifdef _MSC_VER
29#pragma warning( push )
30#pragma warning(disable:4251)
31#endif
32
33#include <Inventor/STL/vector>
34#include <Inventor/SbBox.h>
35#include <Inventor/SbPList.h>
36#include <LDM/compressors/SoDataCompressor.h>
37#include <Inventor/helpers/SbFileHelper.h>
38
52
53public:
54
66
74
75
80
85
94 static SoConverterParameters* create( int argc, char** argv );
95
108 static SoConverterParameters* create( const SbStringList& arguments );
109
113 void setVerbose( const bool isVerbose );
114
118 bool isVerbose() const;
119
126 void setTileDim( const int tileDim );
127
135 void setTileDim(const SbVec3i32& tileDim);
136
140 SbVec3i32 getTileDim() const;
141
147 void setHeaderFileName( const SbString& headerFileName );
148
153
159 void setDataFileName( const SbString& dataFileName );
160
165
170
178 void setInputFileName( const SbString& inputFileName );
179
183 SbString getInputFileName() const ;
184
189 void setInputVolume(SoDataSet* inputVolume);
190
194 SoDataSet* getInputVolume() const;
195
201 bool setMaxMemory( int maxMemory );
202
206 int getMaxMemory() const;
207
214 void setOutputHeaderOnly( bool headerOnly );
215
219 bool getOutputHeaderOnly() const;
220
231 bool setOutputDataFormat( const SbString& dataFormat );
232
240
245
252 bool setTargetWordFormat(int wordFormat);
253
257 int getTargetWordFormat() const;
258
265 bool setInputRangeMinMax( double min, double max );
266
270 void getInputRangeMinMax( double& min, double& max ) const;
271
286 bool setCompressionName( const SbString& compressionName );
287
300 void setCompressionLevel (int compressionLevel );
301
309 void setCrcCheck (bool addCrcCheck );
310
315
316 /*
317 * Returns compression level.
318 */
319 int getCompressionLevel() const;
320
321 /*
322 * Returns CRC check setting.
323 */
324 bool isCrcCheckDone () const;
325
326 /*
327 * Returns true if using default compression level.
328 */
329 bool useDefaultCompLvl() const;
330
340 bool setLowResAlgorithm( int lowResAlgorithm );
341
346
351 int getPondCoef() const;
352
359 void setUndefinedValue(double undefinedValue);
360
364 double getUndefinedValue() const;
365
369 int getNbArgs() const;
370
374 bool isOutputDataTypeSpecified() const;
375
379 bool isInputDataRangeSpecified() const;
380
384 void setRGBAMode(const bool flag);
385
389 bool isRGBAMode() const;
390
403 void enableHistogram(const bool flag);
404
408 bool isHistogramEnabled() const;
409
413 bool isSavedAsBitSet() const;
414
422 void saveAsBitSet( bool flag, double bitsetThreshold = 0);
423
427 double getBitSetThreshold() const;
428
435 void setBitSetThreshold( double bitsetThreshold );
436
443 void doUpdate ( bool value );
444
448 bool isForUpdate() const;
449
453 void setVerticalFlip(bool flag);
454
458 bool isVerticalFlip() const;
459
460private:
461
462 SbStringList* getArgListAsSbString() const;
463
468 bool isForEditing() const;
469 void setIsForEditing(bool flag);
470 void setDefaultValue(double value);
471 double getDefaultValue() const;
472 bool isTileDimDefault();
473 bool isRGBAModeDefault() const;
474 void setIsFromWriter( bool flag );
475 bool isFromWriter() const;
476 bool recomputeHistogram() const;
477 void enableRecomputeHistogram(bool flag);
478
483 void enableTileMinMax(const bool flag);
484
488 bool isTileMinMaxEnabled() const;
489
490private: protected:
491
500
506
510
515
516 SbString m_inputFileName; //file to convert
518
522
523 // type dependent vars/macros
524 static const char *m_dataTypeStr[];
525 static const char *m_dataTypeXml[];
526
539
540 //instanciate the converterParameters
542};
543
544#ifdef _MSC_VER
545#pragma warning( pop )
546#endif
547
548inline bool
553
554inline void
556{
557 m_verboseMode = flag;
558}
559
560inline SbVec3i32
562{
563 return m_tileDim;
564}
565
566inline void
574
575inline SbString
580
581inline SbString
586
587inline void
593
594inline SbString
599
600inline int
602{
603 return m_memSize;
604}
605
606inline bool
611
612inline void
614{
615 m_headerOnly = headerOnly;
616}
617
623
624inline int
629
630inline SbString
635
636inline int
641
642inline bool
647
648inline void
650{
651 m_crcCheck = addCrcCheck;
652}
653
654inline void
655SoConverterParameters::getInputRangeMinMax(double& min, double& max) const
656{
657 min = m_dataRangeInMin;
658 max = m_dataRangeInMax;
659}
660
666
667inline double
672
673inline int
675{
676 return m_nbArgs;
677}
678
679inline bool
684
685inline void
687{
688 m_undefValue = undefinedValue;
689}
690
691inline bool
696
697inline void
699{
700 m_inputFileName = inputFileName;
701
703}
704
705inline SbString
710
711inline SoDataSet*
716
717inline void
719{
720 m_inputVolume = inputVolume;
721}
722
723inline bool
728
729inline int
734
735inline bool
736SoConverterParameters::isForEditing() const
737{
738 return m_isForEditing;
739}
740
741inline void
742SoConverterParameters::setDefaultValue(const double value)
743{
744 m_defaultValue = value;
745}
746
747inline double
748SoConverterParameters::getDefaultValue() const
749{
750 return m_defaultValue;
751}
752
753inline bool
754SoConverterParameters::isTileDimDefault()
755{
757}
758
759inline bool
764
765inline void
766SoConverterParameters::saveAsBitSet( bool flag, double bitsetThreshold )
767{
768 m_savedAsBitSet = flag;
769
770 if ( flag )
771 m_bitsetThreshold = bitsetThreshold;
772}
773
774inline void
776{
777 m_isRGBAModeDefault = false;
778 m_RGBAMode = flag;
779}
780
781inline bool
783{
784 return m_RGBAMode;
785}
786
787inline void
789{
790 m_doHistogram = flag;
791}
792
793inline bool
798
799inline void
800SoConverterParameters::enableRecomputeHistogram(const bool flag)
801{
803}
804
805inline bool
806SoConverterParameters::recomputeHistogram() const
807{
809}
810
811inline void
812SoConverterParameters::enableTileMinMax(const bool flag)
813{
814 m_doTileMinMax = flag;
815}
816
817inline bool
818SoConverterParameters::isTileMinMaxEnabled() const
819{
820 return m_doTileMinMax;
821}
822
823inline bool
824SoConverterParameters::isRGBAModeDefault() const
825{
826 return m_isRGBAModeDefault;
827}
828
829inline double
834
835inline void
837{
838 m_bitsetThreshold = bitsetThreshold;
839}
840
841inline bool
842SoConverterParameters::isFromWriter() const
843{
844 return m_bFromWriter;
845}
846
847inline void
848SoConverterParameters::setIsFromWriter( bool flag )
849{
850 m_bFromWriter = flag;
851}
852
853inline void
855{
856 m_doUpdate = flag;
857}
858
859inline bool
861{
862 return m_doUpdate;
863}
864
865inline bool
870
871inline void
876
877#endif //_SO_BASE_CONVERTER_
878
879
static SbString getBaseName(const SbString &fullFilePath)
Returns the filename part of a full path string.
Class for smart character strings.
Definition SbString.h:202
void makeEmpty(const SbBool freeOld=TRUE)
Sets string to be the empty string ("").
Maintains a list of pointers to SbString instances.
3D vector class.
Definition SbVec.h:1517
<a href="IconLegend.html"><img src="extLDM.gif" alt="Large Data Management" border="0"></a> Containe...
void setTileDim(const int tileDim)
Set tile dimension.
virtual ~SoConverterParameters()
Destructor.
void setBitSetThreshold(double bitsetThreshold)
Set the bitset threshold value.
void getInputRangeMinMax(double &min, double &max) const
Returns input data range.
int getTargetWordFormat() const
Returns word format property.
SoDataSet * getInputVolume() const
Returns the the volume used as input.
bool setCompressionName(const SbString &compressionName)
Set compression name.
bool isInputDataRangeSpecified() const
Return whether or not the input data range has been specified.
bool isForUpdate() const
Return TRUE if converter is configured to perform a simple update.
SoConverterParameters()
Default constructor.
void setHeaderFileName(const SbString &headerFileName)
Set header filename (i.e.
int getMaxMemory() const
Returns max memory available for converter.
void setCompressionLevel(int compressionLevel)
Set compression level.
bool isHistogramEnabled() const
Returns true if histogram will be computed.
double getBitSetThreshold() const
Returns the bitset generation threshold value.
bool isVerbose() const
Returns verbose mode setting.
SbString getDataSectionFileName() const
Returns the data filename.
SoDataSet::DataType getOutputDataFormat() const
Returns the output data format.
@ DECIMATION
Decimation : Only one voxel out of two.
@ AVERAGE
Average : Voxel value in parent tile is an average of Neighbor voxel in child tile.
void setInputFileName(const SbString &inputFileName)
Set the input filename.
static SoConverterParameters * create(const SbStringList &arguments)
Static method to build a parameters container from command line arguments.
void setVerticalFlip(bool flag)
Set the m_bVerticalFlip flag.
void setOutputHeaderOnly(bool headerOnly)
Set the header only feature.
bool setTargetWordFormat(int wordFormat)
Set the target machine word format.
bool setInputRangeMinMax(double min, double max)
Set the input data range to map to the output data format.
bool setOutputDataFormat(const SoDataSet::DataType &dataType)
Set the output data format with an SoDataSet::DataType.
bool isOutputDataTypeSpecified() const
Return whether or not the output data type has been specified.
void setRGBAMode(const bool flag)
Set RGBA data mode (output will be unsigned int32 RGBA values).
void setVerbose(const bool isVerbose)
Set verbose mode.
@ PARAM_ERROR
Input params problems.
void setDataFileName(const SbString &dataFileName)
Set data filename (i.e.
int getNbArgs() const
Returns the number of arguments set during init.
double getUndefinedValue() const
Returns the undefined value.
SbString getCompressionName() const
Returns compression type.
bool setMaxMemory(int maxMemory)
Set maximum memory available for the converter, in MB.
bool isRGBAMode() const
Returns true if RGBA mode.
void enableHistogram(const bool flag)
Specify if the histogram must be computed or not.
SbString getHeaderFileName() const
Returns header filename.
void setInputVolume(SoDataSet *inputVolume)
Define the volume used as input.
bool isSavedAsBitSet() const
Returns true if output will be saved as a bitset (ie: 8 values per byte)
bool getOutputHeaderOnly() const
Returns header only setting.
SoDataSet::DataType m_dataTypeOut
void setCrcCheck(bool addCrcCheck)
Set CRC32 check on compression.
void saveAsBitSet(bool flag, double bitsetThreshold=0)
Specify if dataset should be saved as a bitset (8 values per byte) or values.
bool setLowResAlgorithm(int lowResAlgorithm)
Set the algorithm used to build low resolution tiles.
static const char * m_dataTypeXml[]
static SoConverterParameters * create(int argc, char **argv)
Static method to build a parameters container from command line arguments.
SampleType getLowResAlgorithm() const
Returns algorithm used to build low resolution tiles.
int getPondCoef() const
Retrieve the ponderation coefficient for low resolution tiles.
bool isVerticalFlip() const
Return if m_bVerticalFlip flag is set.
void setTileDim(const SbVec3i32 &tileDim)
Set tile dimension.
static const char * m_dataTypeStr[]
bool setOutputDataFormat(const SbString &dataFormat)
Set the output data format from a format string.
void setUndefinedValue(double undefinedValue)
Set the undefined value.
bool m_bVerticalFlip
Flip the output data on Y axis.
SbString getInputFileName() const
Returns input filename.
void doUpdate(bool value)
Only applies to input files in LDM format.
SbString getDataFileName() const
Returns the complete data filename (i.e.: the whole path to .dat file).
SbVec3i32 getTileDim() const
Returns tile dimension.
<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:664