VTK  9.5.20250621
vtkMultiVolume.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
26#ifndef vtkMultiVolume_h
27#define vtkMultiVolume_h
28#include <array> // for std::array
29#include <unordered_map> // For std::unordered_map
30
31#include "vtkMatrix4x4.h" // For Matrix
32#include "vtkRenderingVolumeModule.h" // For export macro
33#include "vtkSmartPointer.h" // For vtkSmartPointer
34#include "vtkVolume.h"
35#include "vtkWrappingHints.h" // For VTK_MARSHALMANUAL
36
37VTK_ABI_NAMESPACE_BEGIN
39class vtkBoundingBox;
40class vtkMatrix4x4;
41class vtkRenderer;
43class vtkWindow;
46
47class VTKRENDERINGVOLUME_EXPORT VTK_MARSHALMANUAL vtkMultiVolume : public vtkVolume
48{
49public:
51 vtkTypeMacro(vtkMultiVolume, vtkVolume);
52 void PrintSelf(ostream& os, vtkIndent indent) override;
53
55
58 void SetVolume(vtkVolume* volume, int port = 0);
59 vtkVolume* GetVolume(int port = 0);
60 void RemoveVolume(int port) { this->SetVolume(nullptr, port); }
62
64
71 void SetProperty(vtkVolumeProperty* property) override;
74
75 std::unordered_map<int, vtkVolume*>& GetAllVolumes() { return this->Volumes; }
76 void SetAllVolumes(std::unordered_map<int, vtkVolume*>& volumes);
77
84 double* GetBounds() override;
85
90
96 void ShallowCopy(vtkProp* prop) override;
97
107 vtkMatrix4x4* GetMatrix() override { return this->Matrix; }
108
114 vtkMatrix4x4* GetTextureMatrix() { return this->TexToBBox.GetPointer(); }
115
119 double* GetDataBounds() { return this->DataBounds.data(); }
120
121 vtkMTimeType GetBoundsTime() { return this->BoundsComputeTime.GetMTime(); }
122
130
134 double* GetDataGeometry() { return this->DataGeometry.data(); }
135
136protected:
138 ~vtkMultiVolume() override;
139
146 void ComputeMatrix() override {}
147
152
158
165 std::array<double, 6> ComputeAABounds(double bounds[6], vtkMatrix4x4* T) const;
166
167 std::array<double, 6> DataBounds;
168 std::array<double, 24> DataGeometry;
169 std::unordered_map<int, vtkVolume*> Volumes;
172
173private:
174 vtkMultiVolume(const vtkMultiVolume&) = delete;
175 void operator=(const vtkMultiVolume&) = delete;
176};
177VTK_ABI_NAMESPACE_END
178#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:108
represent and manipulate 4x4 transformation matrices
Represents a world axis-aligned bounding-box containing a set of volumes in a rendered scene.
static vtkMultiVolume * New()
double * GetDataGeometry()
Return the eight corners of the volume.
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()
void ComputeMatrix() override
The transformation matrix of this vtkProp3D is not user-definable, (only the registered vtkVolume ins...
vtkVolumeProperty * GetProperty() override
Given that this class represents a bounding-box only there is no property directly associated with it...
vtkMTimeType GetMTime() override
std::unordered_map< int, vtkVolume * > Volumes
void RemoveVolume(int port)
Add / Remove a vtkVolume instance.
vtkVolume * GetVolume(int port=0)
Add / Remove a vtkVolume instance.
void SetAllVolumes(std::unordered_map< int, vtkVolume * > &volumes)
std::array< double, 6 > DataBounds
vtkTimeStamp BoundsComputeTime
std::array< double, 24 > DataGeometry
double * GetBounds() override
Computes the bounds of the box containing all of the vtkVolume instances.
vtkMatrix4x4 * GetMatrix() override
bool VolumesChanged()
Checks for changes in the registered vtkVolume instances which could required the bounding-box to be ...
~vtkMultiVolume() override
vtkMatrix4x4 * GetTextureMatrix()
Returns the transformation from texture coordinates to data coordinates of the bounding-box.
void PrintSelf(ostream &os, vtkIndent indent) override
Methods invoked by print to print information about the object including superclasses.
vtkVolume * FindVolume(int port)
Returns the vtkVolume registered in port.
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...
void SetProperty(vtkVolumeProperty *property) override
Given that this class represents a bounding-box only there is no property directly associated with it...
double * GetDataBounds()
Total bounds in data coordinates.
std::unordered_map< int, vtkVolume * > & GetAllVolumes()
void SetVolume(vtkVolume *volume, int port=0)
Add / Remove a vtkVolume instance.
void ShallowCopy(vtkProp *prop) override
Checks whether the vtkProp passed is another vtkMultiVolume and tries to copy accordingly.
vtkMatrix4x4 * Matrix
Definition vtkProp3D.h:441
abstract superclass for all actors, volumes and annotations
Definition vtkProp.h:66
virtual vtkMatrix4x4 * GetMatrix()
Definition vtkProp.h:175
abstract specification for renderers
Hold a reference to a vtkObjectBase instance.
record modification and/or execution time
abstract specification for Viewports
Definition vtkViewport.h:66
represents the common properties for rendering a volume.
represents a volume (data & properties) in a rendered scene
Definition vtkVolume.h:130
window superclass for vtkRenderWindow
Definition vtkWindow.h:48
vtkTypeUInt32 vtkMTimeType
Definition vtkType.h:287
#define VTK_MARSHALMANUAL