VTK
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 "vtkWeakPointer.h" // for ren context
97#include "vtkRenderingLICOpenGL2Module.h" // for export macro
98#include <deque> // for deque
99
101class vtkOpenGLHelper;
104class vtkPixelExtent;
105class vtkRenderWindow;
106class vtkShaderProgram;
107class vtkTextureObject;
108
109class VTKRENDERINGLICOPENGL2_EXPORT vtkLineIntegralConvolution2D : public vtkObject
110{
111public:
114 void PrintSelf(ostream & os, vtkIndent indent);
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 ENHANCE_CONTRAST_OFF=0,
165 ENHANCE_CONTRAST_ON=1};
166 vtkSetClampMacro(EnhanceContrast, int, 0, 2);
167 vtkGetMacro(EnhanceContrast, int);
168 vtkBooleanMacro(EnhanceContrast, int);
170
172
189 vtkSetClampMacro(LowContrastEnhancementFactor, double, 0.0, 1.0);
190 vtkGetMacro(LowContrastEnhancementFactor, double);
191 vtkSetClampMacro(HighContrastEnhancementFactor, double, 0.0, 1.0);
192 vtkGetMacro(HighContrastEnhancementFactor, double);
194
196
202 vtkSetClampMacro(AntiAlias, int, 0, VTK_INT_MAX);
203 vtkGetMacro(AntiAlias, int);
204 vtkBooleanMacro(AntiAlias, int);
206
208
212 vtkSetClampMacro(NumberOfSteps, int, 0, VTK_INT_MAX);
213 vtkGetMacro(NumberOfSteps, int);
215
217
224 vtkSetClampMacro(StepSize, double, 0.0, VTK_FLOAT_MAX);
225 vtkGetMacro(StepSize, double);
227
229
234 void SetComponentIds(int c0, int c1);
235 void SetComponentIds(int c[2]){ this->SetComponentIds(c[0], c[1]); }
236 vtkGetVector2Macro(ComponentIds, int);
238
240
245 vtkSetClampMacro(MaxNoiseValue, double, 0.0, 1.0);
246 vtkGetMacro(MaxNoiseValue, double);
248
250
256 void SetTransformVectors(int val);
257 vtkGetMacro(TransformVectors, int);
259
281 void SetNormalizeVectors(int val);
282 vtkGetMacro(NormalizeVectors, int);
284
286
295 vtkSetClampMacro(MaskThreshold, double, -1.0, VTK_FLOAT_MAX);
296 vtkGetMacro(MaskThreshold, double);
298
299
304 vtkTextureObject *vectorTex,
305 vtkTextureObject *noiseTex);
306
312 const int extent[4],
313 vtkTextureObject *vectorTex,
314 vtkTextureObject *noiseTex);
315
328 const vtkPixelExtent &inputTexExtent,
329 const std::deque<vtkPixelExtent> &vectorExtent,
330 const std::deque<vtkPixelExtent> &licExtent,
331 vtkTextureObject *vectorTex,
332 vtkTextureObject *maskVectorTex,
333 vtkTextureObject *noiseTex);
334
339 static
341
342 static
344
354
359 virtual void GetGlobalMinMax(
361 float&,
362 float&) {}
363
370 virtual void WriteTimerLog(const char *){}
371
372protected:
375
377
386
388
390 float computeBounds[4],
391 vtkPixelExtent computeExtent);
392
393 vtkTextureObject *AllocateBuffer(unsigned int texSize[2]);
394
400
407 virtual void StartTimerEvent(const char *){}
408 virtual void EndTimerEvent(const char *){}
409
410protected:
413
414 int ShadersNeedBuild;
425
426 int NumberOfSteps;
427 double StepSize;
428 int EnhancedLIC;
429 int EnhanceContrast;
430 double LowContrastEnhancementFactor;
431 double HighContrastEnhancementFactor;
432 int AntiAlias;
433 int NoiseTextureLookupCompatibilityMode;
434 double MaskThreshold;
435 int TransformVectors;
436 int NormalizeVectors;
437 int ComponentIds[2];
438 double MaxNoiseValue;
439
440private:
442 void operator = (const vtkLineIntegralConvolution2D &) VTK_DELETE_FUNCTION;
443};
444
445#endif
Interface to OpenGL framebuffer object.
a simple class to control print indentation
Definition: vtkIndent.h:40
GPU-based implementation of Line Integral Convolution (LIC)
vtkWeakPointer< vtkOpenGLRenderWindow > Context
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.
void SetAAHShader(vtkShaderProgram *prog)
vtkTextureObject * AllocateBuffer(unsigned int texSize[2])
virtual void WriteTimerLog(const char *)
Methods used for parallel benchmarks.
void SetLIC0Shader(vtkShaderProgram *prog)
void PrintSelf(ostream &os, vtkIndent indent)
Methods invoked by print to print information about the object including superclasses.
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 vtkPainterCommunicator * GetCommunicator()
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.
static vtkLineIntegralConvolution2D * New()
virtual void EndTimerEvent(const char *)
void SetAAVShader(vtkShaderProgram *prog)
vtkTextureObject * Execute(vtkTextureObject *vectorTex, vtkTextureObject *noiseTex)
Compute the lic on the entire vector field texture.
vtkTextureObject * Execute(const int extent[4], vtkTextureObject *vectorTex, vtkTextureObject *noiseTex)
Compute the lic on the indicated subset of the vector field texture.
void SetTransformVectors(int val)
This class performs LIC in the normalized image space.
vtkOpenGLRenderWindow * GetContext()
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)
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:60
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:345
vtkBooleanMacro(IgnoreDriverBugs, bool)
Updates the extensions string.
#define VTK_INT_MAX
Definition: vtkType.h:153
#define VTK_FLOAT_MAX
Definition: vtkType.h:161