VTK  9.1.0
vtkCompositeDataDisplayAttributesLegacy.h
Go to the documentation of this file.
1/*=========================================================================
2
3 Program: Visualization Toolkit
4 Module: vtkCompositeDataDisplayAttributesLegacy.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=========================================================================*/
26#ifndef vtkCompositeDataDisplayAttributesLegacy_h
27#define vtkCompositeDataDisplayAttributesLegacy_h
28
29#include "vtkColor.h" // for vtkColor3d
30#include "vtkObject.h"
31#include "vtkRenderingCoreModule.h" // for export macro
32
33#include <map> // for std::map
34
35class vtkBoundingBox;
36class vtkDataObject;
37
38class VTKRENDERINGCORE_EXPORT vtkCompositeDataDisplayAttributesLegacy : public vtkObject
39{
40public:
43 void PrintSelf(ostream& os, vtkIndent indent) override;
44
49
51
54 void SetBlockVisibility(unsigned int flat_index, bool visible);
55 bool GetBlockVisibility(unsigned int flat_index) const;
57
62 bool HasBlockVisibility(unsigned int flat_index) const;
63
67 void RemoveBlockVisibility(unsigned int flat_index);
68
74
79
81
84 void SetBlockPickability(unsigned int flat_index, bool visible);
85 bool GetBlockPickability(unsigned int flat_index) const;
87
92 bool HasBlockPickability(unsigned int flat_index) const;
93
97 void RemoveBlockPickability(unsigned int flat_index);
98
104
106
109 void SetBlockColor(unsigned int flat_index, const double color[3]);
110 void GetBlockColor(unsigned int flat_index, double color[3]) const;
111 vtkColor3d GetBlockColor(unsigned int flat_index) const;
113
117 bool HasBlockColors() const;
118
122 bool HasBlockColor(unsigned int flat_index) const;
123
127 void RemoveBlockColor(unsigned int flat_index);
128
133
135
138 void SetBlockOpacity(unsigned int flat_index, double opacity);
139 double GetBlockOpacity(unsigned int flat_index) const;
141
145 bool HasBlockOpacities() const;
146
150 bool HasBlockOpacity(unsigned int flat_index) const;
151
155 void RemoveBlockOpacity(unsigned int flat_index);
156
161
162 // If the input \a dobj is a vtkCompositeDataSet, we will loop over the
163 // hierarchy recursively starting from initial index 0 and use only visible
164 // blocks, which is specified in the vtkCompositeDataDisplayAttributesLegacy \a cda,
165 // to compute the \a bounds.
167 vtkCompositeDataDisplayAttributesLegacy* cda, vtkDataObject* dobj, double bounds[6]);
168
169protected:
172
173private:
175 void operator=(const vtkCompositeDataDisplayAttributesLegacy&) = delete;
176
186 static void ComputeVisibleBoundsInternal(vtkCompositeDataDisplayAttributesLegacy* cda,
187 vtkDataObject* dobj, unsigned int& flat_index, vtkBoundingBox* bbox, bool parentVisible = true);
188
189 std::map<unsigned int, bool> BlockVisibilities;
190 std::map<unsigned int, vtkColor3d> BlockColors;
191 std::map<unsigned int, double> BlockOpacities;
192 std::map<unsigned int, bool> BlockPickabilities;
193};
194
195#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:113
abstract base class for most VTK objects
Definition: vtkObject.h:73
@ color
Definition: vtkX3D.h:227