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
41class vtkCompositeLICHelper;
42
43class VTKRENDERINGLICOPENGL2_EXPORT vtkCompositeSurfaceLICMapper
44 : public vtkSurfaceLICMapper
45{
46public:
49 void PrintSelf(ostream& os, vtkIndent indent);
50
54 virtual void Render(vtkRenderer *ren, vtkActor *act);
55
62
73 virtual bool GetIsOpaque();
74
76
82
84
87 void SetBlockVisibility(unsigned int index, bool visible);
88 bool GetBlockVisibility(unsigned int index) const;
89 void RemoveBlockVisibility(unsigned int index);
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);
107
109
112 void SetBlockOpacity(unsigned int index, double opacity);
113 double GetBlockOpacity(unsigned int index);
114 void RemoveBlockOpacity(unsigned int index);
117
118 // copy values to the helpers
119 void CopyMapperValuesToHelper(vtkCompositeLICHelper *helper);
120
121protected:
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
180private:
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
represents an object (geometry & properties) in a rendered scene
Definition: vtkActor.h:52
rendering attributes for a multi-block dataset.
vtkTimeStamp BoundsMTime
Time stamp for computation of bounds.
double GetBlockOpacity(unsigned int index)
void SetBlockColor(unsigned int index, double color[3])
Set/get the color for a block given its flat index.
void ReportReferences(vtkGarbageCollector *collector) override
Take part in garbage collection.
void RemoveBlockVisibility(unsigned int index)
virtual bool GetIsOpaque()
Returns if the mapper does not expect to have translucent geometry.
virtual void ReleaseGraphicsResources(vtkWindow *win)
Release any graphics resources that are being consumed by this mapper.
static vtkCompositeSurfaceLICMapper * New()
bool GetBlockVisibility(unsigned int index) const
std::map< const vtkDataSet *, vtkCompositeLICHelper * > Helpers
virtual void Render(vtkRenderer *ren, vtkActor *act)
This calls RenderPiece (in a for loop if streaming is necessary).
virtual int FillInputPortInformation(int port, vtkInformation *info)
Need to define the type of data handled by this mapper.
void SetCompositeDataDisplayAttributes(vtkCompositeDataDisplayAttributes *attributes)
Set/get the composite data set attributes.
vtkSmartPointer< vtkCompositeDataDisplayAttributes > CompositeAttributes
Composite data set attributes.
vtkCompositeDataDisplayAttributes * GetCompositeDataDisplayAttributes()
virtual void ComputeBounds()
Need to loop over the hierarchy to compute bounds.
void SetBlockVisibility(unsigned int index, bool visible)
Set/get the visibility for a block given its flat index.
void PrintSelf(ostream &os, vtkIndent indent)
Methods invoked by print to print information about the object including superclasses.
void RenderBlock(vtkRenderer *renderer, vtkActor *actor, vtkDataObject *dobj, unsigned int &flat_index)
double * GetBlockColor(unsigned int index)
void SetBlockColor(unsigned int index, double r, double g, double b)
vtkExecutive * CreateDefaultExecutive()
We need to override this method because the standard streaming demand driven pipeline is not what we ...
void RemoveBlockOpacity(unsigned int index)
void CopyMapperValuesToHelper(vtkCompositeLICHelper *helper)
void SetBlockOpacity(unsigned int index, double opacity)
Set/get the opacity for a block given its flat index.
void RemoveBlockColor(unsigned int index)
general representation of visualization data
Definition: vtkDataObject.h:65
Superclass for all pipeline executives in VTK.
Definition: vtkExecutive.h:50
Detect and break reference loops.
a simple class to control print indentation
Definition: vtkIndent.h:40
Store vtkAlgorithm input/output information.
abstract specification for renderers
Definition: vtkRenderer.h:64
mapper that performs LIC on the surface of arbitrary geometry.
record modification and/or execution time
Definition: vtkTimeStamp.h:36
window superclass for vtkRenderWindow
Definition: vtkWindow.h:35
@ info
Definition: vtkX3D.h:376
@ port
Definition: vtkX3D.h:447
@ color
Definition: vtkX3D.h:221
@ index
Definition: vtkX3D.h:246
vtkTypeUInt64 vtkMTimeType
Definition: vtkType.h:248