VTK  9.3.1
vtkMultiBlockVolumeMapper.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
23 #ifndef vtkMultiBlockVolumeMapper_h
24 #define vtkMultiBlockVolumeMapper_h
25 
26 #include <vector> // For DataBlocks
27 
28 #include "vtkNew.h" // for ivar
29 #include "vtkRenderingVolumeOpenGL2Module.h" // For export macro
30 #include "vtkVolumeMapper.h"
31 
32 VTK_ABI_NAMESPACE_BEGIN
33 class vtkDataObjectTree;
34 class vtkDataSet;
35 class vtkImageData;
36 class vtkMatrix4x4;
38 class vtkRenderWindow;
40 
41 class VTKRENDERINGVOLUMEOPENGL2_EXPORT vtkMultiBlockVolumeMapper : public vtkVolumeMapper
42 {
43 public:
46  void PrintSelf(ostream& os, vtkIndent indent) override;
47 
49 
53  double* GetBounds() override;
55 
56  void SelectScalarArray(int arrayNum) override;
57  void SelectScalarArray(char const* arrayName) override;
58  void SetScalarMode(int ScalarMode) override;
59  void SetArrayAccessMode(int accessMode) override;
60 
67  void Render(vtkRenderer* ren, vtkVolume* vol) override;
68 
73  void ReleaseGraphicsResources(vtkWindow* window) override;
75 
77 
80  void SetVectorMode(int mode);
81  vtkGetMacro(VectorMode, int);
82  void SetVectorComponent(int component);
83  vtkGetMacro(VectorComponent, int);
85 
87 
91  void SetBlendMode(int mode) override;
93 
95 
99  void SetComputeNormalFromOpacity(bool val) override;
101 
103 
106  void SetGlobalIlluminationReach(float val);
107  vtkGetMacro(GlobalIlluminationReach, float);
109 
111 
114  void SetVolumetricScatteringBlending(float val);
115  vtkGetMacro(VolumetricScatteringBlending, float);
117 
119 
123  void SetCropping(vtkTypeBool mode) override;
124 
129  double arg1, double arg2, double arg3, double arg4, double arg5, double arg6) override;
130  void SetCroppingRegionPlanes(const double* planes) override;
131 
135  void SetCroppingRegionFlags(int mode) override;
137 
139 
143  void SetRequestedRenderMode(int);
145 
147 
150  void SetTransfer2DYAxisArray(const char* a);
152 
153 protected:
155  ~vtkMultiBlockVolumeMapper() override;
156 
164  int FillInputPortInformation(int port, vtkInformation* info) override;
165 
168 
170 
171 private:
177  void LoadDataSet(vtkRenderer* ren, vtkVolume* vol);
178 
187  void CreateMappers(vtkDataObjectTree* input, vtkRenderer* ren, vtkVolume* vol);
188 
189  vtkDataObjectTree* GetDataObjectTreeInput();
190 
194  void ComputeBounds();
195 
199  void SortMappers(vtkRenderer* ren, vtkMatrix4x4* volumeMat);
200 
201  void ClearMappers();
202 
206  vtkSmartVolumeMapper* CreateMapper();
207 
209  void operator=(const vtkMultiBlockVolumeMapper&) = delete;
210 
212 
213  typedef std::vector<vtkSmartVolumeMapper*> MapperVec;
214  MapperVec Mappers;
215  vtkSmartVolumeMapper* FallBackMapper;
216 
217  vtkMTimeType BlockLoadingTime;
218  vtkMTimeType BoundsComputeTime;
219 
220  int VectorMode;
221  int VectorComponent;
222  int RequestedRenderMode;
223 
227  float GlobalIlluminationReach = 0.0;
228 
232  float VolumetricScatteringBlending = 0.0;
233 
234  char* Transfer2DYAxisArray;
235 };
236 VTK_ABI_NAMESPACE_END
237 #endif
represents a volume (data & properties) in a rendered scene
Definition: vtkVolume.h:39
Abstract class for a volume mapper.
represent and manipulate 4x4 transformation matrices
Definition: vtkMatrix4x4.h:30
provides implementation for most abstract methods in the superclass vtkCompositeDataSet ...
Store vtkAlgorithm input/output information.
Adaptive volume mapper.
vtkTypeUInt32 vtkMTimeType
Definition: vtkType.h:270
virtual void SetCroppingRegionFlags(int)
Set the flags for the cropping regions.
abstract class to specify dataset behavior
Definition: vtkDataSet.h:52
virtual void SetBlendMode(int)
Set/Get the blend mode.
abstract specification for renderers
Definition: vtkRenderer.h:61
virtual void SetScalarMode(int)
Control how the mapper works with scalar point data and cell attribute data.
Mapper to render volumes defined as vtkMultiBlockDataSet.
void Render(vtkRenderer *ren, vtkVolume *vol) override=0
WARNING: INTERNAL METHOD - NOT INTENDED FOR GENERAL USE DO NOT USE THIS METHOD OUTSIDE OF THE RENDERI...
virtual void SetArrayAccessMode(int)
Control how the mapper works with scalar point data and cell attribute data.
int vtkTypeBool
Definition: vtkABI.h:64
window superclass for vtkRenderWindow
Definition: vtkWindow.h:27
virtual void SetCroppingRegionPlanes(double, double, double, double, double, double)
Set/Get the Cropping Region Planes ( xmin, xmax, ymin, ymax, zmin, zmax ) These planes are defined in...
virtual void SetCropping(vtkTypeBool)
Turn On/Off orthogonal cropping.
a simple class to control print indentation
Definition: vtkIndent.h:28
int FillInputPortInformation(int, vtkInformation *) override
Fill the input port information objects for this algorithm.
topologically and geometrically regular array of data
Definition: vtkImageData.h:42
double * GetBounds() override
Return bounding box (array of six doubles) of data expressed as (xmin,xmax, ymin,ymax, zmin,zmax).
void ReleaseGraphicsResources(vtkWindow *) override
WARNING: INTERNAL METHOD - NOT INTENDED FOR GENERAL USE Release any graphics resources that are being...
create a window for renderers to draw into
Composite dataset that organizes datasets into blocks.
vtkNew< vtkMatrix4x4 > TempMatrix4x4
static vtkAlgorithm * New()
virtual void SelectScalarArray(int arrayNum)
When ScalarMode is set to UsePointFieldData or UseCellFieldData, you can specify which scalar array t...
void PrintSelf(ostream &os, vtkIndent indent) override
Methods invoked by print to print information about the object including superclasses.
virtual void SetComputeNormalFromOpacity(bool)
If enabled, the volume(s) whose shading is enabled will use the gradient of opacity instead of the sc...