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 =========================================================================*/
29 #ifndef vtkCompositeDataDisplayAttributesLegacy_h
30 #define vtkCompositeDataDisplayAttributesLegacy_h
31 
32 #include "vtkColor.h" // for vtkColor3d
33 #include "vtkObject.h"
34 #include "vtkRenderingCoreModule.h" // for export macro
35 
36 #include <map> // for std::map
37 
38 class vtkBoundingBox;
39 class vtkDataObject;
40 
41 class VTKRENDERINGCORE_EXPORT vtkCompositeDataDisplayAttributesLegacy : public vtkObject
42 {
43 public:
46  void PrintSelf(ostream& os, vtkIndent indent) override;
47 
51  bool HasBlockVisibilities() const;
52 
54 
57  void SetBlockVisibility(unsigned int flat_index, bool visible);
58  bool GetBlockVisibility(unsigned int flat_index) const;
60 
65  bool HasBlockVisibility(unsigned int flat_index) const;
66 
70  void RemoveBlockVisibility(unsigned int flat_index);
71 
76  void RemoveBlockVisibilities();
77  // This method is deprecated and will be removed in VTK 8.2. It is misspelled.
78  VTK_LEGACY(void RemoveBlockVisibilites());
79 
83  bool HasBlockPickabilities() const;
84 
86 
89  void SetBlockPickability(unsigned int flat_index, bool visible);
90  bool GetBlockPickability(unsigned int flat_index) const;
92 
97  bool HasBlockPickability(unsigned int flat_index) const;
98 
102  void RemoveBlockPickability(unsigned int flat_index);
103 
108  void RemoveBlockPickabilities();
109 
111 
114  void SetBlockColor(unsigned int flat_index, const double color[3]);
115  void GetBlockColor(unsigned int flat_index, double color[3]) const;
116  vtkColor3d GetBlockColor(unsigned int flat_index) const;
118 
122  bool HasBlockColors() const;
123 
127  bool HasBlockColor(unsigned int flat_index) const;
128 
132  void RemoveBlockColor(unsigned int flat_index);
133 
137  void RemoveBlockColors();
138 
140 
143  void SetBlockOpacity(unsigned int flat_index, double opacity);
144  double GetBlockOpacity(unsigned int flat_index) const;
146 
150  bool HasBlockOpacities() const;
151 
155  bool HasBlockOpacity(unsigned int flat_index) const;
156 
160  void RemoveBlockOpacity(unsigned int flat_index);
161 
165  void RemoveBlockOpacities();
166 
167  // If the input \a dobj is a vtkCompositeDataSet, we will loop over the
168  // hierarchy recursively starting from initial index 0 and use only visible
169  // blocks, which is specified in the vtkCompositeDataDisplayAttributesLegacy \a cda,
170  // to compute the \a bounds.
171  static void ComputeVisibleBounds(
173  vtkDataObject *dobj,
174  double bounds[6]);
175 
176 protected:
179 
180 private:
182  void operator=(const vtkCompositeDataDisplayAttributesLegacy&) = delete;
183 
193  static void ComputeVisibleBoundsInternal(
195  vtkDataObject *dobj,
196  unsigned int& flat_index,
197  vtkBoundingBox* bbox,
198  bool parentVisible = true);
199 
200  std::map<unsigned int, bool> BlockVisibilities;
201  std::map<unsigned int, vtkColor3d> BlockColors;
202  std::map<unsigned int, double> BlockOpacities;
203  std::map<unsigned int, bool> BlockPickabilities;
204 
205 };
206 
207 #endif // vtkCompositeDataDisplayAttributesLegacy_h
rendering attributes for a multi-block dataset.
abstract base class for most VTK objects
Definition: vtkObject.h:59
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:64
Fast Simple Class for dealing with 3D bounds.