23#ifndef LDM_DATA_ACCESS_H
24#define LDM_DATA_ACCESS_H
26#include <Inventor/SbLinear.h>
27#include <Inventor/SbBox.h>
28#include <LDM/SoLDMTileID.h>
30#include <Inventor/STL/vector>
31#include <Inventor/STL/map>
33#include <Inventor/devices/SoBufferObject.h>
34#include <Inventor/devices/SoCpuBufferObject.h>
36#include <LDM/nodes/SoLDMResourceParameters.h>
39#pragma warning( push )
40#pragma warning(disable:4251)
443 void commonConstructor();
444 void allocate(
int numPoint);
919 const SbVec3i32* polyline,
void* buffer);
955 void initPerfCounters();
956 void resetPerfCounters();
960 int getZaxis(
const SbVec3f &)
const;
962 void copyData(
unsigned short dataSetId,
SoLDMTileID tile,
SoBufferObject* tileBufferObj,
int tileIndex,
int requestId,
bool canRelease=
true);
963 void requestNotCompleted(
int requestId);
964 std::vector<SoLDMTileID> getRequestedTiles(
int requestId);
965 SoDataSet* getRequestingDataSet(
int requestId);
967 void removeTileFromPrefetch(
const SoLDMTileID &tileId);
980 CopyWhat getTypeOfCopy () {
return m_copyInfo.copyWhat;};
986 void checkBox(
int& _max,
int& _min,
int volBox);
999 destBufferObj = NULL;
1005 subVolume.makeEmpty();
1007 copyWhat = COPY_SINGLE;
1013 voxelsToCopy = NULL;
1017 tilesFromDisk.clear();
1018 tilesToPrefetch.clear();
1021 ldmDataAccess = NULL;
1026 shouldCallback =
false;
1027 dataInfoPolyline = NULL;
1028 dataInfoLine = NULL;
1029 dataInfoPlane = NULL;
1031 dataInfoTrace = NULL;
1051 std::vector< std::vector<SbVec2i32> >* voxelsToCopy;
1053 std::vector<SoLDMTileID> tiles;
1054 std::vector<SoLDMTileID> tilesFromDisk;
1055 std::vector<SoLDMTileID> tilesToPrefetch;
1056 std::map<int64_t, SbVec3i32> tilesInfos;
1057 std::map<int64_t, int> tilesIndex;
1061 int64_t requestSize;
1063 bool shouldCallback;
1064 DataInfoPolyLine* dataInfoPolyline;
1065 DataInfoLine* dataInfoLine;
1066 DataInfoPlane* dataInfoPlane;
1067 DataInfoBox* dataInfoBox;
1068 DataInfoTrace* dataInfoTrace;
1089 SoLDMMediator *m_mediator;
1091 std::map<int, CopyInfo> m_requests;
1094 bool getRequestInfo(
int resolution,
const SbBox3i32& subVolume0,
SoBufferObject *bufferObj, DataInfoBox& info, CopyInfo& copyInfo);
1106 void copyData(
unsigned short ,
SoLDMTileID tile,
SoBufferObject* tileBufferObj,
int tileIndex, SoLDMDataAccess::CopyInfo& copyInfo);
1108 static void *readTraceFromDiskThreadRoutine(
void* userData);
1109 static void *readSliceFromDiskThreadRoutine(
void* userData);
1110 static void *readTilesFromDiskThreadRoutine(
void* userData);
1112 void buildPlane(
SoLDMDataAccess* dataAccess,
int firstAxis,
int secondAxis,
int sliceNumber);
1113 bool createThreadReadDisk(SoLDMDataAccess::threadType threadType);
1114 void updateTilesLists(SoLDMDataAccess::CopyInfo& copyInfo);
1115 void checkGetDataMode (
const SoLDMDataAccess::CopyWhat copyWhat);
1122 RequestState queryRequestState(
int requestId);
1124 int m_nextRequestId;
1125 int getNextRequestId();
1139 SoLDMAlgorithms* m_algorithms;
1146 bool m_threadMustStop;
1147 threadType m_threadType;
1152 CopyInfo& getCopyInfo();
1153 bool threadMustStop();
1167 SoDebugError::post(
"SoLDMDataAccess::endRequest",
"An asynchronous access has been made using first class SoLDMDataAccess. Please implement your own, overloading endRequest method.");
1173 return m_getDataMode;
1176inline SoLDMDataAccess::CopyInfo&
1177SoLDMDataAccess::getCopyInfo()
1183SoLDMDataAccess::threadMustStop()
1185 return m_threadMustStop;
1189SoLDMDataAccess::getDataAccessBarrier()
1191 return m_readerBarrier;
1195SoLDMDataAccess::getReaderThreadBarrier()
1197 return m_diskReadThreadBarrier;
1209#pragma warning( pop )
<a href="IconLegend.html"><img src="extTGS.gif" alt="VSG extension" border="0"></a> 3D box class.
<a href="IconLegend.html"><img src="extTGS.gif" alt="VSG extension" border="0"></a> Portable "barrie...
<a href="IconLegend.html"><img src="extTGS.gif" alt="VSG extension" border="0"></a> Portable thread ...
<a href="IconLegend.html"><img src="extTGS.gif" alt="VSG extension" border="0"></a> Abstract base cl...
<a href="IconLegend.html"><img src="extTGS.gif" alt="VSG extension" border="0"></a> CPU buffer objec...
<a href="IconLegend.html"><img src="extLDM.gif" alt="Large Data Management" border="0"></a> Data set...
static void post(const char *methodName, const char *formatString ...)
Posts an error.
Information about data returned for an arbitrary polyline.
SbVec3i32 ** segmentCoord
Segment coordinates in the data.
ErrorValue errorFlag
Error indicator.
int * segmentBufferDim
Dimension of buffer for each segment.
DataInfoPolyLine(int numPoint)
Constructor of a dataInfoPolyline.
int64_t bufferSize
Size of the requested data in bytes.
int * segmentBufferSize
Size of buffer for each segment (size = dimension*datatype).
void operator=(const DataInfoPolyLine &A)
int numSegment
Number of segments in the polyline.
DataInfoPolyLine(const DataInfoPolyLine &A)
Copy constructor.
virtual ~DataInfoPolyLine()
<a href="IconLegend.html"><img src="extLDM.gif" alt="Large Data Management" border="0"></a> Volume d...
SoDEPRECATED int requestData(int resolution, const SbBox3i32 &subVolume, void *buffer)
SbBool isTileUniform(int resolution, const SbVec3i32 &dataPosition, double &uniformValue)
Returns TRUE if the tile containing the data located at position dataPosition (IJK voxel coordinates)...
SoDEPRECATED int requestData(int resolution, const SbBox3i32 &subVolume, const SbVec2i32 &coord, void *buffer)
void getRequestedData(int requestId, DataInfoBox &infoBox)
Returns the data associated with requestID into infoBox.
SoLDMDataAccess()
Constructor.
DataInfoLine getData(int resolution, const SbBox3i32 &subVolume0, const SbLine &line, SoBufferObject *bufferObj=NULL)
Given a subvolume in voxel coordinates and a line, copies the data intersecting the line and the subv...
SoDEPRECATED int requestData(int resolution, const SbBox3i32 &subVolume, const SbLine &line, void *buffer)
SoDEPRECATED void getData(DataInfoPolyLine &infoPolyline, int resolution, const SbBox3i32 &subVolume, int numPoints, const SbVec3i32 *polyline, void *buffer)
int requestData(int resolution, const SbBox3i32 &subVolume0, const SbLine &line, SoBufferObject *bufferObj)
Given a subvolume in voxel coordinates and a line, asynchronously copies the data intersecting the li...
DataInfo getData(int resolution, const SbVec3i32 &dataPosition)
Returns a pointer to the block of data (LDM tile) which contains the voxel at dataPosition.
void getRequestedData(int requestId, DataInfoPolyLine &infoPolyline)
Returns the data associated with requestID into infoPolyline.
virtual ~SoLDMDataAccess()
Destructor.
SoDEPRECATED DataInfoPlane getData(int resolution, const SbBox3i32 &subVolume, const SbPlane &plane, void *buffer)
SoDEPRECATED int requestData(int resolution, const SbBox3i32 &subVolume, const SbPlane &plane, void *buffer)
int requestData(int resolution, const SbBox3i32 &subVolume, const SbPlane &plane, SoBufferObject *bufferObj)
Given a subvolume in voxel coordinates and a plane, asynchronously copies the data intersecting the p...
SbBox3i32 XYZToVoxel(const SbBox3f &boxXYZ)
Converts the specified box in geometric coordinates (X,Y,Z) to voxel coordinates (I,...
void setDataSet(SoDataSet *v)
Set dataset to fetch data from.
int requestData(int resolution, const SbBox3i32 &box, SoBufferObject *bufferObj)
Given a subvolume in voxel coordinates, asynchronously copies the associated data into an application...
SoDEPRECATED DataInfoTrace getData(int resolution, const SbBox3i32 &subVolume, const SbVec2i32 coord, void *buffer)
SoDEPRECATED DataInfoLine getData(int resolution, const SbBox3i32 &subVolume, const SbLine &line, void *buffer)
SbBox3f voxelToXYZ(const SbBox3i32 &boxIJK)
Converts the specified box in voxel coordinates (I,J,K) to geometric coordinates (X,...
void getRequestedData(int requestId, DataInfoTrace &infoTrace)
Returns the data associated with requestID into infoTrace .
SoDEPRECATED DataInfoBox getData(int resolution, const SbBox3i32 &subVolume, void *buffer)
SbVec3f voxelToXYZ(const SbVec3i32 &dataPosition)
Converts a voxel coordinate (I,J,K) to a geometry coordinate (X,Y,Z).
bool setGetDataMode(const GetDataMode getDataMode)
Set the GetDataMode.
int requestData(int resolution, const SbBox3i32 &subVolume0, const SbVec2i32 &coord, SoBufferObject *bufferObj)
Data values in a single seismic trace (a row of voxels along the volume X axis) are asynchronously co...
SoDEPRECATED int requestData(int resolution, const SbBox3i32 &subVolume, int numPoints, const SbVec3i32 *polyline, void *buffer)
virtual void endRequest(int requestId)
This method is called each time a data request is finished, meaning that the data requested asynchron...
DataInfoPlane getData(int resolution, const SbBox3i32 &subVolume0, const SbPlane &plane, SoBufferObject *bufferObj=NULL)
Given a subvolume in voxel coordinates and a plane, copies the data intersecting the plane and the su...
int requestData(int resolution, const SbBox3i32 &subVolume, int numPoints, const SbVec3i32 *polyline, SoBufferObject *bufferObj)
Given a subvolume in voxel coordinates and a stack of line, asynchronously copies the data intersecti...
SbVec3i32 XYZToVoxel(const SbVec3f &dataPosition)
Converts a geometry coordinate (X,Y,Z) to a voxel coordinate (I,J,K).
void releaseData(SoLDMTileID tileID)
Tells VolumeViz that this block of data (returned by getData above) is no longer in use by the applic...
GetDataMode getGetDataMode()
Returns the GetDataMode (see setGetDataMode).
DataInfoTrace getData(int resolution, const SbBox3i32 &subVolume, const SbVec2i32 coord, SoBufferObject *bufferObj=NULL)
Data values in a single seismic trace (a row of voxels along the volume X axis) are copied into an ap...
SoDataSet * getDataSet()
Returns the associated dataset.
DataInfoBox getData(int resolution, const SbBox3i32 &subVolume0, SoBufferObject *bufferObj=NULL)
Given a subvolume in voxel coordinates, copies the associated data into an application buffer.
void getData(DataInfoPolyLine &infoPolyline, int resolution, const SbBox3i32 &subVolume, int numPoints, const SbVec3i32 *polyline, SoBufferObject *bufferObj=NULL)
Given a subvolume in voxel coordinates and a polyline (set of connected line segments),...
void getRequestedData(int requestId, DataInfoLine &infoLine)
Returns the data associated with requestID into infoLine.
void getRequestedData(int requestId, DataInfoPlane &infoPlane)
Returns the data associated with requestID into infoPlane.
ErrorValue
Error Code values.
@ INCORRECT_SUBVOLUME
The specified subvolume does not intersect the data volume.
@ INCORRECT_BUFFER
Application buffer to copy data into is invalid.
@ INCORRECT_COORDINATE
The trace at the specified coordinate does not intersect the specified subvolume.
@ CORRECT
Request was successfully completed.
@ INCORRECT_POLYLINE
The specified polyline does not intersect the specified subvolume.
@ INCORRECT_RESOLUTION
The specified resolution is lower than the lowest resolution level of the data.
@ INCORRECT_LINE
The specified line does not intersect the specified subvolume.
@ MEMORY_FULL
No more memory is available.
@ REQUEST_NOT_COMPLETED
Requesting data from an unfinished asynchronous request.
@ INCORRECT_PLANE
The specified plane does not intersect the specified subvolume.
@ INCORRECT_POSITION
The specified position is outside the specified subvolume.
@ REQUEST_NOT_FOUND
Request is unknown.
GetDataMode
Specifies the way data is requested from the volume reader when the necessary tiles are not already p...
@ DIRECT_AND_PREFETCH
Same as Direct, but also schedule the relevant tiles to be loaded for faster future access.
@ CACHE
Request data by tile (default)
@ DIRECT
Request data directly.
LoadPolicy
Tile Load Policy.
<a href="IconLegend.html"><img src="extLDM.gif" alt="Large Data Management" border="0"></a> Tile ID
Abstract base class for Performance Counter.
Performance Counter Manager.
Smart pointer for any class inheriting SoRefCounter.
Information about data returned for an arbitrary box (subvolume).
int64_t bufferSize
Size of the requested data in bytes.
ErrorValue errorFlag
Error indicator.
SbVec3i32 bufferDimension
Dimensions of the 3D data (in voxels).
Information about returned data when directly accessing the data rather than copying the data.
ErrorValue errorFlag
Error indicator.
SbBox3i32 tilePosition
Position of the data tile in voxel coordinates (min = lower left back corner, max = upper right front...
SoLDMTileID tileID
LDM tile ID of the tile that contains the data at tilePosition.
SbVec3i32 tileDimension
Dimensions of the data tile in voxels.
void * tileData
Pointer to the data tile, valid until the releaseData() method of SoLDMDataAccess is called or the a...
int64_t bufferSize
Size of the data tile in bytes.
Information about data returned for an arbitrary line.
int64_t bufferSize
Size of the requested data in bytes.
int bufferDimension
Dimension of the 1D array of data (in voxels).
ErrorValue errorFlag
Error indicator.
SbVec3i32 lineCoord[2]
First and last point of the segment of data in voxel coordinates.
Information about data returned for an arbitrary plane.
SbVec3i32 quadCoord[4]
Quad corresponding to the returned data in voxel coordinates.
ErrorValue errorFlag
Error indicator.
int numPolygonPoints
Number of points of the polygon intersecting subvolume.
int64_t bufferSize
Size of the requested data in bytes.
SbVec3i32 polygonCoord[6]
Polygon intersecting subvolume in voxel coordinates.
int uAxis
Axis corresponding to the first dimension of the returned array.
int vAxis
Axis corresponding to the second dimension of the returned array.
SbVec2i32 bufferDimension
Dimension of the 2D data matrix (in voxels).
Information about data returned for an arbitrary trace (column of voxels).
int bufferDimension
Dimension of the 1D array of data (the number of values returned).
int64_t bufferSize
Size of the requested data in bytes.
ErrorValue errorFlag
Error indicator.