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 =========================================================================*/
29 #ifndef vtkCompositeSurfaceLICMapper_h
30 #define vtkCompositeSurfaceLICMapper_h
31 
32 #include "vtkRenderingLICOpenGL2Module.h" // For export macro
33 #include "vtkSmartPointer.h" // for vtkSmartPointer
34 #include "vtkSurfaceLICMapper.h"
35 
36 #include "vtkColor.h" // used for ivars
37 #include <map> // use for ivars
38 #include <stack> // used for ivars
39 
41 class vtkCompositeLICHelper;
42 
43 class VTKRENDERINGLICOPENGL2_EXPORT vtkCompositeSurfaceLICMapper
44  : public vtkSurfaceLICMapper
45 {
46 public:
49  void PrintSelf(ostream& os, vtkIndent indent);
50 
54  virtual void Render(vtkRenderer *ren, vtkActor *act);
55 
61  virtual void ReleaseGraphicsResources(vtkWindow * win);
62 
73  virtual bool GetIsOpaque();
74 
76 
79  void SetCompositeDataDisplayAttributes(vtkCompositeDataDisplayAttributes *attributes);
80  vtkCompositeDataDisplayAttributes* GetCompositeDataDisplayAttributes();
82 
84 
87  void SetBlockVisibility(unsigned int index, bool visible);
88  bool GetBlockVisibility(unsigned int index) const;
89  void RemoveBlockVisibility(unsigned int index);
90  void RemoveBlockVisibilites();
92 
94 
97  void SetBlockColor(unsigned int index, double color[3]);
98  void SetBlockColor(unsigned int index, double r, double g, double b)
99  {
100  double color[3] = {r, g, b};
101  this->SetBlockColor(index, color);
102  }
103  double* GetBlockColor(unsigned int index);
104  void RemoveBlockColor(unsigned int index);
105  void RemoveBlockColors();
107 
109 
112  void SetBlockOpacity(unsigned int index, double opacity);
113  double GetBlockOpacity(unsigned int index);
114  void RemoveBlockOpacity(unsigned int index);
115  void RemoveBlockOpacities();
117 
118  // copy values to the helpers
119  void CopyMapperValuesToHelper(vtkCompositeLICHelper *helper);
120 
121 protected:
124 
128  void ReportReferences(vtkGarbageCollector *collector) VTK_OVERRIDE;
129 
136 
141 
145  virtual void ComputeBounds();
146 
151 
152  // what "index" are we currently rendering, -1 means none
154 
156  {
157  public:
158  std::stack<bool> Visibility;
159  std::stack<double> Opacity;
160  std::stack<vtkColor3d> AmbientColor;
161  std::stack<vtkColor3d> DiffuseColor;
162  std::stack<vtkColor3d> SpecularColor;
163  };
164 
166  void RenderBlock(vtkRenderer *renderer,
167  vtkActor *actor,
168  vtkDataObject *dobj,
169  unsigned int &flat_index);
170 
171  std::map<const vtkDataSet *, vtkCompositeLICHelper *> Helpers;
173  friend class vtkCompositeLICHelper;
174 
179 
180 private:
181  vtkMTimeType LastOpaqueCheckTime;
182  bool LastOpaqueCheckValue;
183  double ColorResult[3];
185  const vtkCompositeSurfaceLICMapper&) VTK_DELETE_FUNCTION;
186  void operator=(const vtkCompositeSurfaceLICMapper&) VTK_DELETE_FUNCTION;
187 };
188 
189 #endif
std::map< const vtkDataSet *, vtkCompositeLICHelper * > Helpers
represents an object (geometry & properties) in a rendered scene
Definition: vtkActor.h:51
virtual int FillInputPortInformation(int, vtkInformation *)
Fill the input port information objects for this algorithm.
mapper that performs LIC on the surface of arbitrary geometry.
virtual vtkExecutive * CreateDefaultExecutive()
Create a default executive.
Store vtkAlgorithm input/output information.
void PrintSelf(ostream &os, vtkIndent indent)
Methods invoked by print to print information about the object including superclasses.
void ReportReferences(vtkGarbageCollector *) override
void SetBlockColor(unsigned int index, double r, double g, double b)
Set/get the color for a block given its flat index.
record modification and/or execution time
Definition: vtkTimeStamp.h:35
rendering attributes for a multi-block dataset.
vtkSmartPointer< vtkCompositeDataDisplayAttributes > CompositeAttributes
Composite data set attributes.
abstract specification for renderers
Definition: vtkRenderer.h:63
Superclass for all pipeline executives in VTK.
Definition: vtkExecutive.h:49
virtual void ComputeBounds()
Called in GetBounds().
vtkTypeUInt64 vtkMTimeType
Definition: vtkType.h:248
Detect and break reference loops.
virtual bool GetIsOpaque()
Returns if the mapper does not expect to have translucent geometry.
window superclass for vtkRenderWindow
Definition: vtkWindow.h:37
a simple class to control print indentation
Definition: vtkIndent.h:39
virtual void ReleaseGraphicsResources(vtkWindow *win)
Release any graphics resources that are being consumed by this mapper.
mapper for composite dataset
static vtkSurfaceLICMapper * New()
vtkTimeStamp BoundsMTime
Time stamp for computation of bounds.
virtual void Render(vtkRenderer *ren, vtkActor *act)
This calls RenderPiece (in a for loop if streaming is necessary).
general representation of visualization data
Definition: vtkDataObject.h:64