VTK  9.2.6
vtkVolumeInputHelper.h
Go to the documentation of this file.
1/*=========================================================================
2
3 Program: Visualization Toolkit
4 Module: vtkVolumeInputHelper.h
5
6 Copyright (c) Ken Martin, Will Schroeder, Bill Lorensen
7 All rights reserved.
8 See Copyright.txt or http://www.kitware.com/Copyright.htm for details.
9
10 This software is distributed WITHOUT ANY WARRANTY; without even
11 the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
12 PURPOSE. See the above copyright notice for more information.
13
14=========================================================================*/
30#ifndef vtkVolumeInputHelper_h
31#define vtkVolumeInputHelper_h
32#include <map>
33
35#include "vtkRenderingVolumeOpenGL2Module.h" // For export macro
36#include "vtkSmartPointer.h" // For SmartPointer
37#include "vtkTimeStamp.h" // For TimeStamp
38
43class vtkRenderer;
45class vtkVolume;
47class vtkWindow;
48
49class VTKRENDERINGVOLUMEOPENGL2_EXPORT vtkVolumeInputHelper
50{
51public:
54
56 vtkRenderer* ren, const int uniformIndex, const int blendMode, const float samplingDist);
58
59 void ActivateTransferFunction(vtkShaderProgram* prog, const int blendMode);
60 void DeactivateTransferFunction(const int blendMode);
61
63
65 vtkVolume* Volume = nullptr;
66
72 {
75 LA = 2,
76 RGBA = 4
77 };
79
89
93 std::map<int, std::string> RGBTablesMap;
94 std::map<int, std::string> OpacityTablesMap;
95 std::map<int, std::string> GradientOpacityTablesMap;
96 std::map<int, std::string> TransferFunctions2DMap;
97
103 int ColorRangeType = 0; // vtkGPUVolumeRayCastMapper::SCALAR
104 int ScalarOpacityRangeType = 0; // vtkGPUVolumeRayCastMapper::SCALAR
105 int GradientOpacityRangeType = 0; // vtkGPUVolumeRayCastMapper::SCALAR
106
111 std::string GradientCacheName;
112
113protected:
114 void InitializeTransferFunction(vtkRenderer* ren, const int index);
115
116 void CreateTransferFunction1D(vtkRenderer* ren, const int index);
117 void CreateTransferFunction2D(vtkRenderer* ren, const int index);
118
119 void UpdateTransferFunctions(vtkRenderer* ren, const int blendMode, const float samplingDist);
120 int UpdateOpacityTransferFunction(vtkRenderer* ren, vtkVolume* vol, unsigned int component,
121 const int blendMode, const float samplingDist);
122 int UpdateColorTransferFunction(vtkRenderer* ren, vtkVolume* vol, unsigned int component);
124 vtkRenderer* ren, vtkVolume* vol, unsigned int component, const float samplingDist);
125 void UpdateTransferFunction2D(vtkRenderer* ren, unsigned int component);
126
129
132};
133
134#endif // vtkVolumeInputHelper_h
135// VTK-HeaderTest-Exclude: vtkVolumeInputHelper.h
abstract specification for renderers
Definition vtkRenderer.h:67
The ShaderProgram uses one or more Shader objects.
Hold a reference to a vtkObjectBase instance.
record modification and/or execution time
void ReleaseGraphicsResources(vtkWindow *window)
void UpdateTransferFunctions(vtkRenderer *ren, const int blendMode, const float samplingDist)
vtkSmartPointer< vtkOpenGLVolumeLookupTables< vtkOpenGLVolumeOpacityTable > > OpacityTables
std::map< int, std::string > TransferFunctions2DMap
std::string GradientCacheName
Stores the uniform variable name where the gradient will be stored for this input in the fragment sha...
void InitializeTransferFunction(vtkRenderer *ren, const int index)
std::map< int, std::string > GradientOpacityTablesMap
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.
int UpdateGradientOpacityTransferFunction(vtkRenderer *ren, vtkVolume *vol, unsigned int component, const float samplingDist)
void UpdateTransferFunction2D(vtkRenderer *ren, unsigned int component)
vtkVolumeInputHelper(vtkSmartPointer< vtkVolumeTexture > tex, vtkVolume *vol)
void ActivateTransferFunction(vtkShaderProgram *prog, const int blendMode)
std::map< int, std::string > OpacityTablesMap
void DeactivateTransferFunction(const int blendMode)
void CreateTransferFunction1D(vtkRenderer *ren, const int index)
vtkVolumeInputHelper()=default
int UpdateOpacityTransferFunction(vtkRenderer *ren, vtkVolume *vol, unsigned int component, const int blendMode, const float samplingDist)
vtkSmartPointer< vtkOpenGLVolumeLookupTables< vtkOpenGLVolumeTransferFunction2D > > TransferFunctions2D
int ColorRangeType
These values currently stored in vtkGPUVolumeRCMapper but should be moved into vtkVolumeProperty in o...
vtkSmartPointer< vtkOpenGLVolumeLookupTables< vtkOpenGLVolumeGradientOpacityTable > > GradientOpacityTables
Transfer function internal structures and helpers.
void ReleaseGraphicsTransfer1D(vtkWindow *window)
vtkSmartPointer< vtkOpenGLVolumeLookupTables< vtkOpenGLVolumeRGBTable > > RGBTables
int UpdateColorTransferFunction(vtkRenderer *ren, vtkVolume *vol, unsigned int component)
void CreateTransferFunction2D(vtkRenderer *ren, const int index)
void ReleaseGraphicsTransfer2D(vtkWindow *window)
void RefreshTransferFunction(vtkRenderer *ren, const int uniformIndex, const int blendMode, const float samplingDist)
Creates and manages the volume texture rendered by vtkOpenGLGPUVolumeRayCastMapper.
represents a volume (data & properties) in a rendered scene
Definition vtkVolume.h:45
window superclass for vtkRenderWindow
Definition vtkWindow.h:39