VTK  9.5.2
vtkOpenGLSurfaceProbeVolumeMapper.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
44
45#ifndef vtkOpenGLSurfaceProbeVolumeMapper_h
46#define vtkOpenGLSurfaceProbeVolumeMapper_h
47
48#include "vtkNew.h" // For vtkNew
50#include "vtkRenderingVolumeOpenGL2Module.h" // For export macro
51
52VTK_ABI_NAMESPACE_BEGIN
57
58class VTKRENDERINGVOLUMEOPENGL2_EXPORT vtkOpenGLSurfaceProbeVolumeMapper
60{
61public:
62 static vtkOpenGLSurfaceProbeVolumeMapper* New();
63 vtkTypeMacro(vtkOpenGLSurfaceProbeVolumeMapper, vtkOpenGLPolyDataMapper);
64
66
74
76
83
85
88 vtkGetMacro(Window, double);
89 vtkSetMacro(Window, double);
90
91 vtkGetMacro(Level, double);
92 vtkSetMacro(Level, double);
94
96
102 enum class BlendModes : unsigned int
103 {
104 NONE = 0,
105 MAX,
106 MIN,
107 AVERAGE
108 };
109
112 void SetBlendModeToNone() { this->SetBlendMode(BlendModes::NONE); }
113 void SetBlendModeToMaximumIntensity() { this->SetBlendMode(BlendModes::MAX); }
114 void SetBlendModeToMinimumIntensity() { this->SetBlendMode(BlendModes::MIN); }
117
119
122 vtkGetMacro(BlendWidth, double);
123 vtkSetMacro(BlendWidth, double);
125
126 void RenderPiece(vtkRenderer* ren, vtkActor* act) override;
127
128 void UpdateShaders(vtkOpenGLHelper& cellBO, vtkRenderer* ren, vtkActor* act) override;
129
130protected:
131 int FillInputPortInformation(int port, vtkInformation* info) override;
132
136
137private:
138 vtkOpenGLSurfaceProbeVolumeMapper();
139 ~vtkOpenGLSurfaceProbeVolumeMapper() override = default;
140
142 void ReplaceActiveFBO(vtkRenderer*);
143 void RestoreActiveFBO(vtkRenderer*);
144
146
147 vtkNew<vtkTextureObject> PositionsTextureObject;
148 vtkNew<vtkTextureObject> NormalsTextureObject;
149 vtkNew<vtkVolumeTexture> VolumeTexture;
150
151 vtkNew<vtkImageData> TransformedSource;
152
153 // Internal pass type used for shader updates
154 enum class PassTypes : unsigned int
155 {
156 DEFAULT = 0,
157 POSITION_TEXTURE,
158 PROBE
159 };
160 PassTypes CurrentPass = PassTypes::DEFAULT;
161
162 // Window / level
163 double Window = 1.0;
164 double Level = 0.0;
165
166 // Blend mode
167 BlendModes BlendMode = BlendModes::NONE;
168 double BlendWidth = 1.0;
169
170 // Saved state
171 bool SavedScissorTestState = false;
172 bool SavedBlendState = false;
173 int SavedViewport[4] = {};
174};
175
176VTK_ABI_NAMESPACE_END
177#endif
represents an object (geometry & properties) in a rendered scene
Definition vtkActor.h:151
Proxy object to connect input/output ports.
topologically and geometrically regular array of data
Store vtkAlgorithm input/output information.
Allocate and hold a VTK object.
Definition vtkNew.h:167
Internal class which encapsulates OpenGL FramebufferObject.
OpenGL rendering window.
void SetBlendModeToMaximumIntensity()
Set/Get the blend mode.
void UpdateShaders(vtkOpenGLHelper &cellBO, vtkRenderer *ren, vtkActor *act) override
Make sure appropriate shaders are defined, compiled and bound.
vtkImageData * GetSource()
Specify the input data to be probed.
vtkPolyData * GetProbeInput()
Specify the input data used for probing (optional).
void SetSourceData(vtkImageData *in)
Specify the input data to be probed.
void SetSourceConnection(vtkAlgorithmOutput *algOutput)
Specify the input data to be probed.
virtual void UpdateShadersProbePass(vtkOpenGLHelper &cellBO, vtkRenderer *ren)
virtual void ReplaceShaderPositionPass(vtkActor *act)
void SetBlendModeToAverageIntensity()
Set/Get the blend mode.
vtkSetEnumMacro(BlendMode, BlendModes)
Set/Get the blend mode.
virtual void ReplaceShaderProbePass(vtkActor *act)
void SetProbeInputConnection(vtkAlgorithmOutput *algOutput)
Specify the input data used for probing (optional).
void RenderPiece(vtkRenderer *ren, vtkActor *act) override
Implemented by sub classes.
int FillInputPortInformation(int port, vtkInformation *info) override
void SetBlendModeToMinimumIntensity()
Set/Get the blend mode.
void SetProbeInputData(vtkPolyData *in)
Specify the input data used for probing (optional).
static vtkOpenGLSurfaceProbeVolumeMapper * New()
vtkGetEnumMacro(BlendMode, BlendModes)
Set/Get the blend mode.
concrete dataset represents vertices, lines, polygons, and triangle strips
abstract specification for renderers
In case DepthTextureCompare is true, specify the comparison function in use.
Creates and manages the volume texture rendered by vtkOpenGLGPUVolumeRayCastMapper.
void CreateTexture()
Creates a texture handle if not already created.