Go to the documentation of this file.
30 #ifndef vtkGPUVolumeRayCastMapper_h
31 #define vtkGPUVolumeRayCastMapper_h
32 #include <unordered_map>
35 #include <vtkRenderingVolumeModule.h>
57 vtkSetClampMacro( AutoAdjustSampleDistances,
vtkTypeBool, 0, 1 );
68 vtkSetClampMacro( LockSampleDistanceToInputSpacing,
vtkTypeBool, 0, 1 );
70 vtkBooleanMacro( LockSampleDistanceToInputSpacing,
vtkTypeBool );
112 vtkSetMacro( SampleDistance,
float );
113 vtkGetMacro( SampleDistance,
float );
124 vtkSetClampMacro( ImageSampleDistance,
float, 0.1f, 100.0f );
125 vtkGetMacro( ImageSampleDistance,
float );
133 vtkSetClampMacro( MinimumImageSampleDistance,
float, 0.1f, 100.0f );
134 vtkGetMacro( MinimumImageSampleDistance,
float );
142 vtkSetClampMacro( MaximumImageSampleDistance,
float, 0.1f, 100.0f );
143 vtkGetMacro( MaximumImageSampleDistance,
float );
161 vtkSetMacro( FinalColorWindow,
float );
162 vtkGetMacro( FinalColorWindow,
float );
163 vtkSetMacro( FinalColorLevel,
float );
164 vtkGetMacro( FinalColorLevel,
float );
183 vtkSetClampMacro( MaxMemoryFraction,
float, 0.1f, 1.0f );
184 vtkGetMacro( MaxMemoryFraction,
float );
196 vtkSetMacro(ReportProgress,
bool);
197 vtkGetMacro(ReportProgress,
bool);
216 double viewDirection[3],
245 enum { BinaryMaskType = 0, LabelMapMaskType };
252 vtkSetMacro( MaskType,
int );
253 vtkGetMacro( MaskType,
int );
267 vtkSetClampMacro(MaskBlendFactor,
float,0.0f,1.0f);
268 vtkGetMacro(MaskBlendFactor,
float);
297 vtkSetMacro(DepthImageScalarType,
int);
298 vtkGetMacro(DepthImageScalarType,
int);
394 vtkSetMacro(ColorRangeType,
int);
395 vtkGetMacro(ColorRangeType,
int);
396 vtkSetMacro(ScalarOpacityRangeType,
int);
397 vtkGetMacro(ScalarOpacityRangeType,
int);
398 vtkSetMacro(GradientOpacityRangeType,
int);
399 vtkGetMacro(GradientOpacityRangeType,
int);
488 double datasetBounds[6],
489 double scalarRange[2],
490 int numberOfScalarComponents,
491 unsigned int numberOfLevels)=0;
496 unsigned int level)=0;
499 int numberOfScalarComponents)=0;
585 using DataMap = std::unordered_map<int, vtkImageData*>;
589 double ClippedCroppingRegionPlanes[6];
static vtkGPUVolumeRayCastMapper * New()
vtkTypeBool LockSampleDistanceToInputSpacing
int GeneratingCanonicalView
Abstract class for a volume mapper.
virtual void GetDepthImage(vtkImageData *)
Low level API to export the depth texture as vtkImageData in RenderToImage mode.
virtual void PreRender(vtkRenderer *ren, vtkVolume *vol, double datasetBounds[6], double scalarRange[2], int numberOfScalarComponents, unsigned int numberOfLevels)=0
void SetMaskInput(vtkImageData *mask)
Optionally, set a mask input.
void SetMaskTypeToBinary()
represents a volume (data & properties) in a rendered scene
int GradientOpacityRangeType
vtkImageData * FindData(int port, DataMap &container)
vtkTypeBool AutoAdjustSampleDistances
void SetCellFlag(int cellFlag)
Called by the AMR Volume Mapper.
void SetDepthImageScalarTypeToUnsignedChar()
int ValidateRender(vtkRenderer *, vtkVolume *)
This method is used by the Render() method to validate everything before attempting to render.
virtual void RenderBlock(vtkRenderer *ren, vtkVolume *vol, unsigned int level)=0
double * GetBoundsFromPort(const int port)
void CloneInput(vtkImageData *input, const int port)
virtual void PostRender(vtkRenderer *ren, int numberOfScalarComponents)=0
float MaximumImageSampleDistance
int ScalarOpacityRangeType
vtkTypeBool ClampDepthToBackface
vtkGPUVolumeRayCastMapper()
float MinimumImageSampleDistance
vtkImageData * CanonicalViewImageData
void ReleaseGraphicsResources(vtkWindow *) override
Release any graphics resources that are being consumed by this mapper.
vtkImageData * GetInput() override
void SetDepthImageScalarTypeToFloat()
window superclass for vtkRenderWindow
void Render(vtkRenderer *, vtkVolume *) override
Initialize rendering for this volume.
void SetTransformedInput(vtkImageData *)
vtkImageData * GetInput(const int port) override
virtual void ClipCroppingRegionPlanes()
Compute the cropping planes clipped by the bounds of the volume.
int GetInputCount()
Number of currently active ports.
DataMap LastInputs
This is needed only to check if the input data has been changed since the last Render() call.
int ValidateInput(vtkVolumeProperty *property, const int port)
#define VTK_SIZEHINT(...)
vtkTypeBool RenderToImage
void SetInputConnection(int port, vtkAlgorithmOutput *input) override
Set the connection for the given input port index.
helper object to manage setting and generating contour values
DataMap TransformedInputs
topologically and geometrically regular array of data
a simple class to control print indentation
void PrintSelf(ostream &os, vtkIndent indent) override
Methods invoked by print to print information about the object including superclasses.
std::vector< int > RemovedPorts
Ray casting performed on the GPU.
void SetDepthImageScalarTypeToUnsignedShort()
float ImageSampleDistance
virtual void GetColorImage(vtkImageData *)
Low level API to export the color texture as vtkImageData in RenderToImage mode.
void SetInputConnection(vtkAlgorithmOutput *input) override
virtual int IsRenderSupported(vtkRenderWindow *vtkNotUsed(window), vtkVolumeProperty *vtkNotUsed(property))
Based on hardware and properties, we may or may not be able to render using 3D texture mapping.
std::unordered_map< int, vtkImageData * > DataMap
void CreateCanonicalView(vtkRenderer *ren, vtkVolume *volume, vtkImageData *image, int blend_mode, double viewDirection[3], double viewUp[3])
virtual void SetInputConnection(int port, vtkAlgorithmOutput *input)
Set the connection for the given input port index.
void CanonicalViewRender(vtkRenderer *, vtkVolume *)
void RemoveInputConnection(int port, int idx) override
Remove a connection given by index idx.
void RemovePortInternal(const int port)
~vtkGPUVolumeRayCastMapper() override
Proxy object to connect input/output ports.
abstract specification for renderers
virtual void GPURender(vtkRenderer *, vtkVolume *)
Handled in the subclass - the actual render method.
void SetMaskTypeToLabelMap()
int FillInputPortInformation(int port, vtkInformation *info) override
Handle inputs.
void RemoveInputConnection(int port, vtkAlgorithmOutput *input) override
Add/Remove input connections.
create a window for renderers to draw into
void TransformInput(const int port)
A transformation is applied (translation) to the input.
virtual vtkImageData * GetInput()
void CloneInputs()
Shallow-copy the inputs into a transform-adjusted clone.
vtkContourValues * GetDepthPassContourValues()
Return handle to contour values container so that values can be set by the application.
vtkIdType MaxMemoryInBytes
vtkImageData * GetTransformedInput(const int port=0)
vtkContourValues * DepthPassContourValues
represents the common properties for rendering a volume.
virtual void GetReductionRatio(double ratio[3])=0
Return how much the dataset has to be reduced in each dimension to fit on the GPU.