Open Inventor Release 2025.2.1
 
Loading...
Searching...
No Matches
SoDataSet.h
1/*=======================================================================
2 *** THE CONTENT OF THIS WORK IS PROPRIETARY TO FEI S.A.S, (FEI S.A.S.), ***
3 *** AND IS DISTRIBUTED UNDER A LICENSE AGREEMENT. ***
4 *** ***
5 *** REPRODUCTION, DISCLOSURE, OR USE, IN WHOLE OR IN PART, OTHER THAN AS ***
6 *** SPECIFIED IN THE LICENSE ARE NOT TO BE UNDERTAKEN EXCEPT WITH PRIOR ***
7 *** WRITTEN AUTHORIZATION OF FEI S.A.S. ***
8 *** ***
9 *** RESTRICTED RIGHTS LEGEND ***
10 *** USE, DUPLICATION, OR DISCLOSURE BY THE GOVERNMENT OF THE CONTENT OF THIS ***
11 *** WORK OR RELATED DOCUMENTATION IS SUBJECT TO RESTRICTIONS AS SET FORTH IN ***
12 *** SUBPARAGRAPH (C)(1) OF THE COMMERCIAL COMPUTER SOFTWARE RESTRICTED RIGHT ***
13 *** CLAUSE AT FAR 52.227-19 OR SUBPARAGRAPH (C)(1)(II) OF THE RIGHTS IN ***
14 *** TECHNICAL DATA AND COMPUTER SOFTWARE CLAUSE AT DFARS 52.227-7013. ***
15 *** ***
16 *** COPYRIGHT (C) 1996-2025 BY FEI S.A.S, ***
17 *** BORDEAUX, FRANCE ***
18 *** ALL RIGHTS RESERVED ***
19**=======================================================================*/
20/*=======================================================================
21** Author : Jerome Hummel (Mar 2006)
22** Modified by : Benjamin Grange (MMM yyyy)
23** Modified by : Jean-Michel Godinaud. (MMM yyyy)
24**=======================================================================*/
25
26
27#ifndef _SO_DATA_SET_
28#define _SO_DATA_SET_
29
30#ifdef _MSC_VER
31#pragma warning( push )
32#pragma warning(disable:4251)
33#endif
34
35//includes
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>
53#include <LDM/SoLDM.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>
62
63// TODO: Should be removed : For compatibility only
64#include <Inventor/devices/SoCpuBufferObject.h>
65
69class SoWriteAction;
70class SoState;
71class SoLDMGeomElement;
72class SoLDMGeometry;
73class SoLDMReader;
77class SoVolumeReader;
79class SoPerfCounter;
80class SoBufferObject;
82class SoGLTexture;
83class SoCache;
84
85class SoDataExtract;
86class SoConversion;
87class SoAlgorithms;
88class SoLDMAlgorithms;
89class SoLdmValuationAction;
90class SoDataRange;
91
92class SoVolumeWriter;
93
94SO_PIMPL_PUBLIC_DECLARATION(SoDataSet)
95
96
97
138class SoDataSet : public SoNode
139{
140 SO_NODE_ABSTRACT_HEADER( SoDataSet );
141
142 SO_PIMPL_PUBLIC_HEADER( SoDataSet );
143
144public:
145
162
186
188
203
229
240
262
271
295
320
335
340
345
349 unsigned int getDatumSize();
350
358 virtual size_t readTile( SoBufferObject*& bufferObject, SoLDMTileID tileID, bool transform );
359
365 virtual void readTile(SoLDMTileID tileID, SoBufferObject* buffer, bool transform);
366
375 virtual void writeTile( SoLDMTileID tileID, SoBufferObject* buffer, SoVolumeWriter* writer );
376
381 bool isInMemory( SoLDMTileID tileID ) const;
382
392 bool isDataInMemory( const SoLDMTileID& tileID ) const;
393
398 void getTileIDInMemory( std::vector<LDM_TILE_ID_TYPE>& tilesInMemory ) const;
399
405
411
419 virtual SbBool startEditing( int& transactionId );
420
429 virtual SbBool finishEditing( int transactionId );
430
439 virtual int editTile( const SoLDMTileID& tileId, SoBufferObject* userData );
440
450 virtual int editSubVolume( const SbBox3i32& subVolume, SoBufferObject* userData );
451
456 virtual int editTile( const SoLDMTileID& tileId, const double& value );
457
463 virtual int editSubVolume( const SbBox3i32& subVolume, const double& value );
464
477 virtual int editSurfaceShape( const SoNode* surfaceShape, const float& thickness, const double& value );
478
498 virtual int editSolidShape( const SoNode* solidShape, const double& value );
499
508 virtual int editBoxes(
509 const std::vector<SbVec3i32>& boxCenters,
510 const int& boxSize,
511 const double& newValue
512 );
513
525 virtual SbBool undoEditing( int transactionId );
526
538 virtual SbBool redoEditing( int transactionId );
539
540
556 typedef SbBool SaveEditingCB( SoDataSet* dataSet,
557 SoVolumeWriter* writer,
558 int tilesRemaining,
559 int totalTiles );
599 virtual SbBool saveEditing( bool recomputeLowerResolution,
600 const std::vector<char*> conversionParameters = std::vector<char*>(), SaveEditingCB* callback = NULL );
601
621
625 virtual bool hasEditedTile();
626
634
642
652 {
653 return const_cast<const SoDataSet*>(this)->getReader();
654 }
655
665
687
688
693
698
703
707 int numSigBits() const;
708
721 virtual SbBool getMinMax( int64_t &min, int64_t &max);
722
736 virtual SbBool getMinMax( double &min, double &max);
737
742
747
767 void setReader( SoVolumeReader &reader, SbBool takeOwnership = FALSE );
768
773 static int getMaxNumDataSets() ;
774
789 virtual SbVec3f voxelToXYZ( const SbVec3f& dataPosition ) const;
790
804 virtual SbBox3f voxelToXYZ( const SbBox3f& box ) const;
805
819 virtual SbVec3f XYZToVoxel( const SbVec3f& dataPosition ) const;
820
834 virtual SbBox3f XYZToVoxel( const SbBox3f& xyzBox ) const;
835
836#if 1
837SoDEPRECATED
839 virtual void readTile(SoLDMTileID tileID, unsigned char* buffer, bool transform);
840
868 typedef void SoLDMDataTransformFunction(SoDataSet* ds,
869 const SbVec3i32& bufferDimension, //tile dim
870 void* bufferToTransform,
871 const SbBox3i32& dataBox, //position of tile in data space
872 int resolutionLevel, //resolution level of the tile
873 void* userData);
874SoDEPRECATED
884 void setLDMDataTransformFunction(SoLDMDataTransformFunction* func, void* userData = NULL);
885
886#endif
887
888#if 1
889SoDEPRECATED
896
897#endif
898
899SoEXTENDER_Documented public:
900
915
921
922private:
923
925 virtual void callback( SoCallbackAction *action );
927 virtual void GLRender( SoGLRenderAction *action );
929 virtual void getBoundingBox(SoGetBoundingBoxAction *action);
931 virtual void handleEvent(SoHandleEventAction* action);
933 virtual void pick(SoPickAction *action) ;
935 virtual void write(SoWriteAction *action);
937 virtual void doAction( SoAction *action );
938
942 inline virtual void useFakeData(SoLDMTileID /* tileID */, SoBufferObject* /* buffer */) {};
943
944private:
945
946 // This map is used to maintain signature of each tile in cache
947 // It's used to be able to find an uncompressed version of a given tile in the cache
948 // when already uncompressed tile are reloaded.
949 typedef std::map<SoLDMTileID, uint64_t> tileSigInCacheMap;
950
951 static void initClass();
952 static void exitClass();
953
955 bool isReallyOfType(const SoType& type, bool derived);
956
962 bool isGPUDataRange( SoState* state );
963
969 SoBufferObject* getEditedTile( SoBufferObject* tileBuffer, const SoLDMTileID& tileId );
970
975 virtual SoBufferObject *getTransformedTile(const SoLDMTileID& tile,
976 const SoLDM::DataSetIdPair& p,
977 SoState * state=NULL,
978 const bool useExtendedData = false);
979
980 // return the number of SoDataSet instance created
981 // this is usefull to optimize SoLdmValuationAction
982 static int getNumInstance();
983
985 SB_THREAD_TLS_HEADER();
986
987 SoMultiDataSeparator *getMultiDataSeparator() { return m_MultiDataSeparator; }
988 void setMultiDataSeparator(SoMultiDataSeparator *mds, SoLDMMediator* mediator = nullptr);
989
993 virtual void notify(SoNotList *list);
994
998 void sendParametersToLDM(SoLdmValuationAction* action);
999
1000 //When true data set won't be used for rendering
1001 void ignoredByMultiDataSeparator(bool state);
1002 bool isIgnoredByMultiDataSeparator();
1003
1004 // have the properties read ?
1005 virtual bool getDataCharRead() { return m_dataCharRead;};
1006
1007 /* @return texture precision in Bits */
1008 int getIndTexPrec() const;
1009 bool loadInMemory(SoState* s = NULL);
1010 void setListChange(bool val);
1011 bool getListChange();
1012
1013 /*
1014 * Return internal state of resources. Dirty state means
1015 * resource field has been changed by application / user.
1016 * Can be cumulative value defined in
1017 * See enum definition made in SoLDMResourceManager::State
1018 */
1019 unsigned short getResourcesState() const;
1020
1021 /*
1022 * Set internal state of resources. State set to true means
1023 * resource field have been changed by application / user.
1024 */
1025 void setResourcesState( const SoLDMResourceManager::State flag, bool value );
1026
1027 //shall we accumulate the node in state?
1028 bool isAccumulated();
1029
1030 static SbBool getCurrentMatrixDifference(SoState* state, const SoLDM::DataSetIdPair& idPair, SbMatrix& geomMatrix);
1031
1032 //multi-data
1033 void lookForSceneGraphChange(SoAction* action);
1034
1035 // extract slice data
1036 virtual SoBufferObject* getDataOneSlice( const SbVec3i32& tileSize, SoBufferObject* tileData, int Zaxis, int slice);
1037 virtual void releaseDataOneSlice(SoBufferObject *sliceDataBuffer);
1038
1039 //***** factory methods ****
1040
1041 virtual LDMSliceAccessor* getAppropriateSliceAccessor(const SoLDM::DataSetIdPair& p);
1042 virtual SoLDMReader* getAppropriateLDMReader( const SbString& )
1043 { return NULL; };
1044
1045 // logical center per id
1046 bool getCenter(SoLDMTileID tileID, SbVec3f& center)const;
1047
1048 SoLDMMediator* getMediator() const
1049 {
1050 return m_mediator;
1051 };
1052 void setMediator(SoLDMMediator* m);
1053
1054 virtual bool createTex(int Zaxis, SoState *state, const SbVec3i32 &tileSize, SoBufferObject *tileDataBuffer, SoTransferFunction *transferFunction,
1055 SoBufferObject*& textureBufferObject, int alphaUse = 0);
1056
1057 // TODO FIXME : should cleanup this call.
1059 void* getTexData(const void* tileBuffer,
1060 int numElem,
1061 SoTransferFunction* transferFunction,
1062 int alphaUse,
1063 int texPrec,
1064 void *textureBuffer,
1065 SoDataRange* datarange,
1066 SoDataCompositor* dataCompositor);
1067
1068 // allocate ( if needed ) and initialize the texture buffer, according to the input buffer and the transfer function.
1069 // The texture buffer can be given with the tex_data argument. In this case no allocation is done and tex_data is returned.
1070 // Otherwise returns the initialized texture buffer.
1071 // Returned pointer does not need to be deleted, but reference to this buffer will be valid only until the next getTexData call.
1072 SoBufferObject* getTexData(SoBufferObject* tileBufferObject,
1073 SoTransferFunction* transferFunction,
1074 int alphaUse,
1075 int texPrec,
1076 SoBufferObject* textureBufferObject,
1077 SoDataRange* dataRange,
1078 SoDataCompositor* dataCompositor);
1079
1080 SoTexture::InternalFormat getRGBAInternalFormat() const;
1081
1082 SoLDMResourceManager& getResourceManager() { return *m_resourceManager; }
1083
1088 virtual int getTexPrec(SoState*);
1089
1095 void getTextureFormat(SoTransferFunction::GLColorMapType colorMapType,
1096 SbEnums::ImageDataFormat& format,
1098 SoTexture::InternalFormat& internalFormat) const;
1099
1100 //Display loaded tiles
1101 virtual void drawTilesInMainMemory(SoGLRenderAction* action, const SoLDM::DataSetIdPair& idPair);
1102
1103 //Copy dataset's fields if needed into the given mediator
1104 // Notifications are disabled on #ldmResourceParameters during the process
1105 void copyLDMParameters(SoLDMMediator *mediator);
1106
1112 virtual bool isMultidataEnabled() const { return m_multidataEnabled; }
1113
1114 // draw a colored Box
1115 enum BoxColor {
1116 GREY,
1117 RED,
1118 BLUE,
1119 GREEN,
1120 FULL_RES_GREY,
1121 FULL_RES_GREEN
1122 };
1123
1128 unsigned short getId() const
1129 { return m_id; }
1130
1134 bool hasReadError();
1135
1139 inline bool isEmpty()
1140 {
1141 const SbVec3i32& dim = getDimension();
1142 return ( dim[0] == 0 || dim[1] == 0 || dim[2] == 0 );
1143 };
1144
1149 struct DatumElement{
1151 int num;
1152 };
1153
1160 float convertToNormalizedTextureSpace(SoState *state, const float data);
1161
1165 void setFirstTraversalDone(bool flag);
1166
1170 bool isFirstTraversalDone() const;
1171
1172 virtual bool isPalettedTexture(SoState*);
1173
1174 // Get a unique signature for a given tile. If tile already loaded, return the
1175 // previously generated signature. Otherwise, generate a new one. Each dataset
1176 // manages its signature list.
1177 virtual uint64_t getTileSignature(const SoLDMTileID& tileId);
1178
1184 inline void setOwnedReader( SoVolumeReader &reader )
1185 { setReader( reader, TRUE ); };
1186
1187 /*
1188 Ref/unref mechanism on volume render used to manage
1189 GPU resources. Allow SoDataSet to free GPU resources when
1190 texture are not needed
1191 */
1192 void refVolRender( int contextId );
1193 void unrefVolRender( int contextId );
1194
1200 int getBestEqualResolution() const;
1201
1203 void invalidateHistogram();
1204
1206 SbVec2f getDataTypeMinMax() const;
1207
1215 SoLDMTileID getTileCharacteristics(const SoLDMTileID& tile, SbBox3i32& tileBox, SbVec3i32& tileDim) const;
1216
1220 bool supportUndefinedVoxel(SoState* state);
1221
1223 SoVolumeReader* getInternalReader() const;
1224
1225 int getTexelSizeBits(SoState* state = nullptr);
1226
1228 SbMatrix getVoxelMatrix() const;
1229
1231 SbMatrix getVoxelMatrixInv() const;
1232
1233private:
1234
1236 SoDataSet();
1237
1239 virtual ~SoDataSet();
1240
1241 inline virtual void computeLighting( const SbVec3i32& /* tileSize */, SoBufferObject* /* rgbaBuffer */ ) {};
1242
1246 virtual void setElement(SoState* state);
1247
1251 bool isUsingUserExtent();
1252
1253 /*
1254 Allows a class inheriting from SoDataSet to decide whether multiple data should be allowed or not.
1255 If it is the SoDataSet will assign one mediator for all dataset.
1256 Else one mediator is assigned for all dataset (one LDM core per dataset).
1257 In vviz this method checks whether a compositor or a shader is present in the state.
1258 If not then multidata is not allowed.
1259 */
1260 virtual bool enableMultidata(SoState* state);
1261
1262 //Return a reader according to m_filename and m_data
1263 virtual SoVolumeReader* getAppropriateReader();
1264
1266 bool m_forcePow2TileDim;
1267
1268 //LDM reader
1269 SoRef<SoFieldContainer> m_reader;
1270
1271 bool load(SoState*);
1272 virtual void unload();
1273 virtual void releaseMemory();
1274
1275
1276 bool m_multidataEnabled;
1277
1278 SbVec3i32 m_dimension;
1279 bool m_initialized;
1280
1281 SbDataType m_type;
1282 int m_numBits;
1283
1284 //True if data header has already been read
1285 bool m_dataCharRead;
1286
1287 SbString m_filename;
1288 virtual void updateFilename();
1289
1290
1291 unsigned short m_id;
1292
1293
1297 virtual void readerChanged();
1298
1299 void initReader();
1300
1301 virtual SoLDMMediator *createMediator();
1302 SoLDMMediator* m_mediator;
1303
1304 SoMultiDataSeparator *m_MultiDataSeparator;
1305
1306 SoLDMResourceManager* m_resourceManager;
1307
1308 void getTransferFunction(SoTransferFunction *transferFunction, int alphaUse,
1309 int &shift, int &offset, int &nrgba, unsigned int * &rgba);
1310
1311 //Build a tile out of the original full resolution data.
1312 //The data is taken out from disk by the reader (vol, am,..)
1313 //and subsampled until the desired level.
1314 virtual void buildTile(SoLDMTileID tileID, SoBufferObject* buffer);
1315
1316 SoVolumeHistogram *m_histogram;
1317
1319 virtual void ldmAction(SoLdmValuationAction* action);
1320
1324 virtual SbBool isRGBAData();
1325
1326SoINTERNAL private:
1327
1332 virtual SoLDMGeomElement* getAppropriateElement( SoLDMGeometry* SO_UNUSED_PARAM(v) )
1333 {
1334 return NULL;
1335 }
1336
1340 virtual unsigned short getMaxTexturePrecisionBits() const { return 16; }
1341
1342 SoSFFieldContainer customReader;
1343 SoSFBool customReaderOwnerShip;
1344
1349 SoSFLDMDataTransform editingStack;
1350
1351private:
1352
1354 void commonConstructor();
1355
1359 struct MTstruct {
1360 SoBufferObject *tmpTexture;
1361 SoCpuBufferUniform *tmpTextureUniform;
1362 SoBufferObject *tmpColormap;
1363 SoBufferObject *tmpTexturePermute;
1364 };
1365
1366#ifndef HIDDEN_FROM_DOC
1367 friend class SoVolumeState;
1368 friend class SoLDMMediator;
1369 friend class SoCpuBufferFromVolumeReaderImpl;
1370 friend class SoObliqueSliceLdm;
1371#endif
1373 friend class SoLDMGeometry;
1374};
1375
1376#ifdef _MSC_VER
1377#pragma warning( pop )
1378#endif
1379
1380#endif // _SO_DATA_SET_
1381
1382
3D box class.
Definition SbBox.h:649
<a href="IconLegend.html"><img src="extTGS.gif" alt="VSG extension" border="0"></a> 3D box class.
Definition SbBox.h:96
Class encoding a data type.
Definition SbDataType.h:58
DataType
Supported Data type.
Definition SbDataType.h:64
@ FLOAT
float
Definition SbDataType.h:78
@ SIGNED_BYTE
signed byte
Definition SbDataType.h:72
@ UNSIGNED_INT32
unsigned int (32bits)
Definition SbDataType.h:70
@ DOUBLE
Double.
Definition SbDataType.h:80
@ UNSIGNED_BYTE
unsigned byte
Definition SbDataType.h:66
@ SIGNED_SHORT
signed short
Definition SbDataType.h:74
@ UNSIGNED_SHORT
unsigned short
Definition SbDataType.h:68
@ SIGNED_INT32
signed int (32bits)
Definition SbDataType.h:76
4x4 matrix class.
Definition SbMatrix.h:309
Class for smart character strings.
Definition SbString.h:202
2D vector class.
Definition SbVec.h:76
3D vector class.
Definition SbVec.h:932
3D vector class.
Definition SbVec.h:1517
Abstract base class for all actions.
Definition SoAction.h:132
<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> LDM buff...
<a href="IconLegend.html"><img src="extLDM.gif" alt="Large Data Management" border="0"></a> Data set...
<a href="IconLegend.html"><img src="extTGS.gif" alt="VSG extension" border="0"></a> Data extraction ...
<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...
Definition SoDataSet.h:139
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...
Definition SoDataSet.h:270
SoSFBool useCompressedTexture
Controls use of OpenGL lossy texture compression for RGBA data (if available).
Definition SoDataSet.h:202
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.
Definition SoDataSet.h:302
@ CONTINUOUS
Specifies an image containing continuous scalar values (an image which is not a segmented image or a ...
Definition SoDataSet.h:310
@ DISCRETE
Specifies an image containing discrete values that represent labels.
Definition SoDataSet.h:318
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.
Definition SoDataSet.h:228
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)
Definition SoDataSet.h:868
virtual SbBox3f voxelToXYZ(const SbBox3f &box) const
Converts the specified box in voxel coordinates (I,J,K) to geometric coordinates (X,...
friend class SoLDMGeometry
Definition SoDataSet.h:1373
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.
Definition SoDataSet.h:187
SoSFLDMDataTransform dataTransform
If set to an appropriate SoLDMDataTransform object, the object's transformFunction method is called a...
Definition SoDataSet.h:261
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.
Definition SoDataSet.h:651
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.
Definition SoDataSet.h:669
@ DOUBLE
double
Definition SoDataSet.h:685
@ UNSIGNED_INT32
unsigned int (32bits)
Definition SoDataSet.h:675
@ UNSIGNED_BYTE
unsigned byte
Definition SoDataSet.h:671
@ UNSIGNED_SHORT
unsigned short
Definition SoDataSet.h:673
@ SIGNED_BYTE
signed byte
Definition SoDataSet.h:677
@ SIGNED_SHORT
signed short
Definition SoDataSet.h:679
@ SIGNED_INT32
signed int (32bits)
Definition SoDataSet.h:681
@ FLOAT
float
Definition SoDataSet.h:683
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...
Definition SoDataSet.h:161
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.
Definition SoDataSet.h:294
SoSFEnum valueInterpretation
Specifies if this dataset corresponds or does not correspond to a segmented image.
Definition SoDataSet.h:334
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.
Definition SoDataSet.h:404
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.
Definition SoDataSet.h:556
SoSFBox3f extent
The real size (extent) of the volume in modeling coordinates.
Definition SoDataSet.h:239
friend class SoLdmValuationAction
Definition SoDataSet.h:1372
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...
Definition SoLDMReader.h:98
<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
Definition SoLDMTileID.h:63
<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 SoAction
Definition SoNode.h:472
friend class SoCallbackAction
Definition SoNode.h:478
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.
Definition SoRef.h:90
Field containing a single Boolean value.
Definition SoSFBool.h:79
<a href="IconLegend.html"><img src="extTGS.gif" alt="VSG extension" border="0"></a> Field containing...
Definition SoSFBox3f.h:55
Field containing a floating-point value.
Definition SoSFDouble.h:53
Field containing an enumerated value.
Definition SoSFEnum.h:89
<a href="IconLegend.html"><img src="extTGS.gif" alt="VSG extension" border="0"></a> Field containing...
Field containing a int32_t integer.
Definition SoSFInt32.h:80
Field containing an SoLDMDataTransform object.
Field containing an SoLDMResourceParameters object.
Field containing an unsigned short integer.
Definition SoSFUShort.h:79
Traversal state.
Definition SoState.h:74
InternalFormat
Texture internal storage format.
Definition SoTexture.h:166
<a href="IconLegend.html"><img src="extLDM.gif" alt="Large Data Management" border="0"></a> Describe...
Stores runtime type information.
Definition SoType.h:98
Volume Data Histogram.
<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.
int SbBool
Boolean type.
Definition SbBase.h:87
std::pair< SoDataSet *, int > DataSetIdPair
Pair containing an SoDataset and its dataSetId.
Definition SoLDM.h:71