VTK
vtkSurfaceLICComposite.h
Go to the documentation of this file.
1 /*=========================================================================
2 
3  Program: Visualization Toolkit
4  Module: vtkSurfaceLICComposite.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 =========================================================================*/
24 #ifndef vtkSurfaceLICComposite_h
25 #define vtkSurfaceLICComposite_h
26 
27 #include "vtkObject.h"
28 #include "vtkRenderingLICOpenGL2Module.h" // for export macro
29 #include "vtkPixelExtent.h" // for pixel extent
30 #include <deque> // for deque
31 #include <vector> // for vector
32 
33 class vtkFloatArray;
35 class vtkTextureObject;
37 
38 class VTKRENDERINGLICOPENGL2_EXPORT vtkSurfaceLICComposite : public vtkObject
39 {
40 public:
41  static vtkSurfaceLICComposite *New();
43  virtual void PrintSelf(ostream &os, vtkIndent indent);
44 
46 
51  void Initialize(
52  const vtkPixelExtent &winExt,
53  const std::deque<vtkPixelExtent> &blockExts,
54  int strategy,
55  double stepSize,
56  int nSteps,
57  int normalizeVectors,
58  int enhancedLIC,
59  int anitalias);
61 
63 
80  enum {
81  COMPOSITE_INPLACE=0,
82  COMPOSITE_INPLACE_DISJOINT,
83  COMPOSITE_BALANCED,
84  COMPOSITE_AUTO
85  };
86  void SetStrategy(int val){ this->Strategy = val; }
87  int GetStrategy(){ return this->Strategy; }
89 
91 
94  { return static_cast<int>(this->CompositeExt.size()); }
96 
98 
100  const vtkPixelExtent &GetGuardExtent(int i=0) const
101  { return this->GuardExt[i]; }
103 
104  const std::deque<vtkPixelExtent> &GetGuardExtents() const
105  { return this->GuardExt; }
106 
108 
111  { return this->DisjointGuardExt[i]; }
113 
114  const std::deque<vtkPixelExtent> &GetDisjointGuardExtents() const
115  { return this->GuardExt; }
116 
118 
120  const vtkPixelExtent &GetCompositeExtent(int i=0) const
121  { return this->CompositeExt[i]; }
123 
124  const std::deque<vtkPixelExtent> &GetCompositeExtents() const
125  { return this->CompositeExt; }
126 
128 
130  { return this->DataSetExt; }
132 
134 
136  { return this->WindowExt; }
138 
141  int InitializeCompositeExtents(float *vectors);
142 
144 
148  virtual vtkOpenGLRenderWindow *GetContext(){ return NULL; }
150 
156 
158  virtual void RestoreDefaultCommunicator(){}
159 
162  virtual int BuildProgram(float*){ return -1; }
163 
165 
167  virtual int Gather(void *, int, int, vtkTextureObject *&)
168  { return -1; }
170 
172 
174  virtual int Scatter(void *, int, int, vtkTextureObject *&)
175  { return -1; }
177 
179 
182  static
183  int MakeDecompDisjoint(
184  std::deque<vtkPixelExtent> &in,
185  std::deque<vtkPixelExtent> &out);
187 
188 protected:
191 
193 
199  int MakeDecompDisjoint(
200  const std::deque<vtkPixelExtent> &in,
201  std::deque<vtkPixelExtent> &out,
202  float *vectors);
204 
206 
207  float VectorMax(
208  const vtkPixelExtent &ext,
209  float *vectors);
211 
213 
215  int VectorMax(
216  const std::deque<vtkPixelExtent> &exts,
217  float *vectors,
218  std::vector<float> &vMax);
220 
222 
223  int AddGuardPixels(
224  const std::deque<vtkPixelExtent> &exts,
225  std::deque<vtkPixelExtent> &guardExts,
226  std::deque<vtkPixelExtent> &disjointGuardExts,
227  float *vectors);
229 
231 
232  void GetPixelBounds(
233  float *rgba,
234  int ni,
235  vtkPixelExtent &ext);
237 
241  float GetFudgeFactor(int nx[2]);
242 
243 protected:
244  int Pass; // id for mpi tagging
245 
246  vtkPixelExtent WindowExt; // screen extent (screen size)
247  vtkPixelExtent DataSetExt; // screen extent of the dataset
248  std::deque<vtkPixelExtent> BlockExts; // screen extents of blocks
249 
250  std::deque<vtkPixelExtent> CompositeExt; // screen extents after decomp
251  std::deque<vtkPixelExtent> GuardExt; // screen extents w/ guard cells
252  std::deque<vtkPixelExtent> DisjointGuardExt; // screen extents w/ guard cells
253 
254  int Strategy; // control for parallel composite
255 
256  double StepSize; // window coordinates step size
257  int NumberOfSteps; // number of integration steps
258  int NormalizeVectors; // does integrator normailze
259  int NumberOfGuardLevels; // 1.5 if enhanced LIC 1 otherwise
260  int NumberOfEEGuardPixels; // 1 if enhanced LIC 0 otherwise
261  int NumberOfAAGuardPixels; // n antialias passes
262 
263 private:
264  vtkSurfaceLICComposite(const vtkSurfaceLICComposite&); // Not implemented
265  void operator=(const vtkSurfaceLICComposite&); // Not implemented
266 
267  friend
268  ostream &operator<<(ostream &os, vtkSurfaceLICComposite &ss);
269 };
270 
271 ostream &operator<<(ostream &os, vtkSurfaceLICComposite &ss);
272 
273 #endif
OpenGL rendering window.
abstract base class for most VTK objects
Definition: vtkObject.h:61
ostream & operator<<(ostream &os, vtkSurfaceLICComposite &ss)
const vtkPixelExtent & GetGuardExtent(int i=0) const
dynamic, self-adjusting array of float
Definition: vtkFloatArray.h:45
virtual vtkOpenGLRenderWindow * GetContext()
const std::deque< vtkPixelExtent > & GetGuardExtents() const
const vtkPixelExtent & GetDisjointGuardExtent(int i=0) const
virtual void SetCommunicator(vtkPainterCommunicator *)
virtual int Gather(void *, int, int, vtkTextureObject *&)
const std::deque< vtkPixelExtent > & GetCompositeExtents() const
const vtkPixelExtent & GetWindowExtent() const
virtual void PrintSelf(ostream &os, vtkIndent indent)
const std::deque< vtkPixelExtent > & GetDisjointGuardExtents() const
a simple class to control print indentation
Definition: vtkIndent.h:38
virtual void SetContext(vtkOpenGLRenderWindow *)
abstracts an OpenGL texture object.
const vtkPixelExtent & GetDataSetExtent() const
const vtkPixelExtent & GetCompositeExtent(int i=0) const
virtual int Scatter(void *, int, int, vtkTextureObject *&)
virtual int BuildProgram(float *)
static vtkObject * New()
virtual void RestoreDefaultCommunicator()
friend VTKCOMMONCORE_EXPORT ostream & operator<<(ostream &os, vtkObjectBase &o)
int GetNumberOfCompositeExtents() const