VTK  9.1.0
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
34class vtkFloatArray;
38
39class VTKRENDERINGLICOPENGL2_EXPORT vtkSurfaceLICComposite : public vtkObject
40{
41public:
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
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
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
191protected:
194
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
235protected:
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
255private:
257 void operator=(const vtkSurfaceLICComposite&) = delete;
258
259 friend ostream& operator<<(ostream& os, vtkSurfaceLICComposite& ss);
260};
261
262ostream& operator<<(ostream& os, vtkSurfaceLICComposite& ss);
263
264#endif
dynamic, self-adjusting array of float
a simple class to control print indentation
Definition: vtkIndent.h:113
abstract base class for most VTK objects
Definition: vtkObject.h:73
OpenGL rendering window.
A communicator that can safely be used inside a painter.
Representation of a cartesian pixel plane and common operations on it.
This class decomposes the image space and shuffles image space data onto the new decomposition with t...
const vtkPixelExtent & GetCompositeExtent(int i=0) const
Get the extent of the domain over which to compute the LIC.
void PrintSelf(ostream &os, vtkIndent indent) override
Methods invoked by print to print information about the object including superclasses.
float GetFudgeFactor(int nx[2])
factor for determining extra padding for guard pixels.
void GetPixelBounds(float *rgba, int ni, vtkPixelExtent &ext)
shrink pixel extent based on non-zero alpha channel values
virtual void SetContext(vtkOpenGLRenderWindow *)
Set the rendering context.
~vtkSurfaceLICComposite() override
float VectorMax(const vtkPixelExtent &ext, float *vectors)
Compute max(V) on the given extent.
const vtkPixelExtent & GetDisjointGuardExtent(int i=0) const
Get the extent of the domain over which to compute the LIC.
std::deque< vtkPixelExtent > BlockExts
virtual void RestoreDefaultCommunicator()
Set the communicator to the default communicator.
const std::deque< vtkPixelExtent > & GetCompositeExtents() const
int MakeDecompDisjoint(const std::deque< vtkPixelExtent > &in, std::deque< vtkPixelExtent > &out, float *vectors)
For serial run.
const vtkPixelExtent & GetDataSetExtent() const
Get the whole dataset extent (all blocks).
std::deque< vtkPixelExtent > DisjointGuardExt
int AddGuardPixels(const std::deque< vtkPixelExtent > &exts, std::deque< vtkPixelExtent > &guardExts, std::deque< vtkPixelExtent > &disjointGuardExts, float *vectors)
Add guard pixels (Serial run)
int GetNumberOfCompositeExtents() const
Get the number of new extents assigned to this rank after the decomposition.
const vtkPixelExtent & GetGuardExtent(int i=0) const
Get the extent of the domain over which to compute the LIC.
virtual vtkOpenGLRenderWindow * GetContext()
const vtkPixelExtent & GetWindowExtent() const
Get the whole window extent.
friend ostream & operator<<(ostream &os, vtkSurfaceLICComposite &ss)
virtual int Gather(void *, int, int, vtkTextureObject *&)
Move a single buffer from the geometry decomp to the LIC decomp.
int VectorMax(const std::deque< vtkPixelExtent > &exts, float *vectors, std::vector< float > &vMax)
Compute max(V) on a set of extents.
static int MakeDecompDisjoint(std::deque< vtkPixelExtent > &in, std::deque< vtkPixelExtent > &out)
Make a decomposition disjoint with respect to itself.
const std::deque< vtkPixelExtent > & GetDisjointGuardExtents() const
int InitializeCompositeExtents(float *vectors)
Set up for a serial run, makes the decomp disjoint and adds requisite guard pixles.
virtual void SetCommunicator(vtkPainterCommunicator *)
Set the communicator for parallel communication.
std::deque< vtkPixelExtent > CompositeExt
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.
void Initialize(const vtkPixelExtent &winExt, const std::deque< vtkPixelExtent > &blockExts, int strategy, double stepSize, int nSteps, int normalizeVectors, int enhancedLIC, int anitalias)
Initialize the object based on the following description of the blocks projected onto the render wind...
static vtkSurfaceLICComposite * New()
const std::deque< vtkPixelExtent > & GetGuardExtents() const
std::deque< vtkPixelExtent > GuardExt
abstracts an OpenGL texture object.
ostream & operator<<(ostream &os, vtkSurfaceLICComposite &ss)