65 #ifndef vtkVolumeTexture_h
66 #define vtkVolumeTexture_h
73 #include "vtkRenderingVolumeOpenGL2Module.h"
100 TextureSize = texSize;
119 double DatasetStepSize[3];
125 double LoadedBounds[6];
126 double LoadedBoundsAA[6];
127 double VolumeGeometry[24];
147 int const interpolation);
188 float ScalarRange[4][2];
189 float CellSpacing[3];
195 float AdjustedTexMin[4];
196 float AdjustedTexMax[4];
210 bool LoadTexture(
int const interpolation,
VolumeBlock* volBlock);
217 void CreateBlocks(
unsigned int const format,
unsigned int const internalFormat,
int const type);
226 void SelectTextureFormat(
unsigned int& format,
unsigned int& internalFormat,
int&
type,
227 int const scalarType,
int const noOfComponents);
239 void UpdateTextureToDataMatrix(
VolumeBlock* block);
259 void ComputeCellToPointMatrix(
int extents[6]);
270 bool AreDimensionsValid(
274 int const depth,
int numComps,
int dataType,
void* dataPtr);
277 void UpdateInterpolationType(
int const interpolation);
278 void SetInterpolation(
int const interpolation);
284 std::vector<vtkImageData*> ImageDataBlocks;
285 std::map<vtkImageData*, VolumeBlock*> ImageDataBlockMap;
286 std::vector<VolumeBlock*> SortedVolumeBlocks;
287 size_t CurrentBlockIdx;
290 std::vector<Size3> TextureSizes;
abstract superclass for arrays of numeric data
topologically and geometrically regular array of data
a simple class to control print indentation
represent and manipulate 4x4 transformation matrices
abstract base class for most VTK objects
abstract specification for renderers
abstracts an OpenGL texture object.
record modification and/or execution time
represents the common properties for rendering a volume.
Creates and manages the volume texture rendered by vtkOpenGLGPUVolumeRayCastMapper.
static vtkVolumeTexture * New()
VolumeBlock * GetNextBlock()
Return the next volume block to be rendered and load its data.
bool LoadVolume(vtkRenderer *ren, vtkImageData *data, vtkDataArray *scalars, int const isCell, int const interpolation)
Loads the data array into the texture in the case only a single block is is defined.
vtkNew< vtkMatrix4x4 > CellToPointMatrix
vtkDataArray * GetLoadedScalars()
void PrintSelf(ostream &os, vtkIndent indent) override
Methods invoked by print to print information about the object including superclasses.
const Size3 & GetPartitions()
void UpdateVolume(vtkVolumeProperty *property)
It currently only calls SetInterpolation internally.
void ReleaseGraphicsResources(vtkWindow *win)
Clean-up acquired graphics resources.
~vtkVolumeTexture() override
void SetPartitions(int const i, int const j, int const k)
Set a number of blocks per axis.
void SortBlocksBackToFront(vtkRenderer *ren, vtkMatrix4x4 *volumeMat)
If streaming the data array as separate blocks, sort them back to front.
VolumeBlock * GetCurrentBlock()
Return the currently loaded block.
static void GetScaleAndBias(const int scalarType, float *scalarRange, float &scale, float &bias)
Get the scale and bias values given a VTK scalar type and a finite range.
bool HandleLargeDataTypes
window superclass for vtkRenderWindow
VolumeBlock(vtkImageData *imData, vtkTextureObject *tex, Size3 const &texSize)
vtkNew< vtkMatrix4x4 > TextureToDataset
vtkNew< vtkMatrix4x4 > TextureToDatasetInv
vtkTextureObject * TextureObject