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 =========================================================================*/
26 #ifndef vtkCompositeDataDisplayAttributes_h
27 #define vtkCompositeDataDisplayAttributes_h
28 
29 #include "vtkRenderingCoreModule.h" // for export macro
30 #include "vtkObject.h"
31 #include "vtkColor.h" // for vtkColor3d
32 
33 #include <map> // for std::map
34 
35 class vtkBoundingBox;
36 class vtkDataObject;
37 
39 {
40 public:
43  void PrintSelf(ostream& os, vtkIndent indent);
44 
46  bool HasBlockVisibilities() const;
47 
49 
50  void SetBlockVisibility(unsigned int flat_index, bool visible);
51  bool GetBlockVisibility(unsigned int flat_index) const;
53 
56  bool HasBlockVisibility(unsigned int flat_index) const;
57 
59  void RemoveBlockVisibility(unsigned int flat_index);
60 
63  void RemoveBlockVisibilites();
64 
66 
67  void SetBlockColor(unsigned int flat_index, const double color[3]);
68  void GetBlockColor(unsigned int flat_index, double color[3]) const;
69  vtkColor3d GetBlockColor(unsigned int flat_index) const;
71 
73  bool HasBlockColors() const;
74 
76  bool HasBlockColor(unsigned int flat_index) const;
77 
79  void RemoveBlockColor(unsigned int flat_index);
80 
82  void RemoveBlockColors();
83 
85 
86  void SetBlockOpacity(unsigned int flat_index, double opacity);
87  double GetBlockOpacity(unsigned int flat_index) const;
89 
91  bool HasBlockOpacities() const;
92 
94  bool HasBlockOpacity(unsigned int flat_index) const;
95 
97  void RemoveBlockOpacity(unsigned int flat_index);
98 
100  void RemoveBlockOpacities();
101 
102  // If the input \a dobj is a vtkCompositeDataSet, we will loop over the
103  // hierarchy recursively starting from intial index 0 and use only visible
104  // blocks, which is specified in the vtkCompositeDataDisplayAttributes \a cda,
105  // to compute the \a bounds.
106  static void ComputeVisibleBounds(
108  vtkDataObject *dobj,
109  double bounds[6]);
110 
111 protected:
113  ~vtkCompositeDataDisplayAttributes();
114 
115 private:
116  vtkCompositeDataDisplayAttributes(const vtkCompositeDataDisplayAttributes&); // Not implemented.
117  void operator=(const vtkCompositeDataDisplayAttributes&); // Not implemented.
118 
120 
126  static void ComputeVisibleBoundsInternal(
127  vtkCompositeDataDisplayAttributes* cda,
128  vtkDataObject *dobj,
129  unsigned int& flat_index,
130  vtkBoundingBox* bbox,
131  bool parentVisible = true);
133 
134  std::map<unsigned int, bool> BlockVisibilities;
135  std::map<unsigned int, vtkColor3d> BlockColors;
136  std::map<unsigned int, double> BlockOpacities;
137 
138 };
139 
140 #endif // vtkCompositeDataDisplayAttributes_h
abstract base class for most VTK objects
Definition: vtkObject.h:61
rendering attributes for a multi-block dataset.
a simple class to control print indentation
Definition: vtkIndent.h:38
#define VTKRENDERINGCORE_EXPORT
static vtkObject * New()
general representation of visualization data
Definition: vtkDataObject.h:64
Fast Simple Class for dealing with 3D bounds.