Class OpenVDS::IVolumeDataAccessManager

class IVolumeDataAccessManager

Public Types

typedef void (*ErrorHandler)(Error *error, int errorCode, const char *errorMessage)

Public Functions

virtual void AddRef() = 0
virtual void Release() = 0
virtual int RefCount() const = 0
virtual VolumeDataLayout const *GetVolumeDataLayout() = 0

Get the VolumeDataLayout object for a VDS.

Returns:

The VolumeDataLayout object associated with the VDS or NULL if there is no valid VolumeDataLayout.

virtual VDSProduceStatus GetVDSProduceStatus(DimensionsND dimensionsND, int LOD, int channel) = 0

Get the produce status for the specific DimensionsND/LOD/Channel combination.

Parameters:
  • dimensionsND – The dimensions group we’re getting the produce status for.

  • LOD – The LOD level we’re getting the produce status for.

  • channel – The channel index we’re getting the produce status for.

Returns:

The produce status for the specific DimensionsND/LOD/Channel combination.

virtual int64_t GetVDSChunkCount(DimensionsND dimensionsND, int LOD, int channel) = 0

Get the chunk count for the specific DimensionsND/LOD/Channel combination.

Parameters:
  • dimensionsND – The dimensions group we’re getting the chunk count for.

  • LOD – The LOD level we’re getting the chunk count status for.

  • channel – The channel index we’re getting the chunk count status for.

Returns:

The chunk count for the specific DimensionsND/LOD/Channel combination.

virtual VolumeDataPageAccessor *CreateVolumeDataPageAccessor(DimensionsND dimensionsND, int LOD, int channel, int maxPages, VolumeDataPageAccessor::AccessMode accessMode, int chunkMetadataPageSize = 1024) = 0

Create a VolumeDataPageAccessor object for the VDS.

Parameters:
  • dimensionsND – The dimensions group that the volume data page accessor will access.

  • LOD – The LOD level that the volume data page accessor will access.

  • channel – The channel index that the volume data page accessor will access.

  • maxPages – The maximum number of pages that the volume data page accessor will cache.

  • accessMode – This specifies the access mode (ReadOnly/ReadWrite/Create) of the volume data page accessor.

  • chunkMetadataPageSize – The chunk metadata page size of the layer. This controls how many chunk metadata entries are written per page, and is only used when the access mode is Create. If this number is too low it will degrade performance, but in certain situations it can be advantageous to make this number a multiple of the number of chunks in some of the dimensions. Do not change this from the default (1024) unless you know exactly what you are doing.

Returns:

A VolumeDataPageAccessor object for the VDS.

virtual void DestroyVolumeDataPageAccessor(VolumeDataPageAccessor *volumeDataPageAccessor) = 0

Destroy a volume data page accessor object.

Parameters:

volumeDataPageAccessor – The VolumeDataPageAccessor object to destroy.

virtual void DestroyVolumeDataAccessor(IVolumeDataAccessor *accessor) = 0
virtual IVolumeDataAccessor *CloneVolumeDataAccessor(IVolumeDataAccessor const &accessor) = 0
virtual IVolumeDataReadWriteAccessor<IntVector2, bool> *Create2DVolumeDataAccessor1Bit(VolumeDataPageAccessor *volumeDataPageAccessor, float replacementNoValue) = 0
virtual IVolumeDataReadWriteAccessor<IntVector2, uint8_t> *Create2DVolumeDataAccessorU8(VolumeDataPageAccessor *volumeDataPageAccessor, float replacementNoValue) = 0
virtual IVolumeDataReadWriteAccessor<IntVector2, uint16_t> *Create2DVolumeDataAccessorU16(VolumeDataPageAccessor *volumeDataPageAccessor, float replacementNoValue) = 0
virtual IVolumeDataReadWriteAccessor<IntVector2, uint32_t> *Create2DVolumeDataAccessorU32(VolumeDataPageAccessor *volumeDataPageAccessor, float replacementNoValue) = 0
virtual IVolumeDataReadWriteAccessor<IntVector2, uint64_t> *Create2DVolumeDataAccessorU64(VolumeDataPageAccessor *volumeDataPageAccessor, float replacementNoValue) = 0
virtual IVolumeDataReadWriteAccessor<IntVector2, float> *Create2DVolumeDataAccessorR32(VolumeDataPageAccessor *volumeDataPageAccessor, float replacementNoValue) = 0
virtual IVolumeDataReadWriteAccessor<IntVector2, double> *Create2DVolumeDataAccessorR64(VolumeDataPageAccessor *volumeDataPageAccessor, float replacementNoValue) = 0
virtual IVolumeDataReadWriteAccessor<IntVector3, bool> *Create3DVolumeDataAccessor1Bit(VolumeDataPageAccessor *volumeDataPageAccessor, float replacementNoValue) = 0
virtual IVolumeDataReadWriteAccessor<IntVector3, uint8_t> *Create3DVolumeDataAccessorU8(VolumeDataPageAccessor *volumeDataPageAccessor, float replacementNoValue) = 0
virtual IVolumeDataReadWriteAccessor<IntVector3, uint16_t> *Create3DVolumeDataAccessorU16(VolumeDataPageAccessor *volumeDataPageAccessor, float replacementNoValue) = 0
virtual IVolumeDataReadWriteAccessor<IntVector3, uint32_t> *Create3DVolumeDataAccessorU32(VolumeDataPageAccessor *volumeDataPageAccessor, float replacementNoValue) = 0
virtual IVolumeDataReadWriteAccessor<IntVector3, uint64_t> *Create3DVolumeDataAccessorU64(VolumeDataPageAccessor *volumeDataPageAccessor, float replacementNoValue) = 0
virtual IVolumeDataReadWriteAccessor<IntVector3, float> *Create3DVolumeDataAccessorR32(VolumeDataPageAccessor *volumeDataPageAccessor, float replacementNoValue) = 0
virtual IVolumeDataReadWriteAccessor<IntVector3, double> *Create3DVolumeDataAccessorR64(VolumeDataPageAccessor *volumeDataPageAccessor, float replacementNoValue) = 0
virtual IVolumeDataReadWriteAccessor<IntVector4, bool> *Create4DVolumeDataAccessor1Bit(VolumeDataPageAccessor *volumeDataPageAccessor, float replacementNoValue) = 0
virtual IVolumeDataReadWriteAccessor<IntVector4, uint8_t> *Create4DVolumeDataAccessorU8(VolumeDataPageAccessor *volumeDataPageAccessor, float replacementNoValue) = 0
virtual IVolumeDataReadWriteAccessor<IntVector4, uint16_t> *Create4DVolumeDataAccessorU16(VolumeDataPageAccessor *volumeDataPageAccessor, float replacementNoValue) = 0
virtual IVolumeDataReadWriteAccessor<IntVector4, uint32_t> *Create4DVolumeDataAccessorU32(VolumeDataPageAccessor *volumeDataPageAccessor, float replacementNoValue) = 0
virtual IVolumeDataReadWriteAccessor<IntVector4, uint64_t> *Create4DVolumeDataAccessorU64(VolumeDataPageAccessor *volumeDataPageAccessor, float replacementNoValue) = 0
virtual IVolumeDataReadWriteAccessor<IntVector4, float> *Create4DVolumeDataAccessorR32(VolumeDataPageAccessor *volumeDataPageAccessor, float replacementNoValue) = 0
virtual IVolumeDataReadWriteAccessor<IntVector4, double> *Create4DVolumeDataAccessorR64(VolumeDataPageAccessor *volumeDataPageAccessor, float replacementNoValue) = 0
virtual IVolumeDataReadAccessor<FloatVector2, float> *Create2DInterpolatingVolumeDataAccessorR32(VolumeDataPageAccessor *volumeDataPageAccessor, float replacementNoValue, InterpolationMethod interpolationMethod) = 0
virtual IVolumeDataReadAccessor<FloatVector2, double> *Create2DInterpolatingVolumeDataAccessorR64(VolumeDataPageAccessor *volumeDataPageAccessor, float replacementNoValue, InterpolationMethod interpolationMethod) = 0
virtual IVolumeDataReadAccessor<FloatVector3, float> *Create3DInterpolatingVolumeDataAccessorR32(VolumeDataPageAccessor *volumeDataPageAccessor, float replacementNoValue, InterpolationMethod interpolationMethod) = 0
virtual IVolumeDataReadAccessor<FloatVector3, double> *Create3DInterpolatingVolumeDataAccessorR64(VolumeDataPageAccessor *volumeDataPageAccessor, float replacementNoValue, InterpolationMethod interpolationMethod) = 0
virtual IVolumeDataReadAccessor<FloatVector4, float> *Create4DInterpolatingVolumeDataAccessorR32(VolumeDataPageAccessor *volumeDataPageAccessor, float replacementNoValue, InterpolationMethod interpolationMethod) = 0
virtual IVolumeDataReadAccessor<FloatVector4, double> *Create4DInterpolatingVolumeDataAccessorR64(VolumeDataPageAccessor *volumeDataPageAccessor, float replacementNoValue, InterpolationMethod interpolationMethod) = 0
virtual int64_t GetVolumeSubsetBufferSize(const int (&minVoxelCoordinates)[VolumeDataLayout::Dimensionality_Max], const int (&maxVoxelCoordinates)[VolumeDataLayout::Dimensionality_Max], VolumeDataFormat format, int LOD = 0, int channel = 0) = 0

Compute the buffer size (in bytes) for a volume subset request.

Parameters:
  • minVoxelCoordinates – The minimum voxel coordinates to request in each dimension (inclusive).

  • maxVoxelCoordinates – The maximum voxel coordinates to request in each dimension (exclusive).

  • format – Voxel format of the destination buffer.

  • LOD – The LOD level the requested data is read from.

  • channel – The channel index the requested data is read from.

Returns:

The buffer size needed.

virtual int64_t RequestVolumeSubset(void *buffer, int64_t bufferByteSize, DimensionsND dimensionsND, int LOD, int channel, const int (&minVoxelCoordinates)[VolumeDataLayout::Dimensionality_Max], const int (&maxVoxelCoordinates)[VolumeDataLayout::Dimensionality_Max], VolumeDataFormat format, optional<float> replacementNoValue = optional<float>()) = 0

Request a subset of the input VDS.

Parameters:
  • buffer – Pointer to a preallocated buffer holding at least as many elements of format as indicated by minVoxelCoordinates and maxVoxelCoordinates.

  • bufferByteSize – The size of the provided buffer, in bytes.

  • dimensionsND – The dimensiongroup the requested data is read from.

  • LOD – The LOD level the requested data is read from.

  • channel – The channel index the requested data is read from.

  • minVoxelCoordinates – The minimum voxel coordinates to request in each dimension (inclusive).

  • maxVoxelCoordinates – The maximum voxel coordinates to request in each dimension (exclusive).

  • format – Voxel format of the destination buffer.

  • replacementNoValue – If specified, this value is used to replace regions of the input VDS that has no data.

Returns:

The RequestID which can be used to query the status of the request, cancel the request or wait for the request to complete.

virtual int64_t GetProjectedVolumeSubsetBufferSize(const int (&minVoxelCoordinates)[VolumeDataLayout::Dimensionality_Max], const int (&maxVoxelCoordinates)[VolumeDataLayout::Dimensionality_Max], DimensionsND projectedDimensions, VolumeDataFormat format, int LOD = 0, int channel = 0) = 0

Compute the buffer size (in bytes) for a projected volume subset request.

Parameters:
  • minVoxelCoordinates – The minimum voxel coordinates to request in each dimension (inclusive).

  • maxVoxelCoordinates – The maximum voxel coordinates to request in each dimension (exclusive).

  • projectedDimensions – The 2D dimension group that the plane in the source dimensiongroup is projected into. It must be a 2D subset of the source dimensions.

  • format – Voxel format of the destination buffer.

  • LOD – The LOD level the requested data is read from.

  • channel – The channel index the requested data is read from.

Returns:

The buffer size needed.

virtual int64_t RequestProjectedVolumeSubset(void *buffer, int64_t bufferByteSize, DimensionsND dimensionsND, int LOD, int channel, const int (&minVoxelCoordinates)[VolumeDataLayout::Dimensionality_Max], const int (&maxVoxelCoordinates)[VolumeDataLayout::Dimensionality_Max], FloatVector4 const &voxelPlane, DimensionsND projectedDimensions, VolumeDataFormat format, InterpolationMethod interpolationMethod, optional<float> replacementNoValue = optional<float>()) = 0

Request a subset projected from an arbitrary 3D plane through the subset onto one of the sides of the subset.

Parameters:
  • buffer – Pointer to a preallocated buffer holding at least as many elements of format as indicated by minVoxelCoordinates and maxVoxelCoordinates for the projected dimensions.

  • bufferByteSize – The size of the provided buffer, in bytes.

  • dimensionsND – The dimensiongroup the requested data is read from.

  • LOD – The LOD level the requested data is read from.

  • channel – The channel index the requested data is read from.

  • minVoxelCoordinates – The minimum voxel coordinates to request in each dimension (inclusive).

  • maxVoxelCoordinates – The maximum voxel coordinates to request in each dimension (exclusive).

  • voxelPlane – The plane equation for the projection from the dimension source to the projected dimensions (which must be a 2D subset of the source dimensions).

  • projectedDimensions – The 2D dimension group that the plane in the source dimensiongroup is projected into. It must be a 2D subset of the source dimensions.

  • interpolationMethod – Interpolation method to use when sampling the buffer.

  • format – Voxel format of the destination buffer.

  • replacementNoValue – If specified, this value is used to replace regions of the input VDS that has no data.

Returns:

The RequestID which can be used to query the status of the request, cancel the request or wait for the request to complete.

virtual int64_t GetVolumeSamplesBufferSize(int sampleCount, int channel = 0) = 0

Compute the buffer size (in bytes) for a volume samples request.

Parameters:
  • sampleCount – Number of samples to request.

  • channel – The channel index the requested data is read from.

Returns:

The buffer size needed.

virtual int64_t RequestVolumeSamples(float *buffer, int64_t bufferByteSize, DimensionsND dimensionsND, int LOD, int channel, const float (*samplePositions)[VolumeDataLayout::Dimensionality_Max], int sampleCount, InterpolationMethod interpolationMethod, optional<float> replacementNoValue = optional<float>()) = 0

Request sampling of the input VDS at the specified coordinates.

Parameters:
  • buffer – Pointer to a preallocated buffer holding at least sampleCount elements.

  • bufferByteSize – The size of the provided buffer, in bytes.

  • dimensionsND – The dimensiongroup the requested data is read from.

  • LOD – The LOD level the requested data is read from.

  • channel – The channel index the requested data is read from.

  • samplePositions – Pointer to array of VolumeDataLayout::Dimensionality_Max-elements indicating the positions to sample. May be deleted once RequestVolumeSamples return, as HueSpace makes a deep copy of the data.

  • sampleCount – Number of samples to request.

  • interpolationMethod – Interpolation method to use when sampling the buffer.

  • replacementNoValue – If specified, this value is used to replace regions of the input VDS that has no data.

Returns:

The RequestID which can be used to query the status of the request, cancel the request or wait for the request to complete.

virtual int64_t GetVolumeTracesBufferSize(int traceCount, int traceDimension, int LOD = 0, int channel = 0) = 0

Compute the buffer size (in bytes) for a volume traces request.

Parameters:
  • traceCount – Number of traces to request.

  • traceDimension – The dimension to trace

  • LOD – The LOD level the requested data is read from.

  • channel – The channel index the requested data is read from.

Returns:

The buffer size needed.

virtual int64_t RequestVolumeTraces(float *buffer, int64_t bufferByteSize, DimensionsND dimensionsND, int LOD, int channel, const float (*tracePositions)[VolumeDataLayout::Dimensionality_Max], int traceCount, InterpolationMethod interpolationMethod, int traceDimension, optional<float> replacementNoValue = optional<float>()) = 0

Request traces from the input VDS.

Parameters:
  • buffer – Pointer to a preallocated buffer holding at least traceCount * number of samples in the traceDimension.

  • bufferByteSize – The size of the provided buffer, in bytes.

  • dimensionsND – The dimensiongroup the requested data is read from.

  • LOD – The LOD level the requested data is read from.

  • channel – The channel index the requested data is read from.

  • tracePositions – Pointer to array of traceCount VolumeDataLayout::Dimensionality_Max-elements indicating the trace positions.

  • traceCount – Number of traces to request.

  • interpolationMethod – Interpolation method to use when sampling the buffer.

  • traceDimension – The dimension to trace

  • replacementNoValue – If specified, this value is used to replace regions of the input VDS that has no data.

Returns:

The RequestID which can be used to query the status of the request, cancel the request or wait for the request to complete.

virtual int64_t PrefetchVolumeChunk(DimensionsND dimensionsND, int LOD, int channel, int64_t chunkIndex) = 0

Force production of a specific volume data chunk.

Parameters:
  • dimensionsND – The dimensiongroup the requested chunk belongs to.

  • LOD – The LOD level the requested chunk belongs to.

  • channel – The channel index the requested chunk belongs to.

  • chunkIndex – The index of the chunk to prefetch.

Returns:

The RequestID which can be used to query the status of the request, cancel the request or wait for the request to complete.

virtual bool IsCompleted(int64_t requestID) = 0

Check if a request completed successfully. If the request completed, the buffer now contains valid data.

Parameters:

requestID – The RequestID to check for completion.

Returns:

Either IsCompleted, IsCanceled or WaitForCompletion will return true a single time, after that the request is taken out of the system.

virtual bool IsCanceled(int64_t requestID) = 0

Check if a request was canceled (e.g. the VDS was invalidated before the request was processed). If the request was canceled, the buffer does not contain valid data.

Parameters:

requestID – The RequestID to check for cancellation.

Returns:

Either IsCompleted, IsCanceled or WaitForCompletion will return true a single time, after that the request is taken out of the system.

virtual bool IsCanceled(int64_t requestID, ReadErrorException *error) = 0

Check if a request was canceled (e.g. the VDS was invalidated before the request was processed). If the request was canceled, the buffer does not contain valid data.

Parameters:
  • requestID – The RequestID to check for cancellation.

  • error – This out parameter will be set to the error that caused the cancellation.

Returns:

Either IsCompleted, IsCanceled or WaitForCompletion will return true a single time, after that the request is taken out of the system.

virtual bool WaitForCompletion(int64_t requestID, int millisecondsBeforeTimeout = 0) = 0

Wait for a request to complete successfully. If the request completed, the buffer now contains valid data.

Parameters:
  • requestID – The RequestID to wait for completion of.

  • millisecondsBeforeTimeout – The number of milliseconds to wait before timing out (optional). A value of 0 indicates there is no timeout and we will wait for however long it takes. Note that the request is not automatically canceled if the wait times out, you can also use this mechanism to e.g. update a progress bar while waiting. If you want to cancel the request you have to explicitly call CancelRequest() and then wait for the request to stop writing to the buffer.

Returns:

Either IsCompleted, IsCanceled or WaitForCompletion will return true a single time, after that the request is taken out of the system. Whenever WaitForCompletion returns false you need to call IsCanceled() to know if that was because of a timeout or if the request was canceled.

virtual void Cancel(int64_t requestID) = 0

Try to cancel the request. You still have to call WaitForCompletion/IsCanceled to make sure the buffer is not being written to and to take the job out of the system. It is possible that the request has completed concurrently with the call to Cancel in which case WaitForCompletion will return true.

Parameters:

requestID – The RequestID to cancel.

virtual void CancelAndWaitForCompletion(int64_t requestID) = 0

Cancel the request and wait for it to complete. This call will block until the request has completed so you can be sure the buffer is not being written to and the job is taken out of the system.

Parameters:

requestID – The RequestID to cancel.

virtual float GetCompletionFactor(int64_t requestID) = 0

Get the completion factor (between 0 and 1) of the request.

Parameters:

requestID – The RequestID to get the completion factor of.

Returns:

A factor (between 0 and 1) indicating how much of the request has been completed.

virtual void Flush(ErrorHandler errorHandler, Error *error = nullptr) = 0

Flush any pending writes and write updated layer status.

Public Static Attributes

static constexpr int Dimensionality_Max = VolumeDataLayout::Dimensionality_Max

the maximum number of dimensions a VDS can have