SoConverterParameters Class Reference
[Converters]

Large Data Management Container class for LDM converter parameters More...

#include <LDM/converters/SoConverterParameters.h>

List of all members.

Public Types

enum  SampleType {
  DECIMATION,
  AVERAGE
}
enum  ParametersError {
  PARAM_NO_ERROR = 0,
  PARAM_ERROR = -1
}

Public Member Functions

 SoConverterParameters ()
virtual ~SoConverterParameters ()
void setVerbose (const bool isVerbose)
bool isVerbose () const
void setTileDim (const int tileDim)
void setTileDim (const SbVec3i32 &tileDim)
SbVec3i32 getTileDim () const
void setHeaderFileName (const SbString &headerFileName)
SbString getHeaderFileName () const
void setDataFileName (const SbString &dataFileName)
SbString getDataSectionFileName () const
SbString getDataFileName () const
void setInputFileName (const SbString &inputFileName)
SbString getInputFileName () const
void setInputVolume (SoDataSet *inputVolume)
SoDataSetgetInputVolume () const
bool setMaxMemory (int maxMemory)
int getMaxMemory () const
void setOutputHeaderOnly (bool headerOnly)
bool getOutputHeaderOnly () const
bool setOutputDataFormat (const SbString &dataFormat)
bool setOutputDataFormat (const SoDataSet::DataType &dataType)
SoDataSet::DataType getOutputDataFormat () const
bool setTargetWordFormat (int wordFormat)
int getTargetWordFormat () const
bool setInputRangeMinMax (double min, double max)
void getInputRangeMinMax (double &min, double &max) const
bool setCompressionName (const SbString &compressionName)
void setCompressionLevel (int compressionLevel)
void setCrcCheck (bool addCrcCheck)
SbString getCompressionName () const
int getCompressionLevel () const
bool isCrcCheckDone () const
bool useDefaultCompLvl () const
bool setLowResAlgorithm (int lowResAlgorithm)
SampleType getLowResAlgorithm () const
int getPondCoef () const
void setUndefinedValue (double undefinedValue)
double getUndefinedValue () const
int getNbArgs () const
bool isOutputDataTypeSpecified () const
bool isInputDataRangeSpecified () const
void setRGBAMode (const bool flag)
bool isRGBAMode () const
void enableHistogram (const bool flag)
bool isHistogramEnabled () const
bool isSavedAsBitSet () const
void saveAsBitSet (bool flag, double bitsetThreshold=0)
double getBitSetThreshold () const
void setBitSetThreshold (double bitsetThreshold)
void doUpdate (bool value)
bool isForUpdate () const

Static Public Member Functions

static SoConverterParameterscreate (int argc, char **argv)
static SoConverterParameterscreate (const SbStringList &arguments)

Protected Member Functions

void buildOutputFileName ()

Protected Attributes

bool m_verboseMode
bool m_outputDataTypeSpecified
bool m_inputDataRangeSpecified
bool m_headerOnly
bool m_crcCheck
bool m_useDefaultCompLevel
double m_defaultValue
bool m_RGBAMode
int m_memSize
int m_currentWordFormat
int m_targetWordFormat
int m_compressionLevel
int m_pondCoeff
int m_nbArgs
double m_undefValue
double m_dataRangeInMin
double m_dataRangeInMax
SbString m_headerFileName
SbString m_dataSectionFileName
SbString m_dataFileName
SoDataSetm_inputVolume
SbString m_inputFileName
SbString m_fileExt
SbString m_compressionName
SampleType m_sampleType
SoDataSet::DataType m_dataTypeOut
SbVec3i32 m_tileDim
SbStringList m_argListAsSbString
bool m_isForEditing
bool m_isTileDimDefaultValue
bool m_savedAsBitSet
bool m_isRGBAModeDefault
bool m_doHistogram
bool m_recomputeHistogram
bool m_doTileMinMax
double m_bitsetThreshold
bool m_doUpdate
bool m_bVerticalFlip
bool m_bFromWriter

Static Protected Attributes

static const char * m_dataTypeStr []
static const char * m_dataTypeXml []

Detailed Description

Large Data Management Container class for LDM converter parameters

This class provides a convenient way to specify parameters for the LDM converter.

SEE ALSO

SoConverter

See related examples:

LDMConverter, LDMConverterExample, LDMSegYConverter


Member Enumeration Documentation

Enumerator:
PARAM_NO_ERROR 

No error.

PARAM_ERROR 

Input params problems.

Enumerator:
DECIMATION 

Decimation : Only one voxel out of two.

AVERAGE 

Average : Voxel value in parent tile is an average of Neighbor voxel in child tile.


Constructor & Destructor Documentation

SoConverterParameters::SoConverterParameters (  ) 

Default constructor.

virtual SoConverterParameters::~SoConverterParameters (  )  [virtual]

Destructor.


Member Function Documentation

void SoConverterParameters::buildOutputFileName (  )  [protected]
static SoConverterParameters* SoConverterParameters::create ( const SbStringList arguments  )  [static]

Static method to build a parameters container from command line arguments.


The method returns NULL if an error is detected in the parameters. Otherwise, it returns a pointer to an instance of the class, initialized with given parameters See SoConverter::converter for a list of command line arguments.

Note: SbStringList is a list of pointers, not a list of objects, so the destructor for this class does not free the memory associated with the SbString objects. The application is responsible for deleting each object in the list.

static SoConverterParameters* SoConverterParameters::create ( int  argc,
char **  argv 
) [static]

Static method to build a parameters container from command line arguments.


The method returns NULL if an error is detected in the arguments. Otherwise, it returns a pointer to an instance of the class, initialized with given parameters. See SoConverter::converter for a list of command line arguments.

void SoConverterParameters::doUpdate ( bool  value  )  [inline]

Only applies to input files in LDM format.

If true the converter must just perform an update of the given file. This means that if no options are specified, the converter will retrieve information from the input file and apply its properties automatically to the generated file.

void SoConverterParameters::enableHistogram ( const bool  flag  )  [inline]

Specify if the histogram must be computed or not.

Default is true.

Disabling Histogram generation will greatly speedup the conversion process, but some VolumeViz rendering features and optimizations won't be available.

It also implies that the following information won't be computed:

  • dataset min and max values
  • per Tile min max values

Note also that if RGBA mode is set then no histogram is computed.

double SoConverterParameters::getBitSetThreshold (  )  const [inline]

Returns the bitset generation threshold value.

int SoConverterParameters::getCompressionLevel (  )  const [inline]
SbString SoConverterParameters::getCompressionName (  )  const [inline]

Returns compression type.

SbString SoConverterParameters::getDataFileName (  )  const [inline]

Returns the complete data filename (i.e.

: the whole path to .dat file).

SbString SoConverterParameters::getDataSectionFileName (  )  const [inline]

Returns the data filename.

SbString SoConverterParameters::getHeaderFileName (  )  const [inline]

Returns header filename.

SbString SoConverterParameters::getInputFileName (  )  const [inline]

Returns input filename.

void SoConverterParameters::getInputRangeMinMax ( double &  min,
double &  max 
) const [inline]

Returns input data range.

SoDataSet * SoConverterParameters::getInputVolume (  )  const [inline]

Returns the the volume used as input.

SoConverterParameters::SampleType SoConverterParameters::getLowResAlgorithm (  )  const [inline]

Returns algorithm used to build low resolution tiles.

int SoConverterParameters::getMaxMemory (  )  const [inline]

Returns max memory available for converter.

int SoConverterParameters::getNbArgs (  )  const [inline]

Returns the number of arguments set during init.

SoDataSet::DataType SoConverterParameters::getOutputDataFormat (  )  const [inline]

Returns the output data format.

bool SoConverterParameters::getOutputHeaderOnly (  )  const [inline]

Returns header only setting.

int SoConverterParameters::getPondCoef (  )  const [inline]

Retrieve the ponderation coefficient for low resolution tiles.


Only relevant when low resolution algorithm is set to AVERAGE.

int SoConverterParameters::getTargetWordFormat (  )  const [inline]

Returns word format property.

SbVec3i32 SoConverterParameters::getTileDim (  )  const [inline]

Returns tile dimension.

double SoConverterParameters::getUndefinedValue (  )  const [inline]

Returns the undefined value.

bool SoConverterParameters::isCrcCheckDone (  )  const [inline]
bool SoConverterParameters::isForUpdate (  )  const [inline]

Return TRUE if converter is configured to perform a simple update.

Return FALSE otherwise

bool SoConverterParameters::isHistogramEnabled (  )  const [inline]

Returns true if histogram will be computed.

bool SoConverterParameters::isInputDataRangeSpecified (  )  const [inline]

Return whether or not the input data range has been specified.

bool SoConverterParameters::isOutputDataTypeSpecified (  )  const [inline]

Return whether or not the output data type has been specified.

bool SoConverterParameters::isRGBAMode (  )  const [inline]

Returns true if RGBA mode.

bool SoConverterParameters::isSavedAsBitSet (  )  const [inline]

Returns true if output will be saved as a bitset (ie: 8 values per byte).

bool SoConverterParameters::isVerbose (  )  const [inline]

Returns verbose mode setting.

void SoConverterParameters::saveAsBitSet ( bool  flag,
double  bitsetThreshold = 0 
) [inline]

Specify if dataset should be saved as a bitset (8 values per byte) or values.

Parameters:
flag Dataset is a bitset (true) or values (false)
bitsetThreshold For each value (V) of a dataset, if V > bitsetThreshold the bitset is set to 1 for this bit, or to 0 otherwise. Used only if flag parameter is set to true. Default is 0.
void SoConverterParameters::setBitSetThreshold ( double  bitsetThreshold  )  [inline]

Set the bitset threshold value.


Whichever was called last, saveAsBitSet or this method, determines the threshold value that will be used.

Parameters:
bitsetThreshold For each value (V) of a dataset, if V > threshold the bitset is set to 1 for this bit, or to 0 otherwise. Default is 0.
void SoConverterParameters::setCompressionLevel ( int  compressionLevel  ) 

Set compression level.


Like the -l command line argument. See also setCompressionName(). The meaning of this parameter depends on the type of compression used:

  • gzip
    Level must be between 0 and 9: 0 gives no compression, 9 gives best compression but slower speed. Default is 3.
  • jpeg:
    Level must be between 0 and 100: 0 gives best compression but most loss of data, 100 gives minimum compression and minimum data alteration. Default is 85.
  • jp3d:
    A level of 0 specifies the lossless mode, and any other value sets the target PSNR (Peak Signal to Noise Ratio). Typical values for PSNR are: 70dB for near lossless mode, and 40dB for visually lossless mode.
bool SoConverterParameters::setCompressionName ( const SbString compressionName  ) 

Set compression name.


Like the -c command line argument. See also setCompressionLevel(). The following compression types are currently supported:.

  • gzip:
    This is a lossless compression and can be used on any type of data. See SoGzipDataCompressor.
  • jpeg:
    This is a lossy compression. See SoJpegDataCompressor.
    Limitation: Can only be used on 8-bit scalar data sets.
  • jp3d:
    This is a wavelet compression that can be lossless or lossy. See SoJp3dDataCompressor.
    Limitation: 32 bit data values (float or integer) are always converted to 16 bit values.

Returns true if parameter is valid, else returns false.

void SoConverterParameters::setCrcCheck ( bool  addCrcCheck  )  [inline]

Set CRC32 check on compression.


Like -C command line argument. When compression is enabled using -c, adds a data integrity check value to all compressed tiles. If the environment variable LDM_COMPRESS_CHECK_CRC32 is set, data values will be checked each time they are read from disk. Default is false.

void SoConverterParameters::setDataFileName ( const SbString dataFileName  )  [inline]

Set data filename (i.e.

the .dat filename).
Like the -O command line argument. Default is the same as the header file, with .dat extension.

void SoConverterParameters::setHeaderFileName ( const SbString headerFileName  )  [inline]

Set header filename (i.e.

the .ldm filename).
Like the -o command line argument. Default is input filename with extension .ldm.

void SoConverterParameters::setInputFileName ( const SbString inputFileName  )  [inline]

Set the input filename.

This is the file containing data to convert. Alternative to setInputVolume(). An input file must be specified.

bool SoConverterParameters::setInputRangeMinMax ( double  min,
double  max 
)

Set the input data range to map to the output data format.


Like the -r command line argument. If not specified, and input type is float and output type is integer, the values are simply cast into the output data type. Returns true if parameter is valid, else returns false.

void SoConverterParameters::setInputVolume ( SoDataSet inputVolume  )  [inline]

Define the volume used as input.

Allows to convert in-memory data to a LDM file. Alternative to setInputFileName().

bool SoConverterParameters::setLowResAlgorithm ( int  lowResAlgorithm  ) 

Set the algorithm used to build low resolution tiles.


Available options are :

  • 0: To use decimation algorithm
  • n: To use average algorithm and give a ponderation coefficient of n to the selected voxel. The default is Decimation. Returns true if parameter is valid, else returns false.
bool SoConverterParameters::setMaxMemory ( int  maxMemory  ) 

Set maximum memory available for the converter, in MB.


Like the -m command line argument. Default value is 512 MB. Returns true if parameter is valid, else returns false.

bool SoConverterParameters::setOutputDataFormat ( const SoDataSet::DataType dataType  ) 

Set the output data format with an SoDataSet::DataType.


Note that if the input reader does not support the requested conversion, the output data format will be the same as the input data format (no conversion) Returns true if parameter is valid, else returns false.

bool SoConverterParameters::setOutputDataFormat ( const SbString dataFormat  ) 

Set the output data format from a format string.


Like the -f command line argument. The format is specified as "u*" for unsigned integer, "s*" for signed integer or "f" for float, where * = 8, 16 or 32. Default is no conversion. Returns true if parameter is valid, else returns false.

Note that if the input reader does not support the requested conversion, the output data format will be the same as the input data format (no conversion).

void SoConverterParameters::setOutputHeaderOnly ( bool  headerOnly  )  [inline]

Set the header only feature.


Like the -h command line argument. If set, the converter will only write the header file. No data will be generated. Default value is Off.

void SoConverterParameters::setRGBAMode ( const bool  flag  )  [inline]

Set RGBA data mode (output will be unsigned int32 RGBA values).

bool SoConverterParameters::setTargetWordFormat ( int  wordFormat  ) 

Set the target machine word format.


Like the -w command line argument. Default is the current machine word format. wordFormat parameter is 0 for Big Endian, and 1 for Little Endian. Returns true if parameter is valid, else returns false.

void SoConverterParameters::setTileDim ( const SbVec3i32 tileDim  ) 

Set tile dimension.


The default value is 128,128,128 and all values must a power of 2. This method can be used to set a different value for each tile dimension, for example for a "thin volume" or height field.

void SoConverterParameters::setTileDim ( const int  tileDim  ) 

Set tile dimension.


Like the -t command line argument. The default is 64 and the value must be a power of 2. The same value is used for all dimensions of the tile.

void SoConverterParameters::setUndefinedValue ( double  undefinedValue  )  [inline]

Set the undefined value.


Like the -u command line argument. The given value will be stored in the LDM file. Default is NaN (Not a Number). This is currently used by SoHeightFieldRender (vertices with undefined values are not rendered).

void SoConverterParameters::setVerbose ( const bool  isVerbose  )  [inline]

Set verbose mode.

Default value is Off.

bool SoConverterParameters::useDefaultCompLvl (  )  const [inline]

Member Data Documentation

const char* SoConverterParameters::m_dataTypeStr[] [static, protected]
const char* SoConverterParameters::m_dataTypeXml[] [static, protected]

The documentation for this class was generated from the following file:

Open Inventor Toolkit reference manual, generated on 28 Oct 2019
Copyright © Thermo Fisher Scientific All rights reserved.
http://www.openinventor.com/