VTK  9.2.6
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 
73  void RemoveBlockVisibilities();
74 
78  bool HasBlockPickabilities() const;
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 
103  void RemoveBlockPickabilities();
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 
132  void RemoveBlockColors();
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 
160  void RemoveBlockOpacities();
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.
166  static void ComputeVisibleBounds(
167  vtkCompositeDataDisplayAttributesLegacy* cda, vtkDataObject* dobj, double bounds[6]);
168 
169 protected:
172 
173 private:
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
rendering attributes for a multi-block dataset.
abstract base class for most VTK objects
Definition: vtkObject.h:62
void PrintSelf(ostream &os, vtkIndent indent) override
Methods invoked by print to print information about the object including superclasses.
a simple class to control print indentation
Definition: vtkIndent.h:39
static vtkObject * New()
Create an object with Debug turned off, modified time initialized to zero, and reference counting on...
general representation of visualization data
Definition: vtkDataObject.h:65
Fast, simple class for representing and operating on 3D bounds.