28#include <LDM/nodes/SoDataSet.h>
29#include <Inventor/STL/vector>
30#include <Inventor/threads/SbThread.h>
31#include <LDM/readers/SoVolumeReader.h>
32#include <LDM/xml/SbXmlTag.h>
35#pragma warning( push )
36#pragma warning(disable:4251)
43class SoDataCompressInfo;
372 virtual std::vector<SoDataSet::DatumElement> getDatumDescription();
377 int getNumBytesPerDatum();
379 virtual bool isLDMReader() {
return true; }
381 virtual bool isVolumeMaskReader() {
return false; }
389 virtual unsigned char* getHoleData();
391 SiBitFile* getFileCompletion();
393 SoLDMError getLastErr() {
return m_lastError; };
396 static const SbVec3i32 &getDefaultTileDim() {
return DEFAULT_TILE_DIM; }
418 bool hasPerTileMinMax()
const;
426 virtual double getUndefinedValue()
const;
431 virtual double getDefaultValue()
const;
436 virtual void* getSpecificHeader() {
return NULL; }
441 virtual uint64_t getTileSizeFromFid(
int fileId);
447 virtual void closeAllHandles();
453 virtual void restoreAllHandles();
459 virtual bool isDataSetBitSet();
465 virtual void setTileDimPow2Forced(
bool flag );
470 virtual SbBool isDataConverted()
const
473 virtual void reloadTileMinMax();
478 virtual bool hasUndefValue();
483 virtual bool hasDefaultValue();
486 virtual SoType getCompressionType()
const;
489 virtual size_t getCompressionLevel()
const;
492 virtual bool useCRC32()
const;
495 virtual SbBool hasHistogram();
497 virtual void saveCustomsTags(FILE*) {}
502 void setHeaderDirty(
bool headerDirty );
518 bool readXmlHeader(
int& errorCode);
523 double m_defaultValue;
530 unsigned char* m_hole;
535 size_t m_compressLevel;
536 size_t m_numTileInfos;
537 SoDataCompressInfo* m_compressInfos;
543 bool hasCompletionFile()
const {
return m_hasCompletionFile; }
545 size_t m_compressionIndexArraySize;
546 unsigned int *m_compressionIndexArray;
550 SiBitFile* completion;
551 SbThreadId_t threadID;
554 std::vector<Descriptor*> m_descriptors;
555 Descriptor* getDescriptor( SbThreadId_t
id,
bool forceBuffering =
false );
562 SbBool getFakeData(
int index,
unsigned char*&buffer,
const SbBox3i32& tilePosition);
567 SbBool getFakeDataGeom(
int index,
unsigned char*&buffer,
const SbBox3i32& tilePosition);
569 double getFakeValue(
const SbBox3i32& tilePosition);
576 virtual void readSpecificHeader(FILE*) {};
581 virtual bool isSpecificHeaderRead() {
return true; }
586 virtual int getSpecificOffset(
bool aligned =
true) {
return !aligned; }
594 void oldUncompress(FILE* dataFile, int64_t compressedSize,
size_t tileSize,
char* buffer);
595 void oldGetOffsetAndSize(
int index, int64_t& compressedSize, int64_t& offset);
597 void uncompressTile(Descriptor* desc, int64_t compressedSize,
size_t tileSize,
char* buffer);
598 void getOffsetAndSize(Descriptor* compressor,
int index, int64_t& compressedSize, int64_t& offset);
599 void checkCrc32(
char* buffer,
int tileIndex,
size_t tileSize);
613 template<
typename T>
void getFakeDataNoise(
void* buffer,
const SbBox3i32& tilePosition);
616 void visibleBorder(
unsigned char* buffer);
619 void readBorderOnly(
unsigned char* buffer);
622 void readTileMinMax(TiXmlElement *s);
625 void extractUndefValue(TiXmlElement* element);
628 std::vector<SbVec2d> m_tileMinMax;
634 bool m_hasUndefValue;
637 bool m_hasDefaultValue;
640 bool m_fakeDataNoise;
641 unsigned int m_fakeDataNumOctaves;
642 float m_fakeDataPersistence;
645 static DebugBorderMode s_debugBorders;
647 bool m_hasCompletionFile;
648 SbBool m_hasAlternateFile;
651 bool m_bIsBitSetDataSet;
654 bool m_forcePow2TileDim;
659 double getFakeValueBasedOnTopoOctree(
const int fileId );
670 void resetInternalPath();
717SoLDMReader::hasHistogram()
723SoLDMReader::setHeaderDirty(
bool headerDirty )
725 m_headerDirty = headerDirty;
729SoLDMReader::getTileSizeFromFid(
int)
735SoLDMReader::setTileDimPow2Forced(
bool flag )
737 m_forcePow2TileDim = flag;
742#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.
<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> 2D vector class ...
<a href="IconLegend.html"><img src="extLDM.gif" alt="Large Data Management" border="0"></a> XML tag ...
<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> Data com...
DataType
Supported data type.
<a href="IconLegend.html"><img src="extLDM.gif" alt="Large Data Management" border="0"></a> Base cla...
virtual SbBool readXTraceInTile(int index, unsigned char *&buffer, const SbBox3i32 &tilePosition, const SbVec2i32 &tracePosition)
Read directly from the LDM data source, a trace inside a tile.
virtual SbBool getCenter(int fileId, SbVec3f ¢er)
Returns the center of the data associated with the specified file ID.
virtual SbBool getHistogram(std::vector< int64_t > &numVox)
Returns the distribution of data values, i.e., the number of voxels per data value.
virtual int handleHeader(TiXmlElement *)
Handle tags of LDM reader inheriting from this base class.
virtual SbBool getMinMax(int64_t &min, int64_t &max)
Returns the minimum and maximum data values.
virtual SbString getOriginalFilename() const
Returns original file name from which the data has been converted to LDM format if stored in file.
SoLDMError
LDM Reader error code.
@ LDM_XML_ROOT_START_TAG_NOT_FOUND
XML START Tag not found.
@ LDM_RD_FILE_NOT_FOUND_ERROR
file not found
@ LDM_RD_NO_ERROR
No error.
@ LDM_RD_UNSUPPORTED_DATA_TYPE_ERROR
Unsupported data file type.
@ LDM_RD_UNKNOWN_ERROR
Unknown error.
@ LDM_XML_PARSING_ERROR
XML parsing error.
@ LDM_ALTERNATE_FILE_NOT_FOUND
Alternate file not found.
@ LDM_XML_ROOT_END_TAG_NOT_FOUND
XML END Tag not found.
@ LDM_FILE_NOT_FOUND
file not found
@ LDM_COMPLETION_FILE_NOT_FOUND
Completion file not found.
@ LDM_SIZE_TAG_MISSING
Size tag missing.
virtual SbVec3i32 getDimension()
Returns the dimension of the data.
virtual ReadError getDataChar(SbBox3f &size, SoDataSet::DataType &type, SbVec3i32 &dim) override
Gets the characteristics (file header) of the data volume.
virtual SoDEPRECATED int getBorderFlag()
Returns the border flag.
virtual SbBool getMinMax(double &min, double &max)
Returns the minimum and maximum data values (for float values).
virtual SbBool readYSliceInTile(int index, unsigned char *&buffer, const SbBox3i32 &tilePosition, const uint32_t &slicePosition)
Read directly from the LDM data source, an orthoslice on the Y axis inside a tile.
virtual bool isLittleEndian()
Returns whether the bytes of the data are stored in big or little endian order.
virtual SbBool getTileSize(SbVec3i32 &tile)
Returns the size of a data tile.
virtual SoVolumeReader::ReaderType getReaderType()
Returns the reader type.
virtual SbBool readXSliceInTile(int index, unsigned char *&buffer, const SbBox3i32 &tilePosition, const uint32_t &slicePosition)
Read directly from the LDM data source, an orthoslice on the X axis inside a tile.
virtual SbBool isThreadSafe() const
Return true as this reader is thread safe.
SoLDMReader()
Constructor.
virtual SoDEPRECATED SbBool readTile(int index, unsigned char *&buffer, const SbBox3i32 &tilePosition)
Given an index, reads a tile if the data is organized in tiles (for LDM).
virtual SbVec2d getTileMinMax(int index) const
Returns the minimum and maximum data values for the given tile.
virtual SoDEPRECATED SbBool getMinMax(int &min, int &max)
Returns the minimum and maximum data values.
virtual SbBool readZSliceInTile(int index, unsigned char *&buffer, const SbBox3i32 &tilePosition, const uint32_t &slicePosition)
Read directly from the LDM data source, an orthoslice on the Z axis inside a tile.
virtual SoBufferObject * readTile(int index, const SbBox3i32 &tilePosition)
Given an index, reads a tile if the data is organized in tiles (for LDM).
virtual SbXmlTag getXmlTag(const char *tagName)
Gets the first occurrence of the XML element whose tag name is specified by tagName.
virtual SbBool getBbox(int fileId, SbBox3f &box)
Returns the bounding box of the data associated with the specified file ID.
void getSubSlice(const SbBox2i32 &subSlice, int sliceNumber, void *data)
Note: SoLDMReader does not implement this method.
virtual SbBox3f getSize()
Returns the bounding box of the total data in world coordinates.
virtual SoVolumeWriter * getConfiguredWriter()
Returns a volume writer that corresponds to this reader (same format, parameters,...
TileCachePolicy
Tile cache management policy.
<a href="IconLegend.html"><img src="extLDM.gif" alt="Large Data Management" border="0"></a> Octree t...
Stores runtime type information.
<a href="IconLegend.html"><img src="extLDM.gif" alt="Large Data Management" border="0"></a> Abstract...
virtual SoBufferObject * readTile(int index, const SbBox3i32 &tilePosition)
Given an index, reads a tile if the data is organized in tiles (for LDM).
virtual ReadError getDataChar(SbBox3f &size, SoDataSet::DataType &type, SbVec3i32 &dim)=0
Gets the characteristics (file header) of the data volume.
ReaderType
Available reader type.
virtual void getSubSlice(const SbBox2i32 &subSlice, int sliceNumber, void *data)
Must copy the rectangular part defined by subSlice of the XY slice sliceNumber to the memory refe...
<a href="IconLegend.html"><img src="extLDM.gif" alt="Large Data Management" border="0"></a> Abstract...