24#ifndef _SO_BASE_CONVERTER_
25#define _SO_BASE_CONVERTER_
28#pragma warning( push )
29#pragma warning(disable:4251)
33#include <LDM/nodes/SoDataSet.h>
34#include <Inventor/STL/vector>
35#include <Inventor/SbBox.h>
36#include <Inventor/SbPList.h>
38#include <Inventor/threads/SbThreadMutex.h>
40#include <LDM/readers/SoLDMReader.h>
41#include <LDM/compressors/SoDataCompressor.h>
47class SoDataCompressInfo;
389 int64_t m_subSliceSize;
394 std::vector<int64_t> m_numValues;
395 std::vector<double> m_values;
397 int m_numTilesGenerated;
405 void checkProgress();
414 char* allocateSlabBuffer(
int& _numTilesOnYAxis,
SbVec3i32& _slabBufferDim, int64_t& _subSliceSize);
415 int buildSlab2Level(
SbBox3i32& slabBox,
char*& slabBufferPtr,
void* parentTile,
void** octantTile,
SbVec3i32& slabBufferDim, int64_t subSliceSize, std::vector<int>& fileIDsBuilt);
416 void buildLevel(std::vector<int>&,
int,
int fromFileID = -1,
int toFileID = -1);
417 int initializeFiles(
int argc,
char ** argv );
420 int writeSubVolume(
const SbBox3i32 & subVolume,
const void * data,
SbBool doLowerResolution = TRUE,
SbBool doOverlappingTiles = TRUE );
421 int writeTile(
const SoLDMTileID & tileID,
void * data );
427 int finalizeFiles(
int retCode = 0 );
428 int buildLevels(
int fromLevel,
int numLevels );
432 void updateFileCompletion(std::vector<int>& fileIDs);
434 std::vector<SoDataSet::DatumElement> m_datum;
451 virtual std::vector<SoDataSet::DatumElement>
getDatum(
int& error) = 0;
453 virtual int getRange(
double & rangeMin,
double & rangeMax) = 0;
471 virtual void sampleTile (
const SbVec3i32& tileDim,
int border,
const void*
const octantTile[8],
const int octantExists[8],
void* parentTile ) = 0;
479 virtual void outputTileBefore(
int SO_UNUSED_PARAM(fileTileIndex),
int SO_UNUSED_PARAM(dataSize),
480 void* SO_UNUSED_PARAM(data),
bool SO_UNUSED_PARAM(dataInverted))
485 virtual void outputTileBefore(
int SO_UNUSED_PARAM(fileTileIndex),
size_t SO_UNUSED_PARAM(dataSize),
486 void* SO_UNUSED_PARAM(data),
bool SO_UNUSED_PARAM(dataInverted))
538 void inputTile(
int fileTileIndex,
size_t dataSize,
void *data,
bool i =
false );
541 void outputTile(
int fileTileIndex,
size_t dataSize,
void*,
bool i =
false );
615 bool m_userDefinedParameters;
618 template <
typename T>
void fillTile(
void* ptrDst,
int size,
void* value );
620 template <
typename T>
void fillTileWithSingleValue(
void* ptrDst,
int size, T value );
626 void computeLowResMinMax(
const SoLDMTileID& tileId);
628 bool m_bComplFileAlreadyExists;
631 void buildTileFast(
int fileID,
void* tileData,
const SbVec3i32& tileOrigin);
636 static bool s_doFastUpdate;
640SoConverter::getParameters()
658#pragma warning( pop )
<a href="IconLegend.html"><img src="extTGS.gif" alt="VSG extension" border="0"></a> 3D box class.
Class for smart character strings.
Maintains a list of pointers to SbString instances.
<a href="IconLegend.html"><img src="extTGS.gif" alt="VSG extension" border="0"></a> Portable mutex c...
<a href="IconLegend.html"><img src="extTGS.gif" alt="VSG extension" border="0"></a> Abstract base cl...
<a href="IconLegend.html"><img src="extLDM.gif" alt="Large Data Management" border="0"></a> Abstract...
void setXmlCallback(void(*xmlCB)(FILE *, void *userData), void *userData)
Specifies the callback that will be called when the LDM file header is generated.
SoConverterParameters * m_parameters
void printCompressionInfos()
void writeTileComplete(int fileID, bool writeHeader=false)
static const char * m_dataTypeStr[]
virtual void adjustParameters()
SoDEPRECATED int convert(int argc, char **argv)
void outputTile(int fileTileIndex, size_t dataSize, void *, bool i=false)
virtual void endConversion()
int getNumTileToGenerate(SbBox3i32 &slabBox)
void readSlab(SbBox3i32 &slabBox, char *&slabBufferPtr, int64_t subSliceSize)
int64_t m_compressedFilesize
virtual ~SoConverter()
Destructor.
virtual void handleCustomTags(FILE *)
SoDataCompressor * m_ldmCompressor
int64_t m_sizeOfTileIndex
SoConverter::ConverterError m_statusAdjustParameters
virtual std::vector< SbVec2d > & getTileMinMax(int numTiles)
virtual SbBox3f getSize(int &error)=0
SbString m_fileCompletionName
virtual SoDEPRECATED void outputTileBefore(int fileTileIndex, int dataSize, void *data, bool dataInverted)
std::vector< SbVec2d > m_tileMinMax
One minMax for each file ids.
char m_compressionType[256]
virtual void outputTileBefore(int fileTileIndex, size_t dataSize, void *data, bool dataInverted)
void(* m_xmlCB)(FILE *, void *)
virtual void setOriginalFileName(const SbString &originalFileName)
void inputTile(int fileTileIndex, size_t dataSize, void *data, bool i=false)
virtual Abort progress(int numTilesGenerated, int numTilesToGenerate)
This method is called each time a tile of data is generated.
virtual SoVolumeHistogram * getHistogram()
virtual void closeInputFileHandles()
virtual void outputDataType(FILE *fout)
virtual SbString getOriginalFilename() const
virtual int getRange(double &rangeMin, double &rangeMax)=0
virtual void buildTile(SbBox3i32 &slabBox, SbVec3i32 &slabBufferDim, void *slabBuffer, SbVec3i32 &tileOrigin, void *tileBuffer)
SoConverter()
Constructor.
SoDataCompressInfo * m_lastWrittenCompressInfo
SbString m_fileCompletion
virtual void startConversion()
SbString m_originalFileName
bool isFastUpdate()
Return TRUE if converter can do a fast update of the LDM file (ie: converting a ldm file with borders...
virtual std::vector< SoDataSet::DatumElement > getDatum(int &error)=0
SoLDMTopoOctree * m_LDMTopo
SampleType
Define available algorithm available for downsampling process.
@ AVERAGE
Average : Voxel value in parent tile is an average of Neighbor voxel in child tile.
@ DECIMATION
Decimation : Only one voxel out of two.
virtual bool updateDataFile()
virtual void getSubSlice(const SbBox2i32 &subSlice, int sliceNumber, void *data)=0
virtual void outputHeader(FILE *)
SoPerfCounterManager * m_perfManager
SoVolumeReader * m_reader
ConverterError
Converter errors.
@ CVT_CANT_CREATE_HEADER_FILE
Unable to create header file.
@ CVT_NO_LDM_LICENSE
No LDM license.
@ CVT_ABORTED
Conversion aborted.
@ CVT_INPUT_PARAMS_PROBLEM
Input params problems.
@ CVT_NOT_INITIALIZED
Uninitialized converter.
@ CVT_CANT_READ_INPUT_FILE
Unable to read input file.
@ CVT_FINISHED_WITH_WARNINGS
Finished with warnings.
@ CVT_CANT_CREATE_DATA_FILE
Unable to create data file.
@ CVT_CANT_OPEN_INPUT_FILE
Unable to open file.
@ CVT_FILE_EXT_UNKNOWN
Unknown file extension.
@ CVT_NOT_ENOUGH_DISK_SPACE
No enough disk space.
int convert(SoConverterParameters *parameters=NULL)
Main converter function.
bool m_fromInitializeFiles
virtual int getSpecificOffset(bool aligned=true)
ConverterError buildHeader(const SbString &, bool conversionDone=false)
virtual SbVec3i32 getDimension(int &error)=0
SoDEPRECATED int convert(const SbStringList &arguments)
virtual void sampleTile(const SbVec3i32 &tileDim, int border, const void *const octantTile[8], const int octantExists[8], void *parentTile)=0
Method used to downsample a tile.
void buildTile(const SbBox3i32 &subVolume, const void *subVolumeBuffer, const SbBox3i32 &tilePos, void *tileData, const SbBox3i32 &intersection)
SbVec3i32 m_volumeDimension
static const char * m_dataTypeXml[]
<a href="IconLegend.html"><img src="extLDM.gif" alt="Large Data Management" border="0"></a> Containe...
<a href="IconLegend.html"><img src="extLDM.gif" alt="Large Data Management" border="0"></a> Data com...
<a href="IconLegend.html"><img src="extLDM.gif" alt="Large Data Management" border="0"></a> Tile ID
<a href="IconLegend.html"><img src="extLDM.gif" alt="Large Data Management" border="0"></a> Octree t...
Performance Counter Manager.
<a href="IconLegend.html"><img src="extLDM.gif" alt="Large Data Management" border="0"></a> Abstract...
This structure contains the dimension and the type of the tile being processed.