65#ifndef vtkVolumeTexture_h
66#define vtkVolumeTexture_h
73#include "vtkRenderingVolumeOpenGL2Module.h"
101 TextureSize = texSize;
120 double DatasetStepSize[3];
126 double LoadedBounds[6];
127 double LoadedBoundsAA[6];
128 double VolumeGeometry[24];
148 int const interpolation);
183 static void GetScaleAndBias(
const int scalarType,
float* scalarRange,
float& scale,
float& bias);
189 float ScalarRange[4][2];
190 float CellSpacing[3];
196 float AdjustedTexMin[4];
197 float AdjustedTexMax[4];
201 int CoordsTexSizes[3];
202 float CoordsScale[3];
219 bool LoadTexture(
int const interpolation,
VolumeBlock* volBlock);
226 void CreateBlocks(
unsigned int const format,
unsigned int const internalFormat,
int const type);
228 void AdjustExtentForCell(
Size6& extent);
229 Size3 ComputeBlockSize(
int* extent);
235 void SelectTextureFormat(
unsigned int& format,
unsigned int& internalFormat,
int& type,
236 int const scalarType,
int const noOfComponents);
248 void UpdateTextureToDataMatrix(
VolumeBlock* block);
268 void ComputeCellToPointMatrix(
int extents[6]);
279 bool AreDimensionsValid(
280 vtkTextureObject* texture,
int const width,
int const height,
int const depth);
282 bool SafeLoadTexture(
vtkTextureObject* texture,
int const width,
int const height,
283 int const depth,
int numComps,
int dataType,
void* dataPtr);
286 void UpdateInterpolationType(
int const interpolation);
287 void SetInterpolation(
int const interpolation);
293 std::vector<vtkDataSet*> ImageDataBlocks;
294 std::map<vtkDataSet*, VolumeBlock*> ImageDataBlockMap;
295 std::vector<VolumeBlock*> SortedVolumeBlocks;
296 size_t CurrentBlockIdx;
299 std::vector<Size3> TextureSizes;
abstract superclass for arrays of numeric data
abstract class to specify dataset behavior
topologically and geometrically regular array of data
a simple class to control print indentation
represent and manipulate 4x4 transformation matrices
Allocate and hold a VTK object.
abstract base class for most VTK objects
abstract specification for renderers
Hold a reference to a vtkObjectBase instance.
abstracts an OpenGL texture object.
record modification and/or execution time
templated base type for containers of constant size.
represents the common properties for rendering a volume.
Creates and manages the volume texture rendered by vtkOpenGLGPUVolumeRayCastMapper.
vtkSmartPointer< vtkTextureObject > BlankingTex
void SetPartitions(int const x, int const y, int const z)
Set a number of blocks per axis.
vtkNew< vtkMatrix4x4 > CellToPointMatrix
void PrintSelf(ostream &os, vtkIndent indent) override
Methods invoked by print to print information about the object including superclasses.
void UpdateVolume(vtkVolumeProperty *property)
It currently only calls SetInterpolation internally.
void ReleaseGraphicsResources(vtkWindow *win)
Clean-up acquired graphics resources.
bool LoadVolume(vtkRenderer *ren, vtkDataSet *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.
VolumeBlock * GetNextBlock()
Return the next volume block to be rendered and load its data.
static vtkVolumeTexture * New()
vtkDataArray * GetLoadedScalars()
vtkSmartPointer< vtkTextureObject > CoordsTex
VolumeBlock * GetCurrentBlock()
Return the currently loaded block.
~vtkVolumeTexture() override
const Size3 & GetPartitions()
void SortBlocksBackToFront(vtkRenderer *ren, vtkMatrix4x4 *volumeMat)
If streaming the data array as separate blocks, sort them back to front.
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(vtkDataSet *dataset, vtkTextureObject *tex, Size3 const &texSize)
vtkNew< vtkMatrix4x4 > TextureToDataset
vtkNew< vtkMatrix4x4 > TextureToDatasetInv
vtkTextureObject * TextureObject