VTK  9.0.1
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 =========================================================================*/
35 #ifndef vtkMultiVolume_h
36 #define vtkMultiVolume_h
37 #include <array> // for std::array
38 #include <unordered_map> // For std::unordered_map
39 
40 #include "vtkMatrix4x4.h" // For Matrix
41 #include "vtkRenderingVolumeModule.h" // For export macro
42 #include "vtkSmartPointer.h" // For vtkSmartPointer
43 #include "vtkVolume.h"
44 
46 class vtkBoundingBox;
47 class vtkMatrix4x4;
48 class vtkRenderer;
49 class vtkVolumeProperty;
50 class vtkWindow;
51 class vtkVolumeProperty;
53 
54 class VTKRENDERINGVOLUME_EXPORT vtkMultiVolume : public vtkVolume
55 {
56 public:
57  static vtkMultiVolume* New();
58  vtkTypeMacro(vtkMultiVolume, vtkVolume);
59  void PrintSelf(ostream& os, vtkIndent indent) override;
60 
62 
65  void SetVolume(vtkVolume* volume, int port = 0);
67  void RemoveVolume(int port) { this->SetVolume(nullptr, port); }
69 
71 
78  void SetProperty(vtkVolumeProperty* property) override;
81 
88  double* GetBounds() override;
89 
93  vtkMTimeType GetMTime() override;
94 
100  void ShallowCopy(vtkProp* prop) override;
101 
110  using vtkVolume::GetMatrix;
111  vtkMatrix4x4* GetMatrix() override { return this->Matrix; }
112 
118  vtkMatrix4x4* GetTextureMatrix() { return this->TexToBBox.GetPointer(); }
119 
123  double* GetDataBounds() { return this->DataBounds.data(); }
124 
125  vtkMTimeType GetBoundsTime() { return this->BoundsComputeTime.GetMTime(); }
126 
134 
138  double* GetDataGeometry() { return this->DataGeometry.data(); }
139 
140 protected:
142  ~vtkMultiVolume() override;
143 
150  void ComputeMatrix() override {}
151 
156 
162 
169  std::array<double, 6> ComputeAABounds(double bounds[6], vtkMatrix4x4* T) const;
170 
171  std::array<double, 6> DataBounds;
172  std::array<double, 24> DataGeometry;
173  std::unordered_map<int, vtkVolume*> Volumes;
176 
177 private:
178  vtkMultiVolume(const vtkMultiVolume&) = delete;
179  void operator=(const vtkMultiVolume&) = delete;
180 };
181 #endif
vtkVolume.h
vtkMultiVolume::GetMatrix
vtkMatrix4x4 * GetMatrix() override
Get a pointer to an internal vtkMatrix4x4.
Definition: vtkMultiVolume.h:111
vtkMultiVolume::TexToBBox
vtkSmartPointer< vtkMatrix4x4 > TexToBBox
Definition: vtkMultiVolume.h:175
vtkMultiVolume::SetVolume
void SetVolume(vtkVolume *volume, int port=0)
Add / Remove a vtkVolume instance.
vtkMultiVolume::GetBoundsTime
vtkMTimeType GetBoundsTime()
Definition: vtkMultiVolume.h:125
vtkVolume
represents a volume (data & properties) in a rendered scene
Definition: vtkVolume.h:45
vtkMultiVolume::RenderVolumetricGeometry
int RenderVolumetricGeometry(vtkViewport *vp) override
Since vtkMultiVolume acts like a proxy volume to compute the bounding box for its internal vtkVolume ...
vtkProp3D::GetMatrix
vtkMatrix4x4 * GetMatrix() override
Get a pointer to an internal vtkMatrix4x4.
Definition: vtkProp3D.h:317
vtkMultiVolume::ShallowCopy
void ShallowCopy(vtkProp *prop) override
Checks whether the vtkProp passed is another vtkMultiVolume and tries to copy accordingly.
vtkTimeStamp
record modification and/or execution time
Definition: vtkTimeStamp.h:33
vtkMultiVolume::PrintSelf
void PrintSelf(ostream &os, vtkIndent indent) override
Methods invoked by print to print information about the object including superclasses.
vtkMultiVolume
Represents a world axis-aligned bounding-box containing a set of volumes in a rendered scene.
Definition: vtkMultiVolume.h:55
vtkSmartPointer< vtkMatrix4x4 >
vtkMultiVolume::New
static vtkMultiVolume * New()
vtkMultiVolume::RemoveVolume
void RemoveVolume(int port)
Definition: vtkMultiVolume.h:67
vtkMultiVolume::~vtkMultiVolume
~vtkMultiVolume() override
vtkMultiVolume::BoundsComputeTime
vtkTimeStamp BoundsComputeTime
Definition: vtkMultiVolume.h:174
vtkWindow
window superclass for vtkRenderWindow
Definition: vtkWindow.h:35
vtkBoundingBox
Fast, simple class for dealing with 3D bounds.
Definition: vtkBoundingBox.h:35
vtkMultiVolume::DataGeometry
std::array< double, 24 > DataGeometry
Definition: vtkMultiVolume.h:172
vtkX3D::port
@ port
Definition: vtkX3D.h:453
vtkMultiVolume::GetProperty
vtkVolumeProperty * GetProperty() override
vtkMultiVolume::ComputeAABounds
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...
vtkMultiVolume::FindVolume
vtkVolume * FindVolume(int port)
Returns the vtkVolume registered in port.
vtkMultiVolume::GetVolume
vtkVolume * GetVolume(int port=0)
vtkMatrix4x4.h
vtkMultiVolume::Volumes
std::unordered_map< int, vtkVolume * > Volumes
Definition: vtkMultiVolume.h:173
vtkIndent
a simple class to control print indentation
Definition: vtkIndent.h:34
vtkMatrix4x4
represent and manipulate 4x4 transformation matrices
Definition: vtkMatrix4x4.h:36
vtkMultiVolume::GetDataBounds
double * GetDataBounds()
Total bounds in data coordinates.
Definition: vtkMultiVolume.h:123
vtkSmartPointer.h
vtkMultiVolume::GetBounds
double * GetBounds() override
Computes the bounds of the box containing all of the vtkVolume instances.
vtkMultiVolume::vtkMultiVolume
vtkMultiVolume()
vtkViewport
abstract specification for Viewports
Definition: vtkViewport.h:45
vtkMultiVolume::SetProperty
void SetProperty(vtkVolumeProperty *property) override
Given that this class represents a bounding-box only there is no property directly associated with it...
vtkProp
abstract superclass for all actors, volumes and annotations
Definition: vtkProp.h:48
vtkAbstractVolumeMapper
Abstract class for a volume mapper.
Definition: vtkAbstractVolumeMapper.h:39
vtkRenderer
abstract specification for renderers
Definition: vtkRenderer.h:59
vtkProp3D::Matrix
vtkMatrix4x4 * Matrix
Definition: vtkProp3D.h:337
vtkMultiVolume::GetMTime
vtkMTimeType GetMTime() override
vtkMultiVolume::GetTextureMatrix
vtkMatrix4x4 * GetTextureMatrix()
Returns the transformation from texture coordinates to data cooridinates of the bounding-box.
Definition: vtkMultiVolume.h:118
vtkMultiVolume::DataBounds
std::array< double, 6 > DataBounds
Definition: vtkMultiVolume.h:171
vtkMultiVolume::VolumesChanged
bool VolumesChanged()
Checks for changes in the registered vtkVolume instances which could required the bounding-box to be ...
vtkMultiVolume::ComputeMatrix
void ComputeMatrix() override
The transformation matrix of this vtkProp3D is not user-definable, (only the registered vtkVolume ins...
Definition: vtkMultiVolume.h:150
vtkVolumeProperty
represents the common properties for rendering a volume.
Definition: vtkVolumeProperty.h:75
vtkMultiVolume::GetDataGeometry
double * GetDataGeometry()
Return the eight corners of the volume.
Definition: vtkMultiVolume.h:138
vtkMTimeType
vtkTypeUInt32 vtkMTimeType
Definition: vtkType.h:293