VTK
vtkCompositeDataDisplayAttributes.h
Go to the documentation of this file.
1 /*=========================================================================
2 
3  Program: Visualization Toolkit
4  Module: vtkCompositeDataDisplayAttributes.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 =========================================================================*/
24 #ifndef vtkCompositeDataDisplayAttributes_h
25 #define vtkCompositeDataDisplayAttributes_h
26 
27 #include "vtkRenderingCoreModule.h" // for export macro
28 #include "vtkObject.h"
29 #include "vtkColor.h" // for vtkColor3d
30 
31 #include <map> // for std::map
32 
33 class vtkBoundingBox;
34 class vtkDataObject;
35 
36 class VTKRENDERINGCORE_EXPORT vtkCompositeDataDisplayAttributes : public vtkObject
37 {
38 public:
41  void PrintSelf(ostream& os, vtkIndent indent) VTK_OVERRIDE;
42 
46  bool HasBlockVisibilities() const;
47 
49 
52  void SetBlockVisibility(unsigned int flat_index, bool visible);
53  bool GetBlockVisibility(unsigned int flat_index) const;
55 
60  bool HasBlockVisibility(unsigned int flat_index) const;
61 
65  void RemoveBlockVisibility(unsigned int flat_index);
66 
71  void RemoveBlockVisibilites();
72 
74 
77  void SetBlockColor(unsigned int flat_index, const double color[3]);
78  void GetBlockColor(unsigned int flat_index, double color[3]) const;
79  vtkColor3d GetBlockColor(unsigned int flat_index) const;
81 
85  bool HasBlockColors() const;
86 
90  bool HasBlockColor(unsigned int flat_index) const;
91 
95  void RemoveBlockColor(unsigned int flat_index);
96 
100  void RemoveBlockColors();
101 
103 
106  void SetBlockOpacity(unsigned int flat_index, double opacity);
107  double GetBlockOpacity(unsigned int flat_index) const;
109 
113  bool HasBlockOpacities() const;
114 
118  bool HasBlockOpacity(unsigned int flat_index) const;
119 
123  void RemoveBlockOpacity(unsigned int flat_index);
124 
128  void RemoveBlockOpacities();
129 
130  // If the input \a dobj is a vtkCompositeDataSet, we will loop over the
131  // hierarchy recursively starting from initial index 0 and use only visible
132  // blocks, which is specified in the vtkCompositeDataDisplayAttributes \a cda,
133  // to compute the \a bounds.
134  static void ComputeVisibleBounds(
136  vtkDataObject *dobj,
137  double bounds[6]);
138 
139 protected:
141  ~vtkCompositeDataDisplayAttributes() VTK_OVERRIDE;
142 
143 private:
144  vtkCompositeDataDisplayAttributes(const vtkCompositeDataDisplayAttributes&) VTK_DELETE_FUNCTION;
145  void operator=(const vtkCompositeDataDisplayAttributes&) VTK_DELETE_FUNCTION;
146 
156  static void ComputeVisibleBoundsInternal(
157  vtkCompositeDataDisplayAttributes* cda,
158  vtkDataObject *dobj,
159  unsigned int& flat_index,
160  vtkBoundingBox* bbox,
161  bool parentVisible = true);
162 
163  std::map<unsigned int, bool> BlockVisibilities;
164  std::map<unsigned int, vtkColor3d> BlockColors;
165  std::map<unsigned int, double> BlockOpacities;
166 
167 };
168 
169 #endif // vtkCompositeDataDisplayAttributes_h
abstract base class for most VTK objects
Definition: vtkObject.h:53
rendering attributes for a multi-block dataset.
a simple class to control print indentation
Definition: vtkIndent.h:33
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:58
Fast Simple Class for dealing with 3D bounds.