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;
138class SoDataSet : public SoNode
140 SO_NODE_ABSTRACT_HEADER( SoDataSet );
142 SO_PIMPL_PUBLIC_HEADER( SoDataSet );
477 virtual int editSurfaceShape(
const SoNode* surfaceShape,
const float& thickness,
const double& value );
509 const std::vector<SbVec3i32>& boxCenters,
511 const double& newValue
600 const std::vector<char*> conversionParameters = std::vector<char*>(),
SaveEditingCB* callback = NULL );
653 return const_cast<const SoDataSet*
>(
this)->
getReader();
870 void* bufferToTransform,
899SoEXTENDER_Documented
public:
937 virtual void doAction(
SoAction *action );
949 typedef std::map<SoLDMTileID, uint64_t> tileSigInCacheMap;
951 static void initClass();
952 static void exitClass();
955 bool isReallyOfType(
const SoType& type,
bool derived);
962 bool isGPUDataRange(
SoState* state );
978 const bool useExtendedData =
false);
982 static int getNumInstance();
985 SB_THREAD_TLS_HEADER();
993 virtual void notify(SoNotList *list);
998 void sendParametersToLDM(SoLdmValuationAction* action);
1001 void ignoredByMultiDataSeparator(
bool state);
1002 bool isIgnoredByMultiDataSeparator();
1005 virtual bool getDataCharRead() {
return m_dataCharRead;};
1008 int getIndTexPrec()
const;
1009 bool loadInMemory(
SoState* s = NULL);
1010 void setListChange(
bool val);
1011 bool getListChange();
1019 unsigned short getResourcesState()
const;
1025 void setResourcesState(
const SoLDMResourceManager::State flag,
bool value );
1028 bool isAccumulated();
1033 void lookForSceneGraphChange(
SoAction* action);
1037 virtual void releaseDataOneSlice(
SoBufferObject *sliceDataBuffer);
1048 SoLDMMediator* getMediator()
const
1052 void setMediator(SoLDMMediator* m);
1059 void* getTexData(
const void* tileBuffer,
1064 void *textureBuffer,
1088 virtual int getTexPrec(
SoState*);
1095 void getTextureFormat(SoTransferFunction::GLColorMapType colorMapType,
1096 SbEnums::ImageDataFormat& format,
1105 void copyLDMParameters(SoLDMMediator *mediator);
1112 virtual bool isMultidataEnabled()
const {
return m_multidataEnabled; }
1128 unsigned short getId()
const
1134 bool hasReadError();
1139 inline bool isEmpty()
1142 return ( dim[0] == 0 || dim[1] == 0 || dim[2] == 0 );
1149 struct DatumElement{
1160 float convertToNormalizedTextureSpace(
SoState *state,
const float data);
1165 void setFirstTraversalDone(
bool flag);
1170 bool isFirstTraversalDone()
const;
1172 virtual bool isPalettedTexture(
SoState*);
1177 virtual uint64_t getTileSignature(
const SoLDMTileID& tileId);
1185 { setReader( reader, TRUE ); };
1192 void refVolRender(
int contextId );
1193 void unrefVolRender(
int contextId );
1200 int getBestEqualResolution()
const;
1203 void invalidateHistogram();
1206 SbVec2f getDataTypeMinMax()
const;
1220 bool supportUndefinedVoxel(
SoState* state);
1225 int getTexelSizeBits(
SoState* state =
nullptr);
1231 SbMatrix getVoxelMatrixInv()
const;
1246 virtual void setElement(
SoState* state);
1251 bool isUsingUserExtent();
1260 virtual bool enableMultidata(
SoState* state);
1266 bool m_forcePow2TileDim;
1272 virtual void unload();
1273 virtual void releaseMemory();
1276 bool m_multidataEnabled;
1285 bool m_dataCharRead;
1288 virtual void updateFilename();
1291 unsigned short m_id;
1297 virtual void readerChanged();
1301 virtual SoLDMMediator *createMediator();
1302 SoLDMMediator* m_mediator;
1309 int &shift,
int &offset,
int &nrgba,
unsigned int * &rgba);
1319 virtual void ldmAction(SoLdmValuationAction* action);
1324 virtual SbBool isRGBAData();
1332 virtual SoLDMGeomElement* getAppropriateElement( SoLDMGeometry* SO_UNUSED_PARAM(v) )
1340 virtual unsigned short getMaxTexturePrecisionBits()
const {
return 16; }
1354 void commonConstructor();
1360 SoBufferObject *tmpTexture;
1361 SoCpuBufferUniform *tmpTextureUniform;
1362 SoBufferObject *tmpColormap;
1363 SoBufferObject *tmpTexturePermute;
1366#ifndef HIDDEN_FROM_DOC
1367 friend class SoVolumeState;
1368 friend class SoLDMMediator;
1369 friend class SoCpuBufferFromVolumeReaderImpl;
1370 friend class SoObliqueSliceLdm;
1377#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.
ValueInterpretation
Specifies an image type: segmented or not segmented.
@ CONTINUOUS
Specifies an image containing continuous scalar values (an image which is not a segmented image or a ...
@ DISCRETE
Specifies an image containing discrete values that represent labels.
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,...
friend class SoLDMGeometry
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.
@ UNSIGNED_INT32
unsigned int (32bits)
@ UNSIGNED_BYTE
unsigned byte
@ UNSIGNED_SHORT
unsigned short
@ SIGNED_SHORT
signed short
@ SIGNED_INT32
signed int (32bits)
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
Specifies the data value that should be considered undefined and therefore not rendered.
SoSFEnum valueInterpretation
Specifies if this dataset corresponds or does not correspond to a segmented image.
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.
friend class SoLdmValuationAction
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...
friend class SoCallbackAction
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.
Field containing an enumerated 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.