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 
56  virtual void ReleaseGraphicsResources(vtkWindow * win);
57 
66  virtual bool GetIsOpaque();
67 
69 
70  void SetCompositeDataDisplayAttributes(vtkCompositeDataDisplayAttributes *attributes);
71  vtkCompositeDataDisplayAttributes* GetCompositeDataDisplayAttributes();
73 
75 
76  void SetBlockVisibility(unsigned int index, bool visible);
77  bool GetBlockVisibility(unsigned int index) const;
78  void RemoveBlockVisibility(unsigned int index);
79  void RemoveBlockVisibilites();
81 
83 
84  void SetBlockColor(unsigned int index, double color[3]);
85  void SetBlockColor(unsigned int index, double r, double g, double b)
86  {
87  double color[3] = {r, g, b};
88  this->SetBlockColor(index, color);
89  }
90  double* GetBlockColor(unsigned int index);
91  void RemoveBlockColor(unsigned int index);
92  void RemoveBlockColors();
94 
96 
97  void SetBlockOpacity(unsigned int index, double opacity);
98  double GetBlockOpacity(unsigned int index);
99  void RemoveBlockOpacity(unsigned int index);
100  void RemoveBlockOpacities();
102 
103  // copy values to the helpers
104  void CopyMapperValuesToHelper(vtkCompositeLICHelper *helper);
105 
106 protected:
109 
111  virtual void ReportReferences(vtkGarbageCollector *collector);
112 
117 
120 
122  virtual void ComputeBounds();
123 
126 
127  // what "index" are we currently rendering, -1 means none
129 
131  {
132  public:
133  std::stack<bool> Visibility;
134  std::stack<double> Opacity;
135  std::stack<vtkColor3d> AmbientColor;
136  std::stack<vtkColor3d> DiffuseColor;
137  std::stack<vtkColor3d> SpecularColor;
138  };
139 
141  void RenderBlock(vtkRenderer *renderer,
142  vtkActor *actor,
143  vtkDataObject *dobj,
144  unsigned int &flat_index);
145 
146  std::map<const vtkDataSet *, vtkCompositeLICHelper *> Helpers;
148  friend class vtkCompositeLICHelper;
149 
152 
153 private:
154  unsigned long int LastOpaqueCheckTime;
155  bool LastOpaqueCheckValue;
156  double ColorResult[3];
158  const vtkCompositeSurfaceLICMapper&); // Not implemented.
159  void operator=(const vtkCompositeSurfaceLICMapper&); // Not implemented.
160 };
161 
162 #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:62
Superclass for all pipeline executives in VTK.
Definition: vtkExecutive.h:48
virtual void ComputeBounds()
Detect and break reference loops.
virtual bool GetIsOpaque()
window superclass for vtkRenderWindow
Definition: vtkWindow.h:36
a simple class to control print indentation
Definition: vtkIndent.h:38
virtual void ReleaseGraphicsResources(vtkWindow *win)
mapper for composite dataset
static vtkSurfaceLICMapper * New()
virtual void ReportReferences(vtkGarbageCollector *collector)
virtual void Render(vtkRenderer *ren, vtkActor *act)
general representation of visualization data
Definition: vtkDataObject.h:64