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
OpenGL rendering window.
std::deque< vtkPixelExtent > DisjointGuardExt
abstract base class for most VTK objects
Definition: vtkObject.h:62
void PrintSelf(ostream &os, vtkIndent indent) override
Methods invoked by print to print information about the object including superclasses.
std::deque< vtkPixelExtent > CompositeExt
ostream & operator<<(ostream &os, vtkSurfaceLICComposite &ss)
const vtkPixelExtent & GetCompositeExtent(int i=0) const
Get the extent of the domain over which to compute the LIC.
std::deque< vtkPixelExtent > GuardExt
const vtkPixelExtent & GetGuardExtent(int i=0) const
Get the extent of the domain over which to compute the LIC.
const vtkPixelExtent & GetDisjointGuardExtent(int i=0) const
Get the extent of the domain over which to compute the LIC.
dynamic, self-adjusting array of float
Definition: vtkFloatArray.h:35
virtual vtkOpenGLRenderWindow * GetContext()
const std::deque< vtkPixelExtent > & GetDisjointGuardExtents() const
virtual void SetCommunicator(vtkPainterCommunicator *)
Set the communicator for parallel communication.
virtual int Gather(void *, int, int, vtkTextureObject *&)
Move a single buffer from the geometry decomp to the LIC decomp.
a simple class to control print indentation
Definition: vtkIndent.h:33
virtual void SetContext(vtkOpenGLRenderWindow *)
Set the rendering context.
const std::deque< vtkPixelExtent > & GetCompositeExtents() const
const vtkPixelExtent & GetWindowExtent() const
Get the whole window extent.
std::deque< vtkPixelExtent > BlockExts
abstracts an OpenGL texture object.
Representation of a cartesian pixel plane and common operations on it.
const vtkPixelExtent & GetDataSetExtent() const
Get the whole dataset extent (all blocks).
const std::deque< vtkPixelExtent > & GetGuardExtents() const
A communicator that can safely be used inside a painter.
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...
virtual int BuildProgram(float *)
Build programs to move data to the new decomp In parallel THIS IS A COLLECTIVE OPERATION.
int GetNumberOfCompositeExtents() const
Get the number of new extents assigned to this rank after the decomposition.
This class decomposes the image space and shuffles image space data onto the new decomposition with t...
static vtkObject * New()
Create an object with Debug turned off, modified time initialized to zero, and reference counting on...
virtual void RestoreDefaultCommunicator()
Set the communicator to the default communicator.
friend VTKCOMMONCORE_EXPORT ostream & operator<<(ostream &os, vtkObjectBase &o)