VTK  9.0.1
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 =========================================================================*/
25 #ifndef vtkSurfaceLICComposite_h
26 #define vtkSurfaceLICComposite_h
27 
28 #include "vtkObject.h"
29 #include "vtkPixelExtent.h" // for pixel extent
30 #include "vtkRenderingLICOpenGL2Module.h" // for export macro
31 #include <deque> // for deque
32 #include <vector> // for vector
33 
34 class vtkFloatArray;
36 class vtkTextureObject;
38 
39 class VTKRENDERINGLICOPENGL2_EXPORT vtkSurfaceLICComposite : public vtkObject
40 {
41 public:
42  static vtkSurfaceLICComposite* New();
44  void PrintSelf(ostream& os, vtkIndent indent) override;
45 
53  void Initialize(const vtkPixelExtent& winExt, const std::deque<vtkPixelExtent>& blockExts,
54  int strategy, double stepSize, int nSteps, int normalizeVectors, int enhancedLIC,
55  int anitalias);
56 
86  enum
87  {
88  COMPOSITE_INPLACE = 0,
91  COMPOSITE_AUTO
92  };
93  void SetStrategy(int val) { this->Strategy = val; }
94  int GetStrategy() { return this->Strategy; }
95 
100  int GetNumberOfCompositeExtents() const { return static_cast<int>(this->CompositeExt.size()); }
101 
106  const vtkPixelExtent& GetGuardExtent(int i = 0) const { return this->GuardExt[i]; }
107 
108  const std::deque<vtkPixelExtent>& GetGuardExtents() const { return this->GuardExt; }
109 
114  const vtkPixelExtent& GetDisjointGuardExtent(int i = 0) const
115  {
116  return this->DisjointGuardExt[i];
117  }
118 
119  const std::deque<vtkPixelExtent>& GetDisjointGuardExtents() const { return this->GuardExt; }
120 
125  const vtkPixelExtent& GetCompositeExtent(int i = 0) const { return this->CompositeExt[i]; }
126 
127  const std::deque<vtkPixelExtent>& GetCompositeExtents() const { return this->CompositeExt; }
128 
132  const vtkPixelExtent& GetDataSetExtent() const { return this->DataSetExt; }
133 
137  const vtkPixelExtent& GetWindowExtent() const { return this->WindowExt; }
138 
143  int InitializeCompositeExtents(float* vectors);
144 
151  virtual vtkOpenGLRenderWindow* GetContext() { return nullptr; }
152 
160 
164  virtual void RestoreDefaultCommunicator() {}
165 
170  virtual int BuildProgram(float*) { return -1; }
171 
176  virtual int Gather(void*, int, int, vtkTextureObject*&) { return -1; }
177 
182  virtual int Scatter(void*, int, int, vtkTextureObject*&) { return -1; }
183 
189  static int MakeDecompDisjoint(std::deque<vtkPixelExtent>& in, std::deque<vtkPixelExtent>& out);
190 
191 protected:
193  ~vtkSurfaceLICComposite() override;
194 
203  int MakeDecompDisjoint(
204  const std::deque<vtkPixelExtent>& in, std::deque<vtkPixelExtent>& out, float* vectors);
205 
209  float VectorMax(const vtkPixelExtent& ext, float* vectors);
210 
215  int VectorMax(const std::deque<vtkPixelExtent>& exts, float* vectors, std::vector<float>& vMax);
216 
220  int AddGuardPixels(const std::deque<vtkPixelExtent>& exts, std::deque<vtkPixelExtent>& guardExts,
221  std::deque<vtkPixelExtent>& disjointGuardExts, float* vectors);
222 
226  void GetPixelBounds(float* rgba, int ni, vtkPixelExtent& ext);
227 
233  float GetFudgeFactor(int nx[2]);
234 
235 protected:
236  int Pass; // id for mpi tagging
237 
238  vtkPixelExtent WindowExt; // screen extent (screen size)
239  vtkPixelExtent DataSetExt; // screen extent of the dataset
240  std::deque<vtkPixelExtent> BlockExts; // screen extents of blocks
241 
242  std::deque<vtkPixelExtent> CompositeExt; // screen extents after decomp
243  std::deque<vtkPixelExtent> GuardExt; // screen extents w/ guard cells
244  std::deque<vtkPixelExtent> DisjointGuardExt; // screen extents w/ guard cells
245 
246  int Strategy; // control for parallel composite
247 
248  double StepSize; // window coordinates step size
249  int NumberOfSteps; // number of integration steps
250  int NormalizeVectors; // does integrator normailze
251  int NumberOfGuardLevels; // 1.5 if enhanced LIC 1 otherwise
252  int NumberOfEEGuardPixels; // 1 if enhanced LIC 0 otherwise
253  int NumberOfAAGuardPixels; // n antialias passes
254 
255 private:
257  void operator=(const vtkSurfaceLICComposite&) = delete;
258 
259  friend ostream& operator<<(ostream& os, vtkSurfaceLICComposite& ss);
260 };
261 
262 ostream& operator<<(ostream& os, vtkSurfaceLICComposite& ss);
263 
264 #endif
vtkSurfaceLICComposite::GetWindowExtent
const vtkPixelExtent & GetWindowExtent() const
Get the whole window extent.
Definition: vtkSurfaceLICComposite.h:137
vtkSurfaceLICComposite::NumberOfEEGuardPixels
int NumberOfEEGuardPixels
Definition: vtkSurfaceLICComposite.h:252
vtkSurfaceLICComposite::BlockExts
std::deque< vtkPixelExtent > BlockExts
Definition: vtkSurfaceLICComposite.h:240
vtkSurfaceLICComposite::SetContext
virtual void SetContext(vtkOpenGLRenderWindow *)
Set the rendering context.
Definition: vtkSurfaceLICComposite.h:150
vtkSurfaceLICComposite::GetCompositeExtents
const std::deque< vtkPixelExtent > & GetCompositeExtents() const
Definition: vtkSurfaceLICComposite.h:127
vtkSurfaceLICComposite::SetStrategy
void SetStrategy(int val)
Definition: vtkSurfaceLICComposite.h:93
vtkFloatArray
dynamic, self-adjusting array of float
Definition: vtkFloatArray.h:35
vtkObject::New
static vtkObject * New()
Create an object with Debug turned off, modified time initialized to zero, and reference counting on.
vtkSurfaceLICComposite::NormalizeVectors
int NormalizeVectors
Definition: vtkSurfaceLICComposite.h:250
operator<<
ostream & operator<<(ostream &os, vtkSurfaceLICComposite &ss)
vtkObject
abstract base class for most VTK objects
Definition: vtkObject.h:62
vtkSurfaceLICComposite::Scatter
virtual int Scatter(void *, int, int, vtkTextureObject *&)
Move a single buffer from the LIC decomp to the geometry decomp In parallel THIS IS A COLLECTIVE OPER...
Definition: vtkSurfaceLICComposite.h:182
vtkSurfaceLICComposite::GetNumberOfCompositeExtents
int GetNumberOfCompositeExtents() const
Get the number of new extents assigned to this rank after the decomposition.
Definition: vtkSurfaceLICComposite.h:100
vtkSurfaceLICComposite::NumberOfGuardLevels
int NumberOfGuardLevels
Definition: vtkSurfaceLICComposite.h:251
vtkSurfaceLICComposite::WindowExt
vtkPixelExtent WindowExt
Definition: vtkSurfaceLICComposite.h:238
vtkPixelExtent
Definition: vtkPixelExtent.h:38
vtkSurfaceLICComposite::GetDataSetExtent
const vtkPixelExtent & GetDataSetExtent() const
Get the whole dataset extent (all blocks).
Definition: vtkSurfaceLICComposite.h:132
vtkSurfaceLICComposite::GetGuardExtents
const std::deque< vtkPixelExtent > & GetGuardExtents() const
Definition: vtkSurfaceLICComposite.h:108
vtkSurfaceLICComposite::BuildProgram
virtual int BuildProgram(float *)
Build programs to move data to the new decomp In parallel THIS IS A COLLECTIVE OPERATION.
Definition: vtkSurfaceLICComposite.h:170
vtkSurfaceLICComposite
Definition: vtkSurfaceLICComposite.h:39
vtkPixelExtent.h
vtkSurfaceLICComposite::RestoreDefaultCommunicator
virtual void RestoreDefaultCommunicator()
Set the communicator to the default communicator.
Definition: vtkSurfaceLICComposite.h:164
vtkIndent
a simple class to control print indentation
Definition: vtkIndent.h:33
vtkTextureObject
abstracts an OpenGL texture object.
Definition: vtkTextureObject.h:40
vtkSurfaceLICComposite::GuardExt
std::deque< vtkPixelExtent > GuardExt
Definition: vtkSurfaceLICComposite.h:243
vtkSurfaceLICComposite::CompositeExt
std::deque< vtkPixelExtent > CompositeExt
Definition: vtkSurfaceLICComposite.h:242
vtkSurfaceLICComposite::Strategy
int Strategy
Definition: vtkSurfaceLICComposite.h:246
vtkSurfaceLICComposite::GetCompositeExtent
const vtkPixelExtent & GetCompositeExtent(int i=0) const
Get the extent of the domain over which to compute the LIC.
Definition: vtkSurfaceLICComposite.h:125
vtkSurfaceLICComposite::NumberOfSteps
int NumberOfSteps
Definition: vtkSurfaceLICComposite.h:249
vtkObject::PrintSelf
void PrintSelf(ostream &os, vtkIndent indent) override
Methods invoked by print to print information about the object including superclasses.
vtkSurfaceLICComposite::DisjointGuardExt
std::deque< vtkPixelExtent > DisjointGuardExt
Definition: vtkSurfaceLICComposite.h:244
vtkSurfaceLICComposite::StepSize
double StepSize
Definition: vtkSurfaceLICComposite.h:248
vtkObject.h
vtkSurfaceLICComposite::COMPOSITE_BALANCED
@ COMPOSITE_BALANCED
Definition: vtkSurfaceLICComposite.h:90
vtkPainterCommunicator
A communicator that can safely be used inside a painter.
Definition: vtkPainterCommunicator.h:30
vtkSurfaceLICComposite::GetDisjointGuardExtents
const std::deque< vtkPixelExtent > & GetDisjointGuardExtents() const
Definition: vtkSurfaceLICComposite.h:119
vtkSurfaceLICComposite::GetDisjointGuardExtent
const vtkPixelExtent & GetDisjointGuardExtent(int i=0) const
Get the extent of the domain over which to compute the LIC.
Definition: vtkSurfaceLICComposite.h:114
vtkObjectBase::operator<<
friend VTKCOMMONCORE_EXPORT ostream & operator<<(ostream &os, vtkObjectBase &o)
vtkSurfaceLICComposite::GetStrategy
int GetStrategy()
Definition: vtkSurfaceLICComposite.h:94
vtkSurfaceLICComposite::Pass
int Pass
Definition: vtkSurfaceLICComposite.h:236
vtkOpenGLRenderWindow
OpenGL rendering window.
Definition: vtkOpenGLRenderWindow.h:51
vtkSurfaceLICComposite::GetGuardExtent
const vtkPixelExtent & GetGuardExtent(int i=0) const
Get the extent of the domain over which to compute the LIC.
Definition: vtkSurfaceLICComposite.h:106
vtkSurfaceLICComposite::DataSetExt
vtkPixelExtent DataSetExt
Definition: vtkSurfaceLICComposite.h:239
vtkSurfaceLICComposite::GetContext
virtual vtkOpenGLRenderWindow * GetContext()
Definition: vtkSurfaceLICComposite.h:151
vtkSurfaceLICComposite::Gather
virtual int Gather(void *, int, int, vtkTextureObject *&)
Move a single buffer from the geometry decomp to the LIC decomp.
Definition: vtkSurfaceLICComposite.h:176
vtkSurfaceLICComposite::NumberOfAAGuardPixels
int NumberOfAAGuardPixels
Definition: vtkSurfaceLICComposite.h:253
vtkSurfaceLICComposite::COMPOSITE_INPLACE_DISJOINT
@ COMPOSITE_INPLACE_DISJOINT
Definition: vtkSurfaceLICComposite.h:89
vtkSurfaceLICComposite::SetCommunicator
virtual void SetCommunicator(vtkPainterCommunicator *)
Set the communicator for parallel communication.
Definition: vtkSurfaceLICComposite.h:159