VTK  9.0.3
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 
35 class vtkBoundingBox;
36 class vtkDataObject;
37 
38 class VTKRENDERINGCORE_EXPORT vtkCompositeDataDisplayAttributesLegacy : public vtkObject
39 {
40 public:
43  void PrintSelf(ostream& os, vtkIndent indent) override;
44 
48  bool HasBlockVisibilities() const;
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  // This method is deprecated and will be removed in VTK 8.2. It is misspelled.
75  VTK_LEGACY(void RemoveBlockVisibilites());
76 
80  bool HasBlockPickabilities() const;
81 
83 
86  void SetBlockPickability(unsigned int flat_index, bool visible);
87  bool GetBlockPickability(unsigned int flat_index) const;
89 
94  bool HasBlockPickability(unsigned int flat_index) const;
95 
99  void RemoveBlockPickability(unsigned int flat_index);
100 
106 
108 
111  void SetBlockColor(unsigned int flat_index, const double color[3]);
112  void GetBlockColor(unsigned int flat_index, double color[3]) const;
113  vtkColor3d GetBlockColor(unsigned int flat_index) const;
115 
119  bool HasBlockColors() const;
120 
124  bool HasBlockColor(unsigned int flat_index) const;
125 
129  void RemoveBlockColor(unsigned int flat_index);
130 
135 
137 
140  void SetBlockOpacity(unsigned int flat_index, double opacity);
141  double GetBlockOpacity(unsigned int flat_index) const;
143 
147  bool HasBlockOpacities() const;
148 
152  bool HasBlockOpacity(unsigned int flat_index) const;
153 
157  void RemoveBlockOpacity(unsigned int flat_index);
158 
163 
164  // If the input \a dobj is a vtkCompositeDataSet, we will loop over the
165  // hierarchy recursively starting from initial index 0 and use only visible
166  // blocks, which is specified in the vtkCompositeDataDisplayAttributesLegacy \a cda,
167  // to compute the \a bounds.
168  static void ComputeVisibleBounds(
169  vtkCompositeDataDisplayAttributesLegacy* cda, vtkDataObject* dobj, double bounds[6]);
170 
171 protected:
174 
175 private:
177  void operator=(const vtkCompositeDataDisplayAttributesLegacy&) = delete;
178 
188  static void ComputeVisibleBoundsInternal(vtkCompositeDataDisplayAttributesLegacy* cda,
189  vtkDataObject* dobj, unsigned int& flat_index, vtkBoundingBox* bbox, bool parentVisible = true);
190 
191  std::map<unsigned int, bool> BlockVisibilities;
192  std::map<unsigned int, vtkColor3d> BlockColors;
193  std::map<unsigned int, double> BlockOpacities;
194  std::map<unsigned int, bool> BlockPickabilities;
195 };
196 
197 #endif // vtkCompositeDataDisplayAttributesLegacy_h
Fast, simple class for dealing with 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
void RemoveBlockOpacities()
Removes all block opacities.
double GetBlockOpacity(unsigned int flat_index) const
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.
static vtkCompositeDataDisplayAttributesLegacy * New()
bool HasBlockOpacities() const
Returns true if any block has an opacity set.
bool GetBlockPickability(unsigned int flat_index) const
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
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
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
Definition: vtkDataObject.h:60
a simple class to control print indentation
Definition: vtkIndent.h:34
abstract base class for most VTK objects
Definition: vtkObject.h:54
@ color
Definition: vtkX3D.h:227