VTK
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  // 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 
105  void RemoveBlockPickabilities();
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 
134  void RemoveBlockColors();
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 
162  void RemoveBlockOpacities();
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(
170  vtkDataObject *dobj,
171  double bounds[6]);
172 
173 protected:
175  ~vtkCompositeDataDisplayAttributesLegacy() override;
176 
177 private:
178  vtkCompositeDataDisplayAttributesLegacy(const vtkCompositeDataDisplayAttributesLegacy&) = delete;
179  void operator=(const vtkCompositeDataDisplayAttributesLegacy&) = delete;
180 
190  static void ComputeVisibleBoundsInternal(
191  vtkCompositeDataDisplayAttributesLegacy* cda,
192  vtkDataObject *dobj,
193  unsigned int& flat_index,
194  vtkBoundingBox* bbox,
195  bool parentVisible = true);
196 
197  std::map<unsigned int, bool> BlockVisibilities;
198  std::map<unsigned int, vtkColor3d> BlockColors;
199  std::map<unsigned int, double> BlockOpacities;
200  std::map<unsigned int, bool> BlockPickabilities;
201 
202 };
203 
204 #endif // vtkCompositeDataDisplayAttributesLegacy_h
rendering attributes for a multi-block dataset.
abstract base class for most VTK objects
Definition: vtkObject.h:59
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:64
Fast Simple Class for dealing with 3D bounds.