VTK  9.4.20241218
vtkVolumeInputHelper.h
Go to the documentation of this file.
1// SPDX-FileCopyrightText: Copyright (c) Ken Martin, Will Schroeder, Bill Lorensen
2// SPDX-License-Identifier: BSD-3-Clause
18#ifndef vtkVolumeInputHelper_h
19#define vtkVolumeInputHelper_h
20#include <map>
21
23#include "vtkRenderingVolumeOpenGL2Module.h" // For export macro
24#include "vtkSmartPointer.h" // For SmartPointer
25#include "vtkTimeStamp.h" // For TimeStamp
26
27VTK_ABI_NAMESPACE_BEGIN
32class vtkRenderer;
34class vtkVolume;
36class vtkWindow;
37
38class VTKRENDERINGVOLUMEOPENGL2_EXPORT vtkVolumeInputHelper
39{
40public:
43
45 vtkRenderer* ren, int uniformIndex, int blendMode, float samplingDist);
47
48 void ActivateTransferFunction(vtkShaderProgram* prog, int blendMode);
49 void DeactivateTransferFunction(int blendMode);
50
52
54 vtkVolume* Volume = nullptr;
55
61 {
62 INVALID = 0,
63 INDEPENDENT = 1,
64 LA = 2,
65 RGBA = 4
66 };
67 int ComponentMode = INDEPENDENT;
68
78
82 std::map<int, std::string> RGBTablesMap;
83 std::map<int, std::string> OpacityTablesMap;
84 std::map<int, std::string> GradientOpacityTablesMap;
85 std::map<int, std::string> TransferFunctions2DMap;
86
92 int ColorRangeType = 0; // vtkGPUVolumeRayCastMapper::SCALAR
93 int ScalarOpacityRangeType = 0; // vtkGPUVolumeRayCastMapper::SCALAR
94 int GradientOpacityRangeType = 0; // vtkGPUVolumeRayCastMapper::SCALAR
95
100 std::string GradientCacheName;
101
102protected:
104
107
108 void UpdateTransferFunctions(vtkRenderer* ren, int blendMode, float samplingDist);
110 vtkRenderer* ren, vtkVolume* vol, unsigned int component, int blendMode, float samplingDist);
111 int UpdateColorTransferFunction(vtkRenderer* ren, vtkVolume* vol, unsigned int component);
113 vtkRenderer* ren, vtkVolume* vol, unsigned int component, float samplingDist);
114 void UpdateTransferFunction2D(vtkRenderer* ren, unsigned int component);
115
118
120 bool InitializeTransfer = true;
121};
122
123VTK_ABI_NAMESPACE_END
124#endif // vtkVolumeInputHelper_h
125// VTK-HeaderTest-Exclude: vtkVolumeInputHelper.h
abstract specification for renderers
The ShaderProgram uses one or more Shader objects.
Hold a reference to a vtkObjectBase instance.
record modification and/or execution time
Convenience container for internal structures specific to a volume input.
void ReleaseGraphicsResources(vtkWindow *window)
vtkSmartPointer< vtkOpenGLVolumeLookupTables< vtkOpenGLVolumeOpacityTable > > OpacityTables
int UpdateGradientOpacityTransferFunction(vtkRenderer *ren, vtkVolume *vol, unsigned int component, float samplingDist)
std::map< int, std::string > TransferFunctions2DMap
int UpdateOpacityTransferFunction(vtkRenderer *ren, vtkVolume *vol, unsigned int component, int blendMode, float samplingDist)
std::string GradientCacheName
Stores the uniform variable name where the gradient will be stored for this input in the fragment sha...
std::map< int, std::string > GradientOpacityTablesMap
void UpdateTransferFunctions(vtkRenderer *ren, int blendMode, float samplingDist)
vtkSmartPointer< vtkVolumeTexture > Texture
std::map< int, std::string > RGBTablesMap
Maps uniform texture variable names to its corresponding texture unit.
ComponentMode
Defines the various component modes supported by vtkGPUVolumeRayCastMapper.
void UpdateTransferFunction2D(vtkRenderer *ren, unsigned int component)
vtkVolumeInputHelper(vtkSmartPointer< vtkVolumeTexture > tex, vtkVolume *vol)
std::map< int, std::string > OpacityTablesMap
void DeactivateTransferFunction(int blendMode)
void CreateTransferFunction1D(vtkRenderer *ren, int index)
vtkVolumeInputHelper()=default
vtkSmartPointer< vtkOpenGLVolumeLookupTables< vtkOpenGLVolumeTransferFunction2D > > TransferFunctions2D
vtkSmartPointer< vtkOpenGLVolumeLookupTables< vtkOpenGLVolumeGradientOpacityTable > > GradientOpacityTables
Transfer function internal structures and helpers.
void ReleaseGraphicsTransfer1D(vtkWindow *window)
void InitializeTransferFunction(vtkRenderer *ren, int index)
void RefreshTransferFunction(vtkRenderer *ren, int uniformIndex, int blendMode, float samplingDist)
void CreateTransferFunction2D(vtkRenderer *ren, int index)
vtkSmartPointer< vtkOpenGLVolumeLookupTables< vtkOpenGLVolumeRGBTable > > RGBTables
int UpdateColorTransferFunction(vtkRenderer *ren, vtkVolume *vol, unsigned int component)
void ActivateTransferFunction(vtkShaderProgram *prog, int blendMode)
void ReleaseGraphicsTransfer2D(vtkWindow *window)
Creates and manages the volume texture rendered by vtkOpenGLGPUVolumeRayCastMapper.
represents a volume (data & properties) in a rendered scene
Definition vtkVolume.h:130
window superclass for vtkRenderWindow
Definition vtkWindow.h:48