Package com.openinventor.ldm.converters
Class SoConverterParameters
java.lang.Object
com.openinventor.inventor.Inventor
com.openinventor.ldm.converters.SoConverterParameters
Container class for LDM converter parameters.
This class provides a convenient way to specify parameters for the LDM converter.
- See Also:
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic enum
static enum
Nested classes/interfaces inherited from class com.openinventor.inventor.Inventor
Inventor.ConstructorCommand
-
Field Summary
Fields inherited from class com.openinventor.inventor.Inventor
VERBOSE_LEVEL, ZeroHandle
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic SoConverterParameters
Deprecated.static SoConverterParameters
Static method to build a parameters container from command line arguments.void
doUpdate
(boolean value) Only applies to input files in LDM format.void
enableHistogram
(boolean flag) Specify if the histogram must be computed or not.double
Returns the bitset generation threshold value.int
Returns compression type.Returns the complete data filename (i.e.Returns the data filename.Returns header filename.Returns input filename.double[]
Returns input data range.Returns the the volume used as input.Returns algorithm used to build low resolution tiles.int
Returns max memory available for converter.int
Returns the number of arguments set during init.Returns the output data format.boolean
Returns header only setting.int
Retrieve the ponderation coefficient for low resolution tiles.int
Returns word format property.Returns tile dimension.double
Returns the undefined value.boolean
boolean
Return true if converter is configured to perform a simple update.boolean
Returns true if histogram will be computed.boolean
Return whether or not the input data range has been specified.boolean
Return whether or not the output data type has been specified.boolean
Returns true if RGBA mode.boolean
Returns true if output will be saved as a bitset (ie: 8 values per byte)boolean
Returns verbose mode setting.boolean
Return if m_bVerticalFlip flag is set.void
saveAsBitSet
(boolean flag) Calls saveAsBitSet(flag, (double)0).void
saveAsBitSet
(boolean flag, double bitsetThreshold) Specify if dataset should be saved as a bitset (8 values per byte) or values.void
setBitSetThreshold
(double bitsetThreshold) Set the bitset threshold value.void
setCompressionLevel
(int compressionLevel) Set compression level.boolean
setCompressionName
(String compressionName) Set compression name.void
setCrcCheck
(boolean addCrcCheck) Set CRC32 check on compression.void
setDataFileName
(String dataFileName) Set data filename (i.e.void
setHeaderFileName
(String headerFileName) Set header filename (i.e.void
setInputFileName
(String inputFileName) Set the input filename.boolean
setInputRangeMinMax
(double min, double max) Set the input data range to map to the output data format.void
setInputVolume
(SoDataSet inputVolume) Define the volume used as input.boolean
setLowResAlgorithm
(int lowResAlgorithm) Set the algorithm used to build low resolution tiles.boolean
setMaxMemory
(int maxMemory) Set maximum memory available for the converter, in MB.boolean
setOutputDataFormat
(SoDataSet.DataTypes dataType) Set the output data format with anSoDataSet.DataType
.boolean
setOutputDataFormat
(String dataFormat) Set the output data format from a format string.void
setOutputHeaderOnly
(boolean headerOnly) Set the header only feature.void
setRGBAMode
(boolean flag) Set RGBA data mode (output will be unsigned int32 RGBA values).boolean
setTargetWordFormat
(int wordFormat) Set the target machine word format.void
setTileDim
(int tileDim) Set tile dimension.void
setTileDim
(SbVec3i32 tileDim) Set tile dimension.void
setUndefinedValue
(double undefinedValue) Set the undefined value.void
setVerbose
(boolean isVerbose) Set verbose mode.void
setVerticalFlip
(boolean flag) Set the m_bVerticalFlip flag.boolean
Methods inherited from class com.openinventor.inventor.Inventor
dispose, getNativeResourceHandle
-
Constructor Details
-
SoConverterParameters
public SoConverterParameters()Default constructor.
-
-
Method Details
-
create
Deprecated.As of Open Inventor 9.3, usecreate(String[])
instead.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. -
saveAsBitSet
public void saveAsBitSet(boolean flag) Calls saveAsBitSet(flag, (double)0). -
getBitSetThreshold
public double getBitSetThreshold()Returns the bitset generation threshold value. -
setTileDim
public void setTileDim(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. -
setBitSetThreshold
public void setBitSetThreshold(double bitsetThreshold) 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.
-
setTileDim
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. -
getTileDim
Returns tile dimension. -
isSavedAsBitSet
public boolean isSavedAsBitSet()Returns true if output will be saved as a bitset (ie: 8 values per byte) -
getHeaderFileName
Returns header filename. -
saveAsBitSet
public void saveAsBitSet(boolean flag, double bitsetThreshold) 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.
-
setHeaderFileName
Set header filename (i.e. the .ldm filename).
Like the -o command line argument. Default is input filename with extension .ldm. -
isVerticalFlip
public boolean isVerticalFlip()Return if m_bVerticalFlip flag is set. -
getCompressionLevel
public int getCompressionLevel() -
create
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. -
setVerticalFlip
public void setVerticalFlip(boolean flag) Set the m_bVerticalFlip flag. -
isVerbose
public boolean isVerbose()Returns verbose mode setting. -
doUpdate
public void doUpdate(boolean value) 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. -
setVerbose
public void setVerbose(boolean isVerbose) Set verbose mode. Default value is On. -
isForUpdate
public boolean isForUpdate()Return true if converter is configured to perform a simple update. Return false otherwise -
useDefaultCompLvl
public boolean useDefaultCompLvl() -
setOutputDataFormat
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).
-
isCrcCheckDone
public boolean isCrcCheckDone() -
setOutputDataFormat
Set the output data format with anSoDataSet.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. -
setLowResAlgorithm
public boolean 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.
-
setOutputHeaderOnly
public void setOutputHeaderOnly(boolean headerOnly) 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. -
getPondCoef
public int getPondCoef()Retrieve the ponderation coefficient for low resolution tiles.
Only relevant when low resolution algorithm is set to AVERAGE. -
getOutputHeaderOnly
public boolean getOutputHeaderOnly()Returns header only setting. -
getLowResAlgorithm
Returns algorithm used to build low resolution tiles. -
getInputRangeMinMax
public double[] getInputRangeMinMax()Returns input data range. -
setCrcCheck
public void setCrcCheck(boolean addCrcCheck) 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. -
setCompressionName
Set compression name.
Like the -c command line argument. See alsosetCompressionLevel()
. The following compression types are currently supported:.- gzip:
This is a lossless compression and can be used on any type of data. SeeSoGzipDataCompressor
. - jpeg:
This is a lossy compression. SeeSoJpegDataCompressor
.
Limitation: Can only be used on 8-bit scalar data sets.
Returns true if parameter is valid, else returns false.
- gzip:
-
setCompressionLevel
public void setCompressionLevel(int compressionLevel) Set compression level.
Like the -l command line argument. See alsosetCompressionName()
. 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.
- gzip
-
setInputRangeMinMax
public boolean 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. -
setTargetWordFormat
public boolean 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. -
getOutputDataFormat
Returns the output data format. -
getCompressionName
Returns compression type. -
getTargetWordFormat
public int getTargetWordFormat()Returns word format property. -
setRGBAMode
public void setRGBAMode(boolean flag) Set RGBA data mode (output will be unsigned int32 RGBA values). -
getDataFileName
Returns the complete data filename (i.e. : the whole path to .dat file). -
isInputDataRangeSpecified
public boolean isInputDataRangeSpecified()Return whether or not the input data range has been specified. -
setInputFileName
Set the input filename. This is the file containing data to convert. Alternative tosetInputVolume()
. An input file must be specified. To get more information regarding possible limitation of any readers you may use, please see documentation of Readers. -
isRGBAMode
public boolean isRGBAMode()Returns true if RGBA mode. -
setDataFileName
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. -
isHistogramEnabled
public boolean isHistogramEnabled()Returns true if histogram will be computed. -
getDataSectionFileName
Returns the data filename. -
enableHistogram
public void enableHistogram(boolean flag) 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.
-
setMaxMemory
public boolean 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. -
getUndefinedValue
public double getUndefinedValue()Returns the undefined value. -
getMaxMemory
public int getMaxMemory()Returns max memory available for converter. -
setUndefinedValue
public void setUndefinedValue(double undefinedValue) 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 bySoHeightFieldRender
(vertices with undefined values are not rendered). -
getInputVolume
Returns the the volume used as input. -
isOutputDataTypeSpecified
public boolean isOutputDataTypeSpecified()Return whether or not the output data type has been specified. -
getInputFileName
Returns input filename. -
getNbArgs
public int getNbArgs()Returns the number of arguments set during init. -
setInputVolume
Define the volume used as input. Allows to convert in-memory data to a LDM file. Alternative tosetInputFileName()
.
-
create(String[])
instead.