VTK  9.4.20250206
vtkCompositeDataDisplayAttributesLegacy.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
14#ifndef vtkCompositeDataDisplayAttributesLegacy_h
15#define vtkCompositeDataDisplayAttributesLegacy_h
16
17#include "vtkColor.h" // for vtkColor3d
18#include "vtkObject.h"
19#include "vtkRenderingCoreModule.h" // for export macro
20
21#include <map> // for std::map
22
23VTK_ABI_NAMESPACE_BEGIN
24class vtkBoundingBox;
25class vtkDataObject;
26
27class VTKRENDERINGCORE_EXPORT vtkCompositeDataDisplayAttributesLegacy : public vtkObject
28{
29public:
32 void PrintSelf(ostream& os, vtkIndent indent) override;
33
38
40
43 void SetBlockVisibility(unsigned int flat_index, bool visible);
44 bool GetBlockVisibility(unsigned int flat_index) const;
46
51 bool HasBlockVisibility(unsigned int flat_index) const;
52
56 void RemoveBlockVisibility(unsigned int flat_index);
57
63
68
70
73 void SetBlockPickability(unsigned int flat_index, bool visible);
74 bool GetBlockPickability(unsigned int flat_index) const;
76
81 bool HasBlockPickability(unsigned int flat_index) const;
82
86 void RemoveBlockPickability(unsigned int flat_index);
87
93
95
98 void SetBlockColor(unsigned int flat_index, const double color[3]);
99 void GetBlockColor(unsigned int flat_index, double color[3]) const;
100 vtkColor3d GetBlockColor(unsigned int flat_index) const;
102
106 bool HasBlockColors() const;
107
111 bool HasBlockColor(unsigned int flat_index) const;
112
116 void RemoveBlockColor(unsigned int flat_index);
117
122
124
127 void SetBlockOpacity(unsigned int flat_index, double opacity);
128 double GetBlockOpacity(unsigned int flat_index) const;
130
134 bool HasBlockOpacities() const;
135
139 bool HasBlockOpacity(unsigned int flat_index) const;
140
144 void RemoveBlockOpacity(unsigned int flat_index);
145
150
151 // If the input \a dobj is a vtkCompositeDataSet, we will loop over the
152 // hierarchy recursively starting from initial index 0 and use only visible
153 // blocks, which is specified in the vtkCompositeDataDisplayAttributesLegacy \a cda,
154 // to compute the \a bounds.
156 vtkCompositeDataDisplayAttributesLegacy* cda, vtkDataObject* dobj, double bounds[6]);
157
158protected:
161
162private:
164 void operator=(const vtkCompositeDataDisplayAttributesLegacy&) = delete;
165
175 static void ComputeVisibleBoundsInternal(vtkCompositeDataDisplayAttributesLegacy* cda,
176 vtkDataObject* dobj, unsigned int& flat_index, vtkBoundingBox* bbox, bool parentVisible = true);
177
178 std::map<unsigned int, bool> BlockVisibilities;
179 std::map<unsigned int, vtkColor3d> BlockColors;
180 std::map<unsigned int, double> BlockOpacities;
181 std::map<unsigned int, bool> BlockPickabilities;
182};
183
184VTK_ABI_NAMESPACE_END
185#endif // vtkCompositeDataDisplayAttributesLegacy_h
Fast, simple class for representing and operating on 3D bounds.
rendering attributes for a multi-block dataset.
bool HasBlockColor(unsigned int flat_index) const
Returns true if the block with the given flat_index has a color.
void RemoveBlockOpacity(unsigned int flat_index)
Removes the set opacity for the block with flat_index.
void RemoveBlockColors()
Removes all block colors.
bool GetBlockVisibility(unsigned int flat_index) const
Set/get the visibility for the block with flat_index.
void RemoveBlockOpacities()
Removes all block opacities.
double GetBlockOpacity(unsigned int flat_index) const
Set/get the opacity for the block with flat_index.
void RemoveBlockVisibility(unsigned int flat_index)
Removes the block visibility flag for the block with flat_index.
bool HasBlockPickability(unsigned int flat_index) const
Returns true if the block with the given flat_index has a visibility set.
void SetBlockOpacity(unsigned int flat_index, double opacity)
Set/get the opacity for the block with flat_index.
bool HasBlockVisibility(unsigned int flat_index) const
Returns true if the block with the given flat_index has a visibility set.
void SetBlockVisibility(unsigned int flat_index, bool visible)
Set/get the visibility for the block with flat_index.
bool HasBlockOpacities() const
Returns true if any block has an opacity set.
bool GetBlockPickability(unsigned int flat_index) const
Set/get the visibility for the block with flat_index.
static vtkCompositeDataDisplayAttributesLegacy * New()
bool HasBlockOpacity(unsigned int flat_index) const
Returns true if the block with flat_index has an opacity set.
void RemoveBlockPickabilities()
Removes all block visibility flags.
void SetBlockPickability(unsigned int flat_index, bool visible)
Set/get the visibility for the block with flat_index.
static void ComputeVisibleBounds(vtkCompositeDataDisplayAttributesLegacy *cda, vtkDataObject *dobj, double bounds[6])
void GetBlockColor(unsigned int flat_index, double color[3]) const
Set/get the color for the block with flat_index.
bool HasBlockColors() const
Returns true if any block has any block color is set.
void RemoveBlockVisibilities()
Removes all block visibility flags.
vtkColor3d GetBlockColor(unsigned int flat_index) const
Set/get the color for the block with flat_index.
void RemoveBlockPickability(unsigned int flat_index)
Removes the block visibility flag for the block with flat_index.
bool HasBlockPickabilities() const
Returns true if any block has any block visibility is set.
void SetBlockColor(unsigned int flat_index, const double color[3])
Set/get the color for the block with flat_index.
bool HasBlockVisibilities() const
Returns true if any block has any block visibility is set.
void PrintSelf(ostream &os, vtkIndent indent) override
Methods invoked by print to print information about the object including superclasses.
void RemoveBlockColor(unsigned int flat_index)
Removes the block color for the block with flat_index.
general representation of visualization data
a simple class to control print indentation
Definition vtkIndent.h:108
abstract base class for most VTK objects
Definition vtkObject.h:162