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 =========================================================================*/
27 #ifndef vtkCompositeDataDisplayAttributes_h
28 #define vtkCompositeDataDisplayAttributes_h
29 
30 #include "vtkRenderingCoreModule.h" // for export macro
31 #include "vtkObject.h"
32 #include "vtkColor.h" // for vtkColor3d
33 
34 #include <map> // for std::map
35 
36 class vtkBoundingBox;
37 class vtkDataObject;
38 
39 class VTKRENDERINGCORE_EXPORT vtkCompositeDataDisplayAttributes : public vtkObject
40 {
41 public:
44  void PrintSelf(ostream& os, vtkIndent indent);
45 
49  bool HasBlockVisibilities() const;
50 
52 
55  void SetBlockVisibility(unsigned int flat_index, bool visible);
56  bool GetBlockVisibility(unsigned int flat_index) const;
58 
63  bool HasBlockVisibility(unsigned int flat_index) const;
64 
68  void RemoveBlockVisibility(unsigned int flat_index);
69 
74  void RemoveBlockVisibilites();
75 
77 
80  void SetBlockColor(unsigned int flat_index, const double color[3]);
81  void GetBlockColor(unsigned int flat_index, double color[3]) const;
82  vtkColor3d GetBlockColor(unsigned int flat_index) const;
84 
88  bool HasBlockColors() const;
89 
93  bool HasBlockColor(unsigned int flat_index) const;
94 
98  void RemoveBlockColor(unsigned int flat_index);
99 
103  void RemoveBlockColors();
104 
106 
109  void SetBlockOpacity(unsigned int flat_index, double opacity);
110  double GetBlockOpacity(unsigned int flat_index) const;
112 
116  bool HasBlockOpacities() const;
117 
121  bool HasBlockOpacity(unsigned int flat_index) const;
122 
126  void RemoveBlockOpacity(unsigned int flat_index);
127 
131  void RemoveBlockOpacities();
132 
133  // If the input \a dobj is a vtkCompositeDataSet, we will loop over the
134  // hierarchy recursively starting from intial index 0 and use only visible
135  // blocks, which is specified in the vtkCompositeDataDisplayAttributes \a cda,
136  // to compute the \a bounds.
137  static void ComputeVisibleBounds(
139  vtkDataObject *dobj,
140  double bounds[6]);
141 
142 protected:
144  ~vtkCompositeDataDisplayAttributes();
145 
146 private:
147  vtkCompositeDataDisplayAttributes(const vtkCompositeDataDisplayAttributes&) VTK_DELETE_FUNCTION;
148  void operator=(const vtkCompositeDataDisplayAttributes&) VTK_DELETE_FUNCTION;
149 
159  static void ComputeVisibleBoundsInternal(
160  vtkCompositeDataDisplayAttributes* cda,
161  vtkDataObject *dobj,
162  unsigned int& flat_index,
163  vtkBoundingBox* bbox,
164  bool parentVisible = true);
165 
166  std::map<unsigned int, bool> BlockVisibilities;
167  std::map<unsigned int, vtkColor3d> BlockColors;
168  std::map<unsigned int, double> BlockOpacities;
169 
170 };
171 
172 #endif // vtkCompositeDataDisplayAttributes_h
abstract base class for most VTK objects
Definition: vtkObject.h:59
rendering attributes for a multi-block dataset.
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.