31#pragma warning( push )
32#pragma warning(disable:4251)
36#include <Inventor/SbBox.h>
37#include <Inventor/SbLinear.h>
38#include <Inventor/fields/SoSFBool.h>
39#include <Inventor/fields/SoSFBox3f.h>
40#include <Inventor/fields/SoSFEnum.h>
41#include <Inventor/fields/SoSFFieldContainer.h>
42#include <Inventor/fields/SoSFFilePathString.h>
43#include <Inventor/fields/SoSFFloat.h>
44#include <Inventor/fields/SoSFDouble.h>
45#include <Inventor/SbDataType.h>
46#include <Inventor/fields/SoSFInt32.h>
47#include <Inventor/fields/SoSFNode.h>
48#include <Inventor/fields/SoSFString.h>
49#include <Inventor/fields/SoSFUShort.h>
50#include <Inventor/misc/SoMemoryObject.h>
51#include <Inventor/misc/SoRef.h>
52#include <Inventor/nodes/SoNode.h>
54#include <LDM/SoLDMMediator.h>
55#include <LDM/SoLDMTileID.h>
56#include <LDM/fields/SoSFLDMResourceParameters.h>
57#include <LDM/fields/SoSFLDMDataTransform.h>
58#include <LDM/nodes/SoLDMResourceParameters.h>
59#include <LDM/nodes/SoTransferFunction.h>
60#include <LDM/tiles/SoCpuBufferUniform.h>
61#include <Inventor/sys/SoGLType.h>
64#include <Inventor/devices/SoCpuBufferObject.h>
71class SoLDMGeomElement;
89class SoLdmValuationAction;
464 const std::vector<SbVec3i32>& boxCenters,
466 const double& newValue
555 const std::vector<char*> conversionParameters = std::vector<char*>(), SaveEditingCB* callback = NULL );
608 return const_cast<const SoDataSet*
>(
this)->getReader();
825 void* bufferToTransform,
854SoEXTENDER_Documented
public:
892 virtual void doAction(
SoAction *action );
904 typedef std::map<SoLDMTileID, uint64_t> tileSigInCacheMap;
906 static void initClass();
907 static void exitClass();
910 bool isReallyOfType(
const SoType& type,
bool derived);
917 bool isGPUDataRange(
SoState* state );
933 const bool useExtendedData =
false);
937 static int getNumInstance();
940 SB_THREAD_TLS_HEADER();
948 virtual void notify(SoNotList *list);
953 void sendParametersToLDM(SoLdmValuationAction* action);
956 void ignoredByMultiDataSeparator(
bool state);
957 bool isIgnoredByMultiDataSeparator();
960 virtual bool getDataCharRead() {
return m_dataCharRead;};
963 int getIndTexPrec()
const;
964 bool loadInMemory(
SoState* s = NULL);
965 void setListChange(
bool val);
966 bool getListChange();
974 unsigned short getResourcesState()
const;
980 void setResourcesState(
const SoLDMResourceManager::State flag,
bool value );
983 bool isAccumulated();
988 void lookForSceneGraphChange(
SoAction* action);
992 virtual void releaseDataOneSlice(
SoBufferObject *sliceDataBuffer);
1003 SoLDMMediator* getMediator()
const
1007 void setMediator(SoLDMMediator* m);
1014 void* getTexData(
const void* tileBuffer,
1019 void *textureBuffer,
1043 virtual int getTexPrec(
SoState*);
1050 void getTextureFormat(SoTransferFunction::GLColorMapType colorMapType,
1051 SbEnums::ImageDataFormat& format,
1060 void copyLDMParameters(SoLDMMediator *mediator);
1067 virtual bool isMultidataEnabled()
const {
return m_multidataEnabled; }
1083 unsigned short getId()
const
1089 bool hasReadError();
1094 inline bool isEmpty()
1097 return ( dim[0] == 0 || dim[1] == 0 || dim[2] == 0 );
1104 struct DatumElement{
1115 float convertToNormalizedTextureSpace(
SoState *state,
const float data);
1120 void setFirstTraversalDone(
bool flag);
1125 bool isFirstTraversalDone()
const;
1127 virtual bool isPalettedTexture(
SoState*);
1132 virtual uint64_t getTileSignature(
const SoLDMTileID& tileId);
1140 { setReader( reader, TRUE ); };
1147 void refVolRender(
int contextId );
1148 void unrefVolRender(
int contextId );
1156 int getBestEqualResolution()
const;
1159 void invalidateHistogram();
1162 SbVec2f getDataTypeMinMax()
const;
1176 bool supportUndefinedVoxel(
SoState* state);
1181 int getTexelSizeBits(
SoState* state =
nullptr);
1196 virtual void setElement(
SoState* state);
1201 bool isUsingUserExtent();
1210 virtual bool enableMultidata(
SoState* state);
1216 bool m_forcePow2TileDim;
1222 virtual void unload();
1223 virtual void releaseMemory();
1226 bool m_multidataEnabled;
1235 bool m_dataCharRead;
1238 virtual void updateFilename();
1241 unsigned short m_id;
1247 virtual void readerChanged();
1251 virtual SoLDMMediator *createMediator();
1252 SoLDMMediator* m_mediator;
1259 int &shift,
int &offset,
int &nrgba,
unsigned int * &rgba);
1269 virtual void ldmAction(SoLdmValuationAction* action);
1274 virtual SbBool isRGBAData();
1282 virtual SoLDMGeomElement* getAppropriateElement( SoLDMGeometry* SO_UNUSED_PARAM(v) )
1290 virtual unsigned short getMaxTexturePrecisionBits()
const {
return 16; }
1304 void commonConstructor();
1310 bool computeBestEqualResolution(
const std::vector<size_t>& tilesByLvlVec);
1322#ifndef HIDDEN_FROM_DOC
1323 friend class SoVolumeState;
1324 friend class SoLDMMediator;
1325 friend class SoCpuBufferFromVolumeReaderImpl;
1326 friend class SoObliqueSliceLdm;
1328 friend class SoLdmValuationAction;
1329 friend class SoLDMGeometry;
1333#pragma warning( pop )
<a href="IconLegend.html"><img src="extTGS.gif" alt="VSG extension" border="0"></a> 3D box class.
Class encoding a data type.
DataType
Supported Data type.
@ UNSIGNED_INT32
unsigned int (32bits)
@ UNSIGNED_BYTE
unsigned byte
@ SIGNED_SHORT
signed short
@ UNSIGNED_SHORT
unsigned short
@ SIGNED_INT32
signed int (32bits)
Class for smart character strings.
Abstract base class for all actions.
<a href="IconLegend.html"><img src="extTGS.gif" alt="VSG extension" border="0"></a> Utility function...
<a href="IconLegend.html"><img src="extTGS.gif" alt="VSG extension" border="0"></a> Abstract base cl...
Performs a generic traversal of a scene graph or path.
<a href="IconLegend.html"><img src="extTGS.gif" alt="VSG extension" border="0"></a> Type conversion ...
<a href="IconLegend.html"><img src="extLDM.gif" alt="Large Data Management" border="0"></a> Data set...
<a href="IconLegend.html"><img src="extLDM.gif" alt="Large Data Management" border="0"></a> Range of...
<a href="IconLegend.html"><img src="extLDM.gif" alt="Large Data Management" border="0"></a> Data set...
virtual SbBool saveEditing(bool recomputeLowerResolution, const std::vector< char * > conversionParameters=std::vector< char * >(), SaveEditingCB *callback=NULL)
Commit all transactions.
SoSFBool allocateResourceOnRender
Indicates if resource allocation is done only on first render traversal or as soon as the node is cre...
SoSFBool useCompressedTexture
Controls use of OpenGL lossy texture compression for RGBA data (if available).
SoDEPRECATED void setLDMDataTransformFunction(SoLDMDataTransformFunction *func, void *userData=NULL)
If set, the user-defined function is called after each tile is loaded, but before it is stored in mai...
bool isInMemory(SoLDMTileID tileID) const
Indicates whether a tile is in main memory.
static int dataSize(DataType dataType)
Returns the number of bytes per voxel of the specified data type.
virtual SbBool getMinMax(double &min, double &max)
Returns min and max values of the data set.
SoSFUShort texturePrecision
For scalar (non-RGBA) data, specifies the size of voxel values on the GPU in bits.
virtual int editSolidShape(const SoNode *solidShape, const double &value)
Replaces all voxels intersecting the given shape with the specified value.
SoLDMDataAccess & getLdmDataAccess()
Returns a reference to the SoLDMDataAccess object.
virtual void readTile(SoLDMTileID tileID, SoBufferObject *buffer, bool transform)
Copies the specified tile into the provided buffer.
bool isDataInMemory(const SoLDMTileID &tileID) const
Indicates whether the data attached to a tile is in main memory.
void SoLDMDataTransformFunction(SoDataSet *ds, const SbVec3i32 &bufferDimension, void *bufferToTransform, const SbBox3i32 &dataBox, int resolutionLevel, void *userData)
virtual SbBox3f voxelToXYZ(const SbBox3f &box) const
Converts the specified box in voxel coordinates (I,J,K) to geometric coordinates (X,...
SoVolumeReader * getReader() const
Returns the current data set reader object.
virtual int editBoxes(const std::vector< SbVec3i32 > &boxCenters, const int &boxSize, const double &newValue)
Replace all voxels in the region defined by a list of boxes with the specified value.
virtual void writeTile(SoLDMTileID tileID, SoBufferObject *buffer, SoVolumeWriter *writer)
Write the specified tile using the specified writer.
void getTileIDInMemory(std::vector< LDM_TILE_ID_TYPE > &tilesInMemory) const
Debug purpose only.
virtual int editSurfaceShape(const SoNode *surfaceShape, const float &thickness, const double &value)
Replaces all voxels intersecting the polygons or lines defined by the surfaceShape and given thicknes...
SoSFFilePathString fileName
Indicates the file location containing the data set.
SoSFLDMDataTransform dataTransform
If set to an appropriate SoLDMDataTransform object, the object's transformFunction method is called a...
virtual SbBool undoEditing(int transactionId)
Undo all modifications associated with the specified transaction id.
void setLDMReader(SoLDMReader *reader)
Sets the LDM volume reader object to use.
static int getMaxNumDataSets()
Returns the maximum number of data sets that can be render composited on the current hardware (essent...
SoVolumeReader * getReader()
Returns the current data set reader object.
virtual SbVec3f voxelToXYZ(const SbVec3f &dataPosition) const
Converts the specified point in voxel coordinates (I,J,K) to geometric coordinates (X,...
int numSigBits() const
Returns the number of significant bits.
virtual SbBool redoEditing(int transactionId)
Redo all modifications associated with the specified transaction id.
virtual SoDEPRECATED void readTile(SoLDMTileID tileID, unsigned char *buffer, bool transform)
SbVec3i32 getTileDimension()
Returns the tile dimension.
virtual SbVec3f XYZToVoxel(const SbVec3f &dataPosition) const
Converts the specified point in geometric coordinates (X,Y,Z) to voxel coordinates (I,...
void resetReader()
Resets previously set custom reader setup by setReader call.
SbBool saveEditing()
Commit all transactions.
virtual SbBool getMinMax(int64_t &min, int64_t &max)
Returns min and max values of the data set data.
const SoLDMTopoOctree * getLDMTopoOctree() const
Returns the LDMTopoOctree used by this SoDataSet.
DataType
Supported data type.
virtual SbBox3f XYZToVoxel(const SbBox3f &xyzBox) const
Converts the specified box in geometric coordinates to voxel coordinates.
const SbVec3i32 & getDimension()
Returns the data set dimension.
virtual int editSubVolume(const SbBox3i32 &subVolume, SoBufferObject *userData)
Replaces the contents of a subvolume with the given data.
unsigned int getDatumSize()
Returns the number of bytes per voxel.
static SbBool isDataSigned(DataType dataType)
Returns TRUE if the given data type is a signed integer data type.
virtual bool hasEditedTile()
Returns true if DataSet has edited tiles.
DataType getDataType() const
Returns the data type.
void setReader(SoVolumeReader &reader, SbBool takeOwnership=FALSE)
This method allows the data to be read directly from the disk using the specified subclass of SoVolum...
int getDataSize()
Returns the number of bytes per voxel in VolumeViz.
SoLDMReader * getLDMReader()
Returns a pointer to the current data set reader object.
virtual SbBool finishEditing(int transactionId)
Terminates an editing transaction.
virtual int editSubVolume(const SbBox3i32 &subVolume, const double &value)
Replaces the contents of a subvolume with the specified value.
SoSFInt32 dataSetId
When using multiple SoDataSet nodes, the dataSetId field uniquely identifies each data set used in th...
virtual int editTile(const SoLDMTileID &tileId, SoBufferObject *userData)
Replaces the contents of a tile with the given data.
virtual SbBool startEditing(int &transactionId)
Initiate an editing transaction.
SoSFDouble undefinedValue
Data with this value won't be rendered.
virtual size_t readTile(SoBufferObject *&bufferObject, SoLDMTileID tileID, bool transform)
Copies the specified tile into the provided buffer.
SoSFLDMResourceParameters ldmResourceParameters
Contains an SoLDMResourceParameters object which allows you to set LDM resource parameters.
virtual int editTile(const SoLDMTileID &tileId, const double &value)
Replaces the contents of a tile with the specified value.
SbBool SaveEditingCB(SoDataSet *dataSet, SoVolumeWriter *writer, int tilesRemaining, int totalTiles)
This is the declaration to use for saveEditing callback functions.
SoSFBox3f extent
The real size (extent) of the volume in modeling coordinates.
SoDEPRECATED int getOverlapping()
Returns the tile border (overlap) in voxels.
static SbBool isDataFloat(DataType dataType)
Returns TRUE if the given data type is a float data type.
Renders a scene graph using Open Inventor's Render Engine.
Computes bounding box of a scene.
Allows nodes in a graph to receive input events.
<a href="IconLegend.html"><img src="extLDM.gif" alt="Large Data Management" border="0"></a> Volume d...
<a href="IconLegend.html"><img src="extLDM.gif" alt="Large Data Management" border="0"></a> Base cla...
<a href="IconLegend.html"><img src="extLDM.gif" alt="Large Data Management" border="0"></a> Resource...
<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...
<a href="IconLegend.html"><img src="extLDM.gif" alt="Large Data Management" border="0"></a> Separato...
Abstract base class for all database nodes.
Abstract base class for Performance Counter.
Performance Counter Manager.
Abstract base class for picking objects in a scene.
Smart pointer for any class inheriting SoRefCounter.
Field containing a single Boolean value.
<a href="IconLegend.html"><img src="extTGS.gif" alt="VSG extension" border="0"></a> Field containing...
Field containing a floating-point value.
<a href="IconLegend.html"><img src="extTGS.gif" alt="VSG extension" border="0"></a> Field containing...
Field containing a int32_t integer.
Field containing an SoLDMResourceParameters object.
Field containing an unsigned short integer.
InternalFormat
Texture internal storage format.
<a href="IconLegend.html"><img src="extLDM.gif" alt="Large Data Management" border="0"></a> Describe...
Stores runtime type information.
<a href="IconLegend.html"><img src="extLDM.gif" alt="Large Data Management" border="0"></a> Abstract...
<a href="IconLegend.html"><img src="extLDM.gif" alt="Large Data Management" border="0"></a> Abstract...
SoSFEnum dataType
Type of input data (that will be given in the writeXXX method) Use enum SoDataSet::DataType.
Writes a scene graph to a file.
std::pair< SoDataSet *, int > DataSetIdPair
Pair containing an SoDataset and its dataSetId.