VTK  9.2.5
vtkMultiVolume.h
Go to the documentation of this file.
1 /*=========================================================================
2 
3  Program: Visualization Toolkit
4  Module: vtkMultiVolume.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 =========================================================================*/
38 #ifndef vtkMultiVolume_h
39 #define vtkMultiVolume_h
40 #include <array> // for std::array
41 #include <unordered_map> // For std::unordered_map
42 
43 #include "vtkMatrix4x4.h" // For Matrix
44 #include "vtkRenderingVolumeModule.h" // For export macro
45 #include "vtkSmartPointer.h" // For vtkSmartPointer
46 #include "vtkVolume.h"
47 
49 class vtkBoundingBox;
50 class vtkMatrix4x4;
51 class vtkRenderer;
52 class vtkVolumeProperty;
53 class vtkWindow;
54 class vtkVolumeProperty;
56 
57 class VTKRENDERINGVOLUME_EXPORT vtkMultiVolume : public vtkVolume
58 {
59 public:
60  static vtkMultiVolume* New();
61  vtkTypeMacro(vtkMultiVolume, vtkVolume);
62  void PrintSelf(ostream& os, vtkIndent indent) override;
63 
65 
68  void SetVolume(vtkVolume* volume, int port = 0);
70  void RemoveVolume(int port) { this->SetVolume(nullptr, port); }
72 
74 
81  void SetProperty(vtkVolumeProperty* property) override;
84 
91  double* GetBounds() override;
92 
96  vtkMTimeType GetMTime() override;
97 
103  void ShallowCopy(vtkProp* prop) override;
104 
113  using vtkVolume::GetMatrix;
114  vtkMatrix4x4* GetMatrix() override { return this->Matrix; }
115 
121  vtkMatrix4x4* GetTextureMatrix() { return this->TexToBBox.GetPointer(); }
122 
126  double* GetDataBounds() { return this->DataBounds.data(); }
127 
128  vtkMTimeType GetBoundsTime() { return this->BoundsComputeTime.GetMTime(); }
129 
137 
141  double* GetDataGeometry() { return this->DataGeometry.data(); }
142 
143 protected:
145  ~vtkMultiVolume() override;
146 
153  void ComputeMatrix() override {}
154 
159 
165 
172  std::array<double, 6> ComputeAABounds(double bounds[6], vtkMatrix4x4* T) const;
173 
174  std::array<double, 6> DataBounds;
175  std::array<double, 24> DataGeometry;
176  std::unordered_map<int, vtkVolume*> Volumes;
179 
180 private:
181  vtkMultiVolume(const vtkMultiVolume&) = delete;
182  void operator=(const vtkMultiVolume&) = delete;
183 };
184 #endif
Abstract class for a volume mapper.
Fast, simple class for representing and operating on 3D bounds.
a simple class to control print indentation
Definition: vtkIndent.h:119
represent and manipulate 4x4 transformation matrices
Definition: vtkMatrix4x4.h:151
Represents a world axis-aligned bounding-box containing a set of volumes in a rendered scene.
vtkSmartPointer< vtkMatrix4x4 > TexToBBox
int RenderVolumetricGeometry(vtkViewport *vp) override
Since vtkMultiVolume acts like a proxy volume to compute the bounding box for its internal vtkVolume ...
vtkMTimeType GetBoundsTime()
double * GetBounds() override
Computes the bounds of the box containing all of the vtkVolume instances.
void ComputeMatrix() override
The transformation matrix of this vtkProp3D is not user-definable, (only the registered vtkVolume ins...
vtkMTimeType GetMTime() override
std::unordered_map< int, vtkVolume * > Volumes
void RemoveVolume(int port)
Add / Remove a vtkVolume instance.
std::array< double, 6 > DataBounds
vtkVolume * FindVolume(int port)
Returns the vtkVolume registered in port.
static vtkMultiVolume * New()
vtkTimeStamp BoundsComputeTime
std::array< double, 24 > DataGeometry
vtkVolumeProperty * GetProperty() override
Given that this class represents a bounding-box only there is no property directly associated with it...
double * GetDataGeometry()
Return the eight corners of the volume.
std::array< double, 6 > ComputeAABounds(double bounds[6], vtkMatrix4x4 *T) const
For a box defined by bounds in coordinate system X, compute its axis-aligned bounds in coordinate sys...
vtkVolume * GetVolume(int port=0)
Add / Remove a vtkVolume instance.
bool VolumesChanged()
Checks for changes in the registered vtkVolume instances which could required the bounding-box to be ...
~vtkMultiVolume() override
void PrintSelf(ostream &os, vtkIndent indent) override
Methods invoked by print to print information about the object including superclasses.
double * GetDataBounds()
Total bounds in data coordinates.
void SetProperty(vtkVolumeProperty *property) override
Given that this class represents a bounding-box only there is no property directly associated with it...
void SetVolume(vtkVolume *volume, int port=0)
Add / Remove a vtkVolume instance.
vtkMatrix4x4 * GetTextureMatrix()
Returns the transformation from texture coordinates to data cooridinates of the bounding-box.
void ShallowCopy(vtkProp *prop) override
Checks whether the vtkProp passed is another vtkMultiVolume and tries to copy accordingly.
vtkMatrix4x4 * GetMatrix() override
Get a pointer to an internal vtkMatrix4x4.
vtkMatrix4x4 * Matrix
Definition: vtkProp3D.h:449
vtkMatrix4x4 * GetMatrix() override
Get a pointer to an internal vtkMatrix4x4.
Definition: vtkProp3D.h:388
abstract superclass for all actors, volumes and annotations
Definition: vtkProp.h:76
abstract specification for renderers
Definition: vtkRenderer.h:182
record modification and/or execution time
Definition: vtkTimeStamp.h:55
abstract specification for Viewports
Definition: vtkViewport.h:56
represents the common properties for rendering a volume.
represents a volume (data & properties) in a rendered scene
Definition: vtkVolume.h:140
window superclass for vtkRenderWindow
Definition: vtkWindow.h:39
@ port
Definition: vtkX3D.h:453
vtkTypeUInt32 vtkMTimeType
Definition: vtkType.h:287