VTK  9.0.1
vtkLineIntegralConvolution2D.h
Go to the documentation of this file.
1 /*=========================================================================
2 
3  Program: Visualization Toolkit
4  Module: vtkLineIntegralConvolution2D.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 =========================================================================*/
92 #ifndef vtkLineIntegralConvolution2D_h
93 #define vtkLineIntegralConvolution2D_h
94 
95 #include "vtkObject.h"
96 #include "vtkRenderingLICOpenGL2Module.h" // for export macro
97 #include "vtkWeakPointer.h" // for ren context
98 #include <deque> // for deque
99 
101 class vtkOpenGLHelper;
104 class vtkPixelExtent;
105 class vtkRenderWindow;
106 class vtkShaderProgram;
107 class vtkTextureObject;
108 
109 class VTKRENDERINGLICOPENGL2_EXPORT vtkLineIntegralConvolution2D : public vtkObject
110 {
111 public:
114  void PrintSelf(ostream& os, vtkIndent indent) override;
115 
119  static bool IsSupported(vtkRenderWindow* renWin);
120 
122 
129 
131 
136  vtkSetClampMacro(EnhancedLIC, int, 0, 1);
137  vtkGetMacro(EnhancedLIC, int);
138  vtkBooleanMacro(EnhancedLIC, int);
140 
142 
163  enum
164  {
165  ENHANCE_CONTRAST_OFF = 0,
166  ENHANCE_CONTRAST_ON = 1
167  };
168  vtkSetClampMacro(EnhanceContrast, int, 0, 2);
169  vtkGetMacro(EnhanceContrast, int);
170  vtkBooleanMacro(EnhanceContrast, int);
172 
174 
191  vtkSetClampMacro(LowContrastEnhancementFactor, double, 0.0, 1.0);
192  vtkGetMacro(LowContrastEnhancementFactor, double);
193  vtkSetClampMacro(HighContrastEnhancementFactor, double, 0.0, 1.0);
194  vtkGetMacro(HighContrastEnhancementFactor, double);
196 
198 
204  vtkSetClampMacro(AntiAlias, int, 0, VTK_INT_MAX);
205  vtkGetMacro(AntiAlias, int);
206  vtkBooleanMacro(AntiAlias, int);
208 
210 
214  vtkSetClampMacro(NumberOfSteps, int, 0, VTK_INT_MAX);
215  vtkGetMacro(NumberOfSteps, int);
217 
219 
226  vtkSetClampMacro(StepSize, double, 0.0, VTK_FLOAT_MAX);
227  vtkGetMacro(StepSize, double);
229 
231 
236  void SetComponentIds(int c0, int c1);
237  void SetComponentIds(int c[2]) { this->SetComponentIds(c[0], c[1]); }
238  vtkGetVector2Macro(ComponentIds, int);
240 
242 
247  vtkSetClampMacro(MaxNoiseValue, double, 0.0, 1.0);
248  vtkGetMacro(MaxNoiseValue, double);
250 
252 
258  void SetTransformVectors(int val);
259  vtkGetMacro(TransformVectors, int);
261 
283  void SetNormalizeVectors(int val);
284  vtkGetMacro(NormalizeVectors, int);
286 
288 
297  vtkSetClampMacro(MaskThreshold, double, -1.0, VTK_FLOAT_MAX);
298  vtkGetMacro(MaskThreshold, double);
300 
305 
311  const int extent[4], vtkTextureObject* vectorTex, vtkTextureObject* noiseTex);
312 
324  vtkTextureObject* Execute(const vtkPixelExtent& inputTexExtent,
325  const std::deque<vtkPixelExtent>& vectorExtent, const std::deque<vtkPixelExtent>& licExtent,
326  vtkTextureObject* vectorTex, vtkTextureObject* maskVectorTex, vtkTextureObject* noiseTex);
327 
333 
335 
345 
350  virtual void GetGlobalMinMax(vtkPainterCommunicator*, float&, float&) {}
351 
358  virtual void WriteTimerLog(const char*) {}
359 
360 protected:
363 
365 
374 
375  void BuildShaders();
376 
377  void RenderQuad(float computeBounds[4], vtkPixelExtent computeExtent);
378 
379  vtkTextureObject* AllocateBuffer(unsigned int texSize[2]);
380 
386 
393  virtual void StartTimerEvent(const char*) {}
394  virtual void EndTimerEvent(const char*) {}
395 
396 protected:
399 
411 
413  double StepSize;
423  int ComponentIds[2];
425 
426 private:
428  void operator=(const vtkLineIntegralConvolution2D&) = delete;
429 };
430 
431 #endif
a simple class to control print indentation
Definition: vtkIndent.h:34
GPU-based implementation of Line Integral Convolution (LIC)
vtkWeakPointer< vtkOpenGLRenderWindow > Context
void SetAAHShader(vtkShaderProgram *prog)
static vtkLineIntegralConvolution2D * New()
vtkTextureObject * Execute(const vtkPixelExtent &inputTexExtent, const std::deque< vtkPixelExtent > &vectorExtent, const std::deque< vtkPixelExtent > &licExtent, vtkTextureObject *vectorTex, vtkTextureObject *maskVectorTex, vtkTextureObject *noiseTex)
Compute LIC over the desired subset of the input texture.
virtual void WriteTimerLog(const char *)
Methods used for parallel benchmarks.
void SetLIC0Shader(vtkShaderProgram *prog)
~vtkLineIntegralConvolution2D() override
virtual vtkPainterCommunicator * GetCommunicator()
static void SetVectorTexParameters(vtkTextureObject *vectors)
Convenience functions to ensure that the input textures are configured correctly.
void SetCEShader(vtkShaderProgram *prog)
void SetLICNShader(vtkShaderProgram *prog)
void SetContext(vtkOpenGLRenderWindow *context)
Set/Get the rendering context.
void SetNoise2TexParameters(vtkTextureObject *noise)
Convenience functions to ensure that the input textures are configured correctly.
void SetComponentIds(int c0, int c1)
If VectorField has >= 3 components, we must choose which 2 components form the (X,...
virtual void GetGlobalMinMax(vtkPainterCommunicator *, float &, float &)
For parallel operation, find global min/max min/max are in/out.
virtual void StartTimerEvent(const char *)
Methods used for parallel benchmarks.
void SetVTShader(vtkShaderProgram *prog)
void RenderQuad(float computeBounds[4], vtkPixelExtent computeExtent)
static bool IsSupported(vtkRenderWindow *renWin)
Returns if the context supports the required extensions.
virtual void EndTimerEvent(const char *)
void SetAAVShader(vtkShaderProgram *prog)
vtkTextureObject * AllocateBuffer(unsigned int texSize[2])
vtkTextureObject * Execute(vtkTextureObject *vectorTex, vtkTextureObject *noiseTex)
Compute the lic on the entire vector field texture.
void PrintSelf(ostream &os, vtkIndent indent) override
Methods invoked by print to print information about the object including superclasses.
void SetTransformVectors(int val)
This class performs LIC in the normalized image space.
vtkTextureObject * Execute(const int extent[4], vtkTextureObject *vectorTex, vtkTextureObject *noiseTex)
Compute the lic on the indicated subset of the vector field texture.
virtual void SetCommunicator(vtkPainterCommunicator *)
Set the communicator to use during parallel operation The communicator will not be duplicated or refe...
static void SetNoiseTexParameters(vtkTextureObject *noise)
void SetLICIShader(vtkShaderProgram *prog)
vtkOpenGLRenderWindow * GetContext()
void SetNormalizeVectors(int val)
Set/Get the spacing in each dimension of the plane on which the vector field is defined.
void SetEEShader(vtkShaderProgram *prog)
abstract base class for most VTK objects
Definition: vtkObject.h:54
Internal class which encapsulates OpenGL FramebufferObject.
OpenGL rendering window.
A communicator that can safely be used inside a painter.
Representation of a cartesian pixel plane and common operations on it.
create a window for renderers to draw into
The ShaderProgram uses one or more Shader objects.
abstracts an OpenGL texture object.
@ extent
Definition: vtkX3D.h:351
#define VTK_INT_MAX
Definition: vtkType.h:155
#define VTK_FLOAT_MAX
Definition: vtkType.h:163