53#ifndef vtkVolumeTexture_h
54#define vtkVolumeTexture_h
61#include "vtkRenderingVolumeOpenGL2Module.h"
66VTK_ABI_NAMESPACE_BEGIN
90 TextureSize = texSize;
109 double DatasetStepSize[3];
115 double LoadedBounds[6];
116 double LoadedBoundsAA[6];
117 double VolumeGeometry[24];
172 static void GetScaleAndBias(
int scalarType,
float* scalarRange,
float& scale,
float& bias);
178 float ScalarRange[4][2];
179 float CellSpacing[3];
185 float AdjustedTexMin[4];
186 float AdjustedTexMax[4];
190 int CoordsTexSizes[3];
191 float CoordsScale[3];
208 bool LoadTexture(
int interpolation,
VolumeBlock* volBlock);
215 void CreateBlocks(
unsigned int format,
unsigned int internalFormat,
int type);
217 void AdjustExtentForCell(
Size6& extent);
218 Size3 ComputeBlockSize(
int* extent);
224 void SelectTextureFormat(
unsigned int& format,
unsigned int& internalFormat,
int& type,
225 int scalarType,
int noOfComponents);
237 void UpdateTextureToDataMatrix(
VolumeBlock* block);
257 void ComputeCellToPointMatrix(
int extents[6]);
268 bool AreDimensionsValid(
vtkTextureObject* texture,
int width,
int height,
int depth);
270 bool SafeLoadTexture(
vtkTextureObject* texture,
int width,
int height,
int depth,
int numComps,
271 int dataType,
void* dataPtr);
274 void UpdateInterpolationType(
int interpolation);
275 void SetInterpolation(
int interpolation);
281 std::vector<vtkDataSet*> ImageDataBlocks;
282 std::map<vtkDataSet*, VolumeBlock*> ImageDataBlockMap;
283 std::vector<VolumeBlock*> SortedVolumeBlocks;
284 size_t CurrentBlockIdx;
287 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.
bool LoadVolume(vtkRenderer *ren, vtkDataSet *data, vtkDataArray *scalars, int isCell, int interpolation)
Loads the data array into the texture in the case only a single block is is defined.
vtkSmartPointer< vtkTextureObject > BlankingTex
vtkNew< vtkMatrix4x4 > CellToPointMatrix
void SetPartitions(int x, int y, int z)
Set a number of blocks per axis.
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.
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()
static void GetScaleAndBias(int scalarType, float *scalarRange, float &scale, float &bias)
Get the scale and bias values given a VTK scalar type and a finite range.
void SortBlocksBackToFront(vtkRenderer *ren, vtkMatrix4x4 *volumeMat)
If streaming the data array as separate blocks, sort them back to front.
bool HandleLargeDataTypes
window superclass for vtkRenderWindow
VolumeBlock(vtkDataSet *dataset, vtkTextureObject *tex, Size3 const &texSize)
vtkNew< vtkMatrix4x4 > TextureToDataset
vtkNew< vtkMatrix4x4 > TextureToDatasetInv
vtkTextureObject * TextureObject