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
36class vtkBoundingBox;
37class vtkDataObject;
38
39class VTKRENDERINGCORE_EXPORT vtkCompositeDataDisplayAttributes : public vtkObject
40{
41public:
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
142protected:
145
146private:
148 void operator=(const vtkCompositeDataDisplayAttributes&) VTK_DELETE_FUNCTION;
149
159 static void ComputeVisibleBoundsInternal(
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
Fast Simple Class for dealing with 3D bounds.
rendering attributes for a multi-block dataset.
static vtkCompositeDataDisplayAttributes * New()
general representation of visualization data
Definition: vtkDataObject.h:65
a simple class to control print indentation
Definition: vtkIndent.h:40
abstract base class for most VTK objects
Definition: vtkObject.h:60
@ color
Definition: vtkX3D.h:221