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 "vtkRenderingLICModule.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;
36 class vtkTextureObject;
37 
39 {
40 public:
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,
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
184  std::deque<vtkPixelExtent> &in,
185  std::deque<vtkPixelExtent> &out);
187 
188 protected:
191 
193 
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 
216  const std::deque<vtkPixelExtent> &exts,
217  float *vectors,
218  std::vector<float> &vMax);
220 
222 
224  const std::deque<vtkPixelExtent> &exts,
225  std::deque<vtkPixelExtent> &guardExts,
226  std::deque<vtkPixelExtent> &disjointGuardExts,
227  float *vectors);
229 
231 
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
vtkSurfaceLICComposite::COMPOSITE_BALANCED
@ COMPOSITE_BALANCED
Definition: vtkSurfaceLICComposite.h:83
vtkSurfaceLICComposite::GetWindowExtent
const vtkPixelExtent & GetWindowExtent() const
Definition: vtkSurfaceLICComposite.h:135
vtkSurfaceLICComposite::GetPixelBounds
void GetPixelBounds(float *rgba, int ni, vtkPixelExtent &ext)
vtkSurfaceLICComposite::NumberOfEEGuardPixels
int NumberOfEEGuardPixels
Definition: vtkSurfaceLICComposite.h:260
vtkSurfaceLICComposite::COMPOSITE_INPLACE_DISJOINT
@ COMPOSITE_INPLACE_DISJOINT
Definition: vtkSurfaceLICComposite.h:82
vtkSurfaceLICComposite::SetContext
virtual void SetContext(vtkOpenGLRenderWindow *)
Definition: vtkSurfaceLICComposite.h:147
vtkSurfaceLICComposite::GetCompositeExtents
const std::deque< vtkPixelExtent > & GetCompositeExtents() const
Definition: vtkSurfaceLICComposite.h:124
vtkSurfaceLICComposite::VectorMax
int VectorMax(const std::deque< vtkPixelExtent > &exts, float *vectors, std::vector< float > &vMax)
vtkSurfaceLICComposite::SetStrategy
void SetStrategy(int val)
Definition: vtkSurfaceLICComposite.h:86
vtkFloatArray
dynamic, self-adjusting array of float
Definition: vtkFloatArray.h:49
vtkSurfaceLICComposite::MakeDecompDisjoint
static int MakeDecompDisjoint(std::deque< vtkPixelExtent > &in, std::deque< vtkPixelExtent > &out)
vtkSurfaceLICComposite::NormalizeVectors
int NormalizeVectors
Definition: vtkSurfaceLICComposite.h:258
vtkSurfaceLICComposite::DisjointGuardExt
std::deque< vtkPixelExtent > DisjointGuardExt
Definition: vtkSurfaceLICComposite.h:252
operator<<
ostream & operator<<(ostream &os, vtkSurfaceLICComposite &ss)
vtkSurfaceLICComposite::vtkSurfaceLICComposite
vtkSurfaceLICComposite()
vtkSurfaceLICComposite::AddGuardPixels
int AddGuardPixels(const std::deque< vtkPixelExtent > &exts, std::deque< vtkPixelExtent > &guardExts, std::deque< vtkPixelExtent > &disjointGuardExts, float *vectors)
vtkTypeMacro
#define vtkTypeMacro(thisClass, superclass)
Definition: vtkSetGet.h:642
vtkRenderingLICModule.h
vtkObject
abstract base class for most VTK objects
Definition: vtkObject.h:62
vtkSurfaceLICComposite::Scatter
virtual int Scatter(void *, int, int, vtkTextureObject *&)
Definition: vtkSurfaceLICComposite.h:174
vtkSurfaceLICComposite::GetNumberOfCompositeExtents
int GetNumberOfCompositeExtents() const
Definition: vtkSurfaceLICComposite.h:93
vtkSurfaceLICComposite::BlockExts
std::deque< vtkPixelExtent > BlockExts
Definition: vtkSurfaceLICComposite.h:248
vtkgl::in
GLuint in
Definition: vtkgl.h:16905
vtkSurfaceLICComposite::NumberOfGuardLevels
int NumberOfGuardLevels
Definition: vtkSurfaceLICComposite.h:259
vtkSurfaceLICComposite::WindowExt
vtkPixelExtent WindowExt
Definition: vtkSurfaceLICComposite.h:246
vtkPixelExtent
Definition: vtkPixelExtent.h:41
vtkgl::val
GLuint GLfloat * val
Definition: vtkgl.h:13789
vtkSurfaceLICComposite::GetFudgeFactor
float GetFudgeFactor(int nx[2])
vtkSurfaceLICComposite::GetDataSetExtent
const vtkPixelExtent & GetDataSetExtent() const
Definition: vtkSurfaceLICComposite.h:129
vtkSurfaceLICComposite::GetGuardExtents
const std::deque< vtkPixelExtent > & GetGuardExtents() const
Definition: vtkSurfaceLICComposite.h:104
vtkSurfaceLICComposite::GuardExt
std::deque< vtkPixelExtent > GuardExt
Definition: vtkSurfaceLICComposite.h:251
vtkSurfaceLICComposite::MakeDecompDisjoint
int MakeDecompDisjoint(const std::deque< vtkPixelExtent > &in, std::deque< vtkPixelExtent > &out, float *vectors)
vtkSurfaceLICComposite::BuildProgram
virtual int BuildProgram(float *)
Definition: vtkSurfaceLICComposite.h:162
vtkSurfaceLICComposite::~vtkSurfaceLICComposite
~vtkSurfaceLICComposite()
vtkSurfaceLICComposite
Definition: vtkSurfaceLICComposite.h:39
vtkPixelExtent.h
vtkSurfaceLICComposite::RestoreDefaultCommunicator
virtual void RestoreDefaultCommunicator()
Definition: vtkSurfaceLICComposite.h:158
vtkgl::nx
GLfloat GLfloat GLfloat GLfloat nx
Definition: vtkgl.h:15713
vtkSurfaceLICComposite::CompositeExt
std::deque< vtkPixelExtent > CompositeExt
Definition: vtkSurfaceLICComposite.h:250
vtkIndent
a simple class to control print indentation
Definition: vtkIndent.h:39
vtkTextureObject
abstracts an OpenGL texture object.
Definition: vtkTextureObject.h:40
vtkSurfaceLICComposite::InitializeCompositeExtents
int InitializeCompositeExtents(float *vectors)
vtkSurfaceLICComposite::Strategy
int Strategy
Definition: vtkSurfaceLICComposite.h:254
vtkSurfaceLICComposite::GetCompositeExtent
const vtkPixelExtent & GetCompositeExtent(int i=0) const
Definition: vtkSurfaceLICComposite.h:120
vtkSurfaceLICComposite::NumberOfSteps
int NumberOfSteps
Definition: vtkSurfaceLICComposite.h:257
VTKRENDERINGLIC_EXPORT
#define VTKRENDERINGLIC_EXPORT
Definition: vtkRenderingLICModule.h:15
vtkSurfaceLICComposite::StepSize
double StepSize
Definition: vtkSurfaceLICComposite.h:256
vtkSurfaceLICComposite::operator<<
friend ostream & operator<<(ostream &os, vtkSurfaceLICComposite &ss)
vtkObject.h
vtkPainterCommunicator
Definition: vtkPainterCommunicator.h:32
vtkSurfaceLICComposite::GetDisjointGuardExtents
const std::deque< vtkPixelExtent > & GetDisjointGuardExtents() const
Definition: vtkSurfaceLICComposite.h:114
vtkSurfaceLICComposite::New
static vtkSurfaceLICComposite * New()
vtkSurfaceLICComposite::GetDisjointGuardExtent
const vtkPixelExtent & GetDisjointGuardExtent(int i=0) const
Definition: vtkSurfaceLICComposite.h:110
vtkSurfaceLICComposite::GetStrategy
int GetStrategy()
Definition: vtkSurfaceLICComposite.h:87
vtkSurfaceLICComposite::Initialize
void Initialize(const vtkPixelExtent &winExt, const std::deque< vtkPixelExtent > &blockExts, int strategy, double stepSize, int nSteps, int normalizeVectors, int enhancedLIC, int anitalias)
vtkSurfaceLICComposite::Pass
int Pass
Definition: vtkSurfaceLICComposite.h:244
vtkSurfaceLICComposite::PrintSelf
virtual void PrintSelf(ostream &os, vtkIndent indent)
vtkOpenGLRenderWindow
OpenGL rendering window.
Definition: vtkOpenGLRenderWindow.h:41
vtkSurfaceLICComposite::GetGuardExtent
const vtkPixelExtent & GetGuardExtent(int i=0) const
Definition: vtkSurfaceLICComposite.h:100
vtkSurfaceLICComposite::DataSetExt
vtkPixelExtent DataSetExt
Definition: vtkSurfaceLICComposite.h:247
vtkSurfaceLICComposite::GetContext
virtual vtkOpenGLRenderWindow * GetContext()
Definition: vtkSurfaceLICComposite.h:148
vtkSurfaceLICComposite::VectorMax
float VectorMax(const vtkPixelExtent &ext, float *vectors)
vtkSurfaceLICComposite::Gather
virtual int Gather(void *, int, int, vtkTextureObject *&)
Definition: vtkSurfaceLICComposite.h:167
vtkSurfaceLICComposite::NumberOfAAGuardPixels
int NumberOfAAGuardPixels
Definition: vtkSurfaceLICComposite.h:261
vtkSurfaceLICComposite::SetCommunicator
virtual void SetCommunicator(vtkPainterCommunicator *)
Definition: vtkSurfaceLICComposite.h:155