VTK
vtkCompositeSurfaceLICMapper.h
Go to the documentation of this file.
1 /*=========================================================================
2 
3  Program: Visualization Toolkit
4  Module: vtkCompositeSurfaceLICMapper.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 =========================================================================*/
28 #ifndef vtkCompositeSurfaceLICMapper_h
29 #define vtkCompositeSurfaceLICMapper_h
30 
31 #include "vtkRenderingLICOpenGL2Module.h" // For export macro
32 #include "vtkSmartPointer.h" // for vtkSmartPointer
33 #include "vtkSurfaceLICMapper.h"
34 
35 #include "vtkColor.h" // used for ivars
36 #include <map> // use for ivars
37 #include <stack> // used for ivars
38 
40 class vtkCompositeLICHelper;
41 
42 class VTKRENDERINGLICOPENGL2_EXPORT vtkCompositeSurfaceLICMapper
43  : public vtkSurfaceLICMapper
44 {
45 public:
48  void PrintSelf(ostream& os, vtkIndent indent);
49 
51  virtual void Render(vtkRenderer *ren, vtkActor *act);
52 
61  virtual bool GetIsOpaque();
62 
64 
65  void SetCompositeDataDisplayAttributes(vtkCompositeDataDisplayAttributes *attributes);
66  vtkCompositeDataDisplayAttributes* GetCompositeDataDisplayAttributes();
68 
70 
71  void SetBlockVisibility(unsigned int index, bool visible);
72  bool GetBlockVisibility(unsigned int index) const;
73  void RemoveBlockVisibility(unsigned int index);
74  void RemoveBlockVisibilites();
76 
78 
79  void SetBlockColor(unsigned int index, double color[3]);
80  void SetBlockColor(unsigned int index, double r, double g, double b)
81  {
82  double color[3] = {r, g, b};
83  this->SetBlockColor(index, color);
84  }
85  double* GetBlockColor(unsigned int index);
86  void RemoveBlockColor(unsigned int index);
87  void RemoveBlockColors();
89 
91 
92  void SetBlockOpacity(unsigned int index, double opacity);
93  double GetBlockOpacity(unsigned int index);
94  void RemoveBlockOpacity(unsigned int index);
95  void RemoveBlockOpacities();
97 
98  // copy values to the helpers
99  void CopyMapperValuesToHelper(vtkCompositeLICHelper *helper);
100 
101 protected:
104 
109 
112 
114  virtual void ComputeBounds();
115 
118 
119  // what "index" are we currently rendering, -1 means none
121 
123  {
124  public:
125  std::stack<bool> Visibility;
126  std::stack<double> Opacity;
127  std::stack<vtkColor3d> AmbientColor;
128  std::stack<vtkColor3d> DiffuseColor;
129  std::stack<vtkColor3d> SpecularColor;
130  };
131 
133  void RenderBlock(vtkRenderer *renderer,
134  vtkActor *actor,
135  vtkDataObject *dobj,
136  unsigned int &flat_index);
137 
138  std::map<const vtkDataSet *, vtkCompositeLICHelper *> Helpers;
140  friend class vtkCompositeLICHelper;
141 
144 
145 private:
146  unsigned long int LastOpaqueCheckTime;
147  bool LastOpaqueCheckValue;
148  double ColorResult[3];
150  const vtkCompositeSurfaceLICMapper&); // Not implemented.
151  void operator=(const vtkCompositeSurfaceLICMapper&); // Not implemented.
152 };
153 
154 #endif
std::map< const vtkDataSet *, vtkCompositeLICHelper * > Helpers
represents an object (geometry & properties) in a rendered scene
Definition: vtkActor.h:50
virtual int FillInputPortInformation(int, vtkInformation *)
mapper that performs LIC on the surface of arbitrary geometry.
virtual vtkExecutive * CreateDefaultExecutive()
Store vtkAlgorithm input/output information.
void PrintSelf(ostream &os, vtkIndent indent)
void SetBlockColor(unsigned int index, double r, double g, double b)
record modification and/or execution time
Definition: vtkTimeStamp.h:34
rendering attributes for a multi-block dataset.
vtkSmartPointer< vtkCompositeDataDisplayAttributes > CompositeAttributes
abstract specification for renderers
Definition: vtkRenderer.h:63
Superclass for all pipeline executives in VTK.
Definition: vtkExecutive.h:51
virtual void ComputeBounds()
virtual bool GetIsOpaque()
a simple class to control print indentation
Definition: vtkIndent.h:38
mapper for composite dataset
static vtkSurfaceLICMapper * New()
virtual void Render(vtkRenderer *ren, vtkActor *act)
general representation of visualization data
Definition: vtkDataObject.h:64