Container class for LDM converter parameters More...
#include <LDM/converters/SoConverterParameters.h>
Public Types | |
enum | SampleType { DECIMATION , AVERAGE } |
enum | ParametersError { PARAM_NO_ERROR = 0 , PARAM_ERROR = -1 } |
Public Member Functions | |
SoConverterParameters () | |
Default constructor. | |
virtual | ~SoConverterParameters () |
Destructor. | |
void | setVerbose (const bool isVerbose) |
Set verbose mode. | |
bool | isVerbose () const |
Returns verbose mode setting. | |
void | setTileDim (const int tileDim) |
Set tile dimension. | |
void | setTileDim (const SbVec3i32 &tileDim) |
Set tile dimension. | |
SbVec3i32 | getTileDim () const |
Returns tile dimension. | |
void | setHeaderFileName (const SbString &headerFileName) |
Set header filename (i.e. | |
SbString | getHeaderFileName () const |
Returns header filename. | |
void | setDataFileName (const SbString &dataFileName) |
Set data filename (i.e. | |
SbString | getDataSectionFileName () const |
Returns the data filename. | |
SbString | getDataFileName () const |
Returns the complete data filename (i.e.: the whole path to .dat file). | |
void | setInputFileName (const SbString &inputFileName) |
Set the input filename. | |
SbString | getInputFileName () const |
Returns input filename. | |
void | setInputVolume (SoDataSet *inputVolume) |
Define the volume used as input. | |
SoDataSet * | getInputVolume () const |
Returns the the volume used as input. | |
bool | setMaxMemory (int maxMemory) |
Set maximum memory available for the converter, in MB. | |
int | getMaxMemory () const |
Returns max memory available for converter. | |
void | setOutputHeaderOnly (bool headerOnly) |
Set the header only feature. | |
bool | getOutputHeaderOnly () const |
Returns header only setting. | |
bool | setOutputDataFormat (const SbString &dataFormat) |
Set the output data format from a format string. | |
bool | setOutputDataFormat (const SoDataSet::DataType &dataType) |
Set the output data format with an SoDataSet::DataType. | |
SoDataSet::DataType | getOutputDataFormat () const |
Returns the output data format. | |
bool | setTargetWordFormat (int wordFormat) |
Set the target machine word format. | |
int | getTargetWordFormat () const |
Returns word format property. | |
bool | setInputRangeMinMax (double min, double max) |
Set the input data range to map to the output data format. | |
void | getInputRangeMinMax (double &min, double &max) const |
Returns input data range. | |
bool | setCompressionName (const SbString &compressionName) |
Set compression name. | |
void | setCompressionLevel (int compressionLevel) |
Set compression level. | |
void | setCrcCheck (bool addCrcCheck) |
Set CRC32 check on compression. | |
SbString | getCompressionName () const |
Returns compression type. | |
int | getCompressionLevel () const |
bool | isCrcCheckDone () const |
bool | useDefaultCompLvl () const |
bool | setLowResAlgorithm (int lowResAlgorithm) |
Set the algorithm used to build low resolution tiles. | |
SampleType | getLowResAlgorithm () const |
Returns algorithm used to build low resolution tiles. | |
int | getPondCoef () const |
Retrieve the ponderation coefficient for low resolution tiles. | |
void | setUndefinedValue (double undefinedValue) |
Set the undefined value. | |
double | getUndefinedValue () const |
Returns the undefined value. | |
int | getNbArgs () const |
Returns the number of arguments set during init. | |
bool | isOutputDataTypeSpecified () const |
Return whether or not the output data type has been specified. | |
bool | isInputDataRangeSpecified () const |
Return whether or not the input data range has been specified. | |
void | setRGBAMode (const bool flag) |
Set RGBA data mode (output will be unsigned int32 RGBA values). | |
bool | isRGBAMode () const |
Returns true if RGBA mode. | |
void | enableHistogram (const bool flag) |
Specify if the histogram must be computed or not. | |
bool | isHistogramEnabled () const |
Returns true if histogram will be computed. | |
bool | isSavedAsBitSet () const |
Returns true if output will be saved as a bitset (ie: 8 values per byte) | |
void | saveAsBitSet (bool flag, double bitsetThreshold=0) |
Specify if dataset should be saved as a bitset (8 values per byte) or values. | |
double | getBitSetThreshold () const |
Returns the bitset generation threshold value. | |
void | setBitSetThreshold (double bitsetThreshold) |
Set the bitset threshold value. | |
void | doUpdate (bool value) |
Only applies to input files in LDM format. | |
bool | isForUpdate () const |
Return TRUE if converter is configured to perform a simple update. | |
void | setVerticalFlip (bool flag) |
Set the m_bVerticalFlip flag. | |
bool | isVerticalFlip () const |
Return if m_bVerticalFlip flag is set. | |
Static Public Member Functions | |
static SoConverterParameters * | create (int argc, char **argv) |
Static method to build a parameters container from command line arguments. | |
static SoConverterParameters * | create (const SbStringList &arguments) |
Static method to build a parameters container from command line 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_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 |
SoDataSet * | m_inputVolume |
SbString | m_inputFileName |
SbString | m_compressionName |
SampleType | m_sampleType |
SoDataSet::DataType | m_dataTypeOut |
SbVec3i32 | m_tileDim |
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 |
Flip the output data on Y axis. | |
bool | m_bFromWriter |
Static Protected Attributes | |
static const char * | m_dataTypeStr [] |
static const char * | m_dataTypeXml [] |
Container class for LDM converter parameters
This class provides a convenient way to specify parameters for the LDM converter.
Definition at line 51 of file SoConverterParameters.h.
Enumerator | |
---|---|
PARAM_NO_ERROR | No error. |
PARAM_ERROR | Input params problems. |
Definition at line 67 of file SoConverterParameters.h.
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. |
Definition at line 55 of file SoConverterParameters.h.
SoConverterParameters::SoConverterParameters | ( | ) |
Default constructor.
|
virtual |
Destructor.
|
protected |
|
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 |
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.
|
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.
Definition at line 854 of file SoConverterParameters.h.
|
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:
Note also that if RGBA mode is set then no histogram is computed.
Definition at line 788 of file SoConverterParameters.h.
|
inline |
Returns the bitset generation threshold value.
Definition at line 830 of file SoConverterParameters.h.
|
inline |
Definition at line 637 of file SoConverterParameters.h.
|
inline |
Returns compression type.
Definition at line 631 of file SoConverterParameters.h.
|
inline |
Returns the complete data filename (i.e.: the whole path to .dat file).
Definition at line 595 of file SoConverterParameters.h.
|
inline |
Returns the data filename.
Definition at line 582 of file SoConverterParameters.h.
|
inline |
Returns header filename.
Definition at line 576 of file SoConverterParameters.h.
|
inline |
Returns input filename.
Definition at line 706 of file SoConverterParameters.h.
|
inline |
Returns input data range.
Definition at line 655 of file SoConverterParameters.h.
|
inline |
Returns the the volume used as input.
Definition at line 712 of file SoConverterParameters.h.
|
inline |
Returns algorithm used to build low resolution tiles.
Definition at line 662 of file SoConverterParameters.h.
|
inline |
Returns max memory available for converter.
Definition at line 601 of file SoConverterParameters.h.
|
inline |
Returns the number of arguments set during init.
Definition at line 674 of file SoConverterParameters.h.
|
inline |
Returns the output data format.
Definition at line 619 of file SoConverterParameters.h.
|
inline |
Returns header only setting.
Definition at line 607 of file SoConverterParameters.h.
|
inline |
Retrieve the ponderation coefficient for low resolution tiles.
Only relevant when low resolution algorithm is set to AVERAGE.
Definition at line 730 of file SoConverterParameters.h.
|
inline |
Returns word format property.
Definition at line 625 of file SoConverterParameters.h.
|
inline |
Returns tile dimension.
Definition at line 561 of file SoConverterParameters.h.
|
inline |
Returns the undefined value.
Definition at line 668 of file SoConverterParameters.h.
|
inline |
Definition at line 643 of file SoConverterParameters.h.
|
inline |
Return TRUE if converter is configured to perform a simple update.
Return FALSE otherwise
Definition at line 860 of file SoConverterParameters.h.
|
inline |
Returns true if histogram will be computed.
Definition at line 794 of file SoConverterParameters.h.
|
inline |
Return whether or not the input data range has been specified.
Definition at line 724 of file SoConverterParameters.h.
|
inline |
Return whether or not the output data type has been specified.
Definition at line 692 of file SoConverterParameters.h.
|
inline |
Returns true if RGBA mode.
Definition at line 782 of file SoConverterParameters.h.
|
inline |
Returns true if output will be saved as a bitset (ie: 8 values per byte)
Definition at line 760 of file SoConverterParameters.h.
|
inline |
Returns verbose mode setting.
Definition at line 549 of file SoConverterParameters.h.
|
inline |
Return if m_bVerticalFlip flag is set.
Definition at line 866 of file SoConverterParameters.h.
|
inline |
Specify if dataset should be saved as a bitset (8 values per byte) or values.
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. |
Definition at line 766 of file SoConverterParameters.h.
|
inline |
Set the bitset threshold value.
Whichever was called last, saveAsBitSet or this method, determines the threshold value that will be used.
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. |
Definition at line 836 of file SoConverterParameters.h.
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:
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:.
Returns true if parameter is valid, else returns false.
|
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.
Definition at line 649 of file SoConverterParameters.h.
|
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.
Definition at line 588 of file SoConverterParameters.h.
|
inline |
Set header filename (i.e.
the .ldm filename).
Like the -o command line argument. Default is input filename with extension .ldm.
Definition at line 567 of file SoConverterParameters.h.
|
inline |
Set the input filename.
This is the file containing data to convert. Alternative to setInputVolume(). An input file must be specified. To get more information regarding possible limitation of any readers you may use, please see documentation of Readers.
Definition at line 698 of file SoConverterParameters.h.
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.
|
inline |
Define the volume used as input.
Allows to convert in-memory data to a LDM file. Alternative to setInputFileName().
Definition at line 718 of file SoConverterParameters.h.
bool SoConverterParameters::setLowResAlgorithm | ( | int | lowResAlgorithm | ) |
Set the algorithm used to build low resolution tiles.
Available options are :
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 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
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).
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.
|
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.
Definition at line 613 of file SoConverterParameters.h.
|
inline |
Set RGBA data mode (output will be unsigned int32 RGBA values).
Definition at line 775 of file SoConverterParameters.h.
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 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::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.
|
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).
Definition at line 686 of file SoConverterParameters.h.
|
inline |
|
inline |
Set the m_bVerticalFlip flag.
Definition at line 872 of file SoConverterParameters.h.
|
inline |
Definition at line 680 of file SoConverterParameters.h.
|
protected |
Definition at line 541 of file SoConverterParameters.h.
|
protected |
Definition at line 535 of file SoConverterParameters.h.
|
protected |
Flip the output data on Y axis.
Definition at line 538 of file SoConverterParameters.h.
|
protected |
Definition at line 503 of file SoConverterParameters.h.
|
protected |
Definition at line 517 of file SoConverterParameters.h.
|
protected |
Definition at line 496 of file SoConverterParameters.h.
|
protected |
Definition at line 513 of file SoConverterParameters.h.
|
protected |
Definition at line 509 of file SoConverterParameters.h.
|
protected |
Definition at line 508 of file SoConverterParameters.h.
|
protected |
Definition at line 512 of file SoConverterParameters.h.
|
protected |
Definition at line 520 of file SoConverterParameters.h.
|
staticprotected |
Definition at line 524 of file SoConverterParameters.h.
|
staticprotected |
Definition at line 525 of file SoConverterParameters.h.
|
protected |
Definition at line 498 of file SoConverterParameters.h.
|
protected |
Definition at line 532 of file SoConverterParameters.h.
|
protected |
Definition at line 534 of file SoConverterParameters.h.
|
protected |
Definition at line 536 of file SoConverterParameters.h.
|
protected |
Definition at line 511 of file SoConverterParameters.h.
|
protected |
Definition at line 495 of file SoConverterParameters.h.
|
protected |
Definition at line 494 of file SoConverterParameters.h.
|
protected |
Definition at line 516 of file SoConverterParameters.h.
|
protected |
Definition at line 514 of file SoConverterParameters.h.
|
protected |
Definition at line 528 of file SoConverterParameters.h.
|
protected |
Definition at line 531 of file SoConverterParameters.h.
|
protected |
Definition at line 529 of file SoConverterParameters.h.
|
protected |
Definition at line 501 of file SoConverterParameters.h.
|
protected |
Definition at line 505 of file SoConverterParameters.h.
|
protected |
Definition at line 493 of file SoConverterParameters.h.
|
protected |
Definition at line 504 of file SoConverterParameters.h.
|
protected |
Definition at line 533 of file SoConverterParameters.h.
|
protected |
Definition at line 499 of file SoConverterParameters.h.
|
protected |
Definition at line 519 of file SoConverterParameters.h.
|
protected |
Definition at line 530 of file SoConverterParameters.h.
|
protected |
Definition at line 502 of file SoConverterParameters.h.
|
protected |
Definition at line 521 of file SoConverterParameters.h.
|
protected |
Definition at line 507 of file SoConverterParameters.h.
|
protected |
Definition at line 497 of file SoConverterParameters.h.
|
protected |
Definition at line 492 of file SoConverterParameters.h.