VTK
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 
48 
50 class vtkBoundingBox;
51 class vtkMatrix4x4;
52 class vtkRenderer;
53 class vtkVolumeProperty;
54 class vtkWindow;
55 class vtkVolumeProperty;
57 
58 class VTKRENDERINGVOLUME_EXPORT vtkMultiVolume : public vtkVolume
59 {
60 public:
61  static vtkMultiVolume* New();
62  vtkTypeMacro(vtkMultiVolume, vtkVolume);
63  void PrintSelf(ostream& os, vtkIndent indent) override;
64 
66 
69  void SetVolume(vtkVolume* volume, int port = 0);
70  vtkVolume* GetVolume(int port = 0);
71  void RemoveVolume(int port)
72  {
73  this->SetVolume(nullptr, port);
74  }
76 
78 
85  void SetProperty(vtkVolumeProperty* property) override;
86  vtkVolumeProperty* GetProperty() override;
88 
95  double* GetBounds() override;
96 
100  vtkMTimeType GetMTime() override;
101 
107  void ShallowCopy(vtkProp *prop) override;
108 
117  using vtkVolume::GetMatrix;
119  { return this->Matrix; }
120 
127  { return this->TexToBBox.GetPointer(); };
128 
132  double* GetDataBounds()
133  { return this->DataBounds.data(); };
134 
136  { return this->BoundsComputeTime.GetMTime(); };
137 
144  int RenderVolumetricGeometry(vtkViewport* vp) override;
145 
146 protected:
147  vtkMultiVolume();
148  ~vtkMultiVolume() override;
149 
156  void ComputeMatrix() override {};
157 
161  vtkVolume* FindVolume(int port);
162 
167  bool VolumesChanged();
168 
175  std::array<double, 6> ComputeAABounds(double bounds[6],
176  vtkMatrix4x4* T) const;
177 
178 
179  std::array<double, 6> DataBounds;
180  std::unordered_map<int, vtkVolume*> Volumes;
183 
184 private:
185  vtkMultiVolume(const vtkMultiVolume&) = delete;
186  void operator=(const vtkMultiVolume&) = delete;
187 };
188 #endif
abstract superclass for all actors, volumes and annotations
Definition: vtkProp.h:52
vtkMatrix4x4 * GetMatrix() override
Get a pointer to an internal vtkMatrix4x4.
vtkSmartPointer< vtkMatrix4x4 > TexToBBox
represents a volume (data & properties) in a rendered scene
Definition: vtkVolume.h:50
represent and manipulate 4x4 transformation matrices
Definition: vtkMatrix4x4.h:41
virtual void SetProperty(vtkVolumeProperty *property)
Set/Get the volume property.
vtkTypeUInt32 vtkMTimeType
Definition: vtkType.h:302
abstract specification for Viewports
Definition: vtkViewport.h:47
vtkMatrix4x4 * GetTextureMatrix()
Returns the transformation from texture coordinates to data cooridinates of the bounding-box.
record modification and/or execution time
Definition: vtkTimeStamp.h:35
vtkTimeStamp BoundsComputeTime
void RemoveVolume(int port)
Add / Remove a vtkVolume instance.
void ShallowCopy(vtkProp *prop) override
Shallow copy of this vtkVolume.
virtual vtkVolumeProperty * GetProperty()
Set/Get the volume property.
Abstract class for a volume mapper.
abstract specification for renderers
Definition: vtkRenderer.h:63
window superclass for vtkRenderWindow
Definition: vtkWindow.h:37
a simple class to control print indentation
Definition: vtkIndent.h:39
vtkMTimeType GetMTime() override
Return the MTime also considering the property etc.
static vtkVolume * New()
Creates a Volume with the following defaults: origin(0,0,0) position=(0,0,0) scale=1 visibility=1 pic...
std::array< double, 6 > DataBounds
represents the common properties for rendering a volume.
vtkMatrix4x4 * GetMatrix() override
Get a pointer to an internal vtkMatrix4x4.
Definition: vtkProp3D.h:333
Represents a world axis-aligned bounding-box containing a set of volumes in a rendered scene...
void ComputeMatrix() override
The transformation matrix of this vtkProp3D is not user-definable, (only the registered vtkVolume ins...
std::unordered_map< int, vtkVolume * > Volumes
vtkMTimeType GetBoundsTime()
int RenderVolumetricGeometry(vtkViewport *viewport) override
WARNING: INTERNAL METHOD - NOT INTENDED FOR GENERAL USE DO NOT USE THIS METHOD OUTSIDE OF THE RENDERI...
double * GetDataBounds()
Total bounds in data coordinates.
double * GetBounds() override
Get the bounds - either all six at once (xmin, xmax, ymin, ymax, zmin, zmax) or one at a time...
void PrintSelf(ostream &os, vtkIndent indent) override
Methods invoked by print to print information about the object including superclasses.
vtkMatrix4x4 * Matrix
Definition: vtkProp3D.h:353
Fast Simple Class for dealing with 3D bounds.