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 "vtkRenderingLICModule.h" // for export macro
98 #include <deque> // for deque
99 
100 class vtkRenderWindow;
101 class vtkTextureObject;
102 class vtkPixelExtent;
103 class vtkShaderProgram2;
106 
107 class VTKRENDERINGLIC_EXPORT vtkLineIntegralConvolution2D : public vtkObject
108 {
109 public:
112  void PrintSelf(ostream & os, vtkIndent indent);
113 
117  static bool IsSupported(vtkRenderWindow * renWin);
118 
120 
124  void SetContext(vtkRenderWindow *context);
127 
129 
134  vtkSetClampMacro(EnhancedLIC, int, 0, 1);
135  vtkGetMacro(EnhancedLIC, int);
136  vtkBooleanMacro(EnhancedLIC, int);
138 
140 
161  enum {
162  ENHANCE_CONTRAST_OFF=0,
163  ENHANCE_CONTRAST_ON=1};
164  vtkSetClampMacro(EnhanceContrast, int, 0, 2);
165  vtkGetMacro(EnhanceContrast, int);
166  vtkBooleanMacro(EnhanceContrast, int);
168 
170 
187  vtkSetClampMacro(LowContrastEnhancementFactor, double, 0.0, 1.0);
188  vtkGetMacro(LowContrastEnhancementFactor, double);
189  vtkSetClampMacro(HighContrastEnhancementFactor, double, 0.0, 1.0);
190  vtkGetMacro(HighContrastEnhancementFactor, double);
192 
194 
200  vtkSetClampMacro(AntiAlias, int, 0, VTK_INT_MAX);
201  vtkGetMacro(AntiAlias, int);
202  vtkBooleanMacro(AntiAlias, int);
204 
206 
210  vtkSetClampMacro(NumberOfSteps, int, 0, VTK_INT_MAX);
211  vtkGetMacro(NumberOfSteps, int);
213 
215 
222  vtkSetClampMacro(StepSize, double, 0.0, VTK_FLOAT_MAX);
223  vtkGetMacro(StepSize, double);
225 
227 
232  void SetComponentIds(int c0, int c1);
233  void SetComponentIds(int c[2]){ this->SetComponentIds(c[0], c[1]); }
234  vtkGetVector2Macro(ComponentIds, int);
236 
238 
243  vtkSetClampMacro(MaxNoiseValue, double, 0.0, 1.0);
244  vtkGetMacro(MaxNoiseValue, double);
246 
248 
254  void SetTransformVectors(int val);
255  vtkGetMacro(TransformVectors, int);
257 
279  void SetNormalizeVectors(int val);
280  vtkGetMacro(NormalizeVectors, int);
282 
284 
293  vtkSetClampMacro(MaskThreshold, double, -1.0, VTK_FLOAT_MAX);
294  vtkGetMacro(MaskThreshold, double);
296 
297 
302  vtkTextureObject *vectorTex,
303  vtkTextureObject *noiseTex);
304 
310  const int extent[4],
311  vtkTextureObject *vectorTex,
312  vtkTextureObject *noiseTex);
313 
326  const vtkPixelExtent &inputTexExtent,
327  const std::deque<vtkPixelExtent> &vectorExtent,
328  const std::deque<vtkPixelExtent> &licExtent,
329  vtkTextureObject *vectorTex,
330  vtkTextureObject *maskVectorTex,
331  vtkTextureObject *noiseTex);
332 
337  static
339 
340  static
342 
352 
357  virtual void GetGlobalMinMax(
359  float&,
360  float&) {}
361 
368  virtual void WriteTimerLog(const char *){}
369 
370 protected:
373 
382 
383  void BuildShaders();
384 
386  float computeBounds[4],
387  vtkPixelExtent computeExtent);
388 
389  vtkTextureObject *AllocateBuffer(unsigned int texSize[2]);
390 
396 
403  virtual void StartTimerEvent(const char *){}
404  virtual void EndTimerEvent(const char *){}
405 
406 protected:
408 
411 
421 
423  double StepSize;
433  int ComponentIds[2];
435 
436 private:
437  vtkLineIntegralConvolution2D(const vtkLineIntegralConvolution2D &) VTK_DELETE_FUNCTION;
438  void operator = (const vtkLineIntegralConvolution2D &) VTK_DELETE_FUNCTION;
439 };
440 
441 #endif
vtkLineIntegralConvolution2D::SetVectorTexParameters
static void SetVectorTexParameters(vtkTextureObject *vectors)
Convenience functions to ensure that the input textures are configured correctly.
vtkLineIntegralConvolution2D::GetCommunicator
virtual vtkPainterCommunicator * GetCommunicator()
VTK_INT_MAX
#define VTK_INT_MAX
Definition: vtkType.h:153
vtkLineIntegralConvolution2D::CEShader
vtkShaderProgram2 * CEShader
Definition: vtkLineIntegralConvolution2D.h:418
vtkLineIntegralConvolution2D::EndTimerEvent
virtual void EndTimerEvent(const char *)
Definition: vtkLineIntegralConvolution2D.h:404
vtkLineIntegralConvolution2D::Execute
vtkTextureObject * Execute(vtkTextureObject *vectorTex, vtkTextureObject *noiseTex)
Compute the lic on the entire vector field texture.
vtkLineIntegralConvolution2D::SetCEShader
void SetCEShader(vtkShaderProgram2 *prog)
vtkLineIntegralConvolution2D::SetLICIShader
void SetLICIShader(vtkShaderProgram2 *prog)
vtkLineIntegralConvolution2D::SetAAVShader
void SetAAVShader(vtkShaderProgram2 *prog)
vtkLineIntegralConvolution2D::SetEEShader
void SetEEShader(vtkShaderProgram2 *prog)
vtkLineIntegralConvolution2D::SetNoise2TexParameters
void SetNoise2TexParameters(vtkTextureObject *noise)
Convenience functions to ensure that the input textures are configured correctly.
vtkLineIntegralConvolution2D::Execute
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.
vtkObject
abstract base class for most VTK objects
Definition: vtkObject.h:60
vtkLineIntegralConvolution2D::StepSize
double StepSize
Definition: vtkLineIntegralConvolution2D.h:423
vtkLineIntegralConvolution2D::NoiseTextureLookupCompatibilityMode
int NoiseTextureLookupCompatibilityMode
Definition: vtkLineIntegralConvolution2D.h:429
vtkLineIntegralConvolution2D::Context
vtkWeakPointer< vtkRenderWindow > Context
Definition: vtkLineIntegralConvolution2D.h:409
vtkLineIntegralConvolution2D::NormalizeVectors
int NormalizeVectors
Definition: vtkLineIntegralConvolution2D.h:432
vtkLineIntegralConvolution2D::SetComponentIds
void SetComponentIds(int c[2])
Definition: vtkLineIntegralConvolution2D.h:233
vtkLineIntegralConvolution2D::vtkLineIntegralConvolution2D
vtkLineIntegralConvolution2D()
vtkLineIntegralConvolution2D::SetContext
void SetContext(vtkRenderWindow *context)
Set/Get the rendering context.
vtkLineIntegralConvolution2D::HighContrastEnhancementFactor
double HighContrastEnhancementFactor
Definition: vtkLineIntegralConvolution2D.h:427
vtkLineIntegralConvolution2D::SetVTShader
void SetVTShader(vtkShaderProgram2 *prog)
vtkLineIntegralConvolution2D::SetLIC0Shader
void SetLIC0Shader(vtkShaderProgram2 *prog)
vtkLineIntegralConvolution2D::StartTimerEvent
virtual void StartTimerEvent(const char *)
Methods used for parallel benchmarks.
Definition: vtkLineIntegralConvolution2D.h:403
vtkPixelExtent
Representation of a cartesian pixel plane and common operations on it.
Definition: vtkPixelExtent.h:42
vtkLineIntegralConvolution2D::Execute
vtkTextureObject * Execute(const int extent[4], vtkTextureObject *vectorTex, vtkTextureObject *noiseTex)
Compute the lic on the indicated subset of the vector field texture.
vtkLineIntegralConvolution2D::AAHShader
vtkShaderProgram2 * AAHShader
Definition: vtkLineIntegralConvolution2D.h:419
vtkLineIntegralConvolution2D::SetNormalizeVectors
void SetNormalizeVectors(int val)
Set/Get the spacing in each dimension of the plane on which the vector field is defined.
vtkLineIntegralConvolution2D::AAVShader
vtkShaderProgram2 * AAVShader
Definition: vtkLineIntegralConvolution2D.h:420
vtkLineIntegralConvolution2D::BuildShaders
void BuildShaders()
vtkLineIntegralConvolution2D::GetContext
vtkRenderWindow * GetContext()
vtkLineIntegralConvolution2D::SetLICNShader
void SetLICNShader(vtkShaderProgram2 *prog)
vtkIndent
a simple class to control print indentation
Definition: vtkIndent.h:40
vtkTextureObject
abstracts an OpenGL texture object.
Definition: vtkTextureObject.h:44
vtkLineIntegralConvolution2D::ShadersNeedBuild
int ShadersNeedBuild
Definition: vtkLineIntegralConvolution2D.h:412
vtkLineIntegralConvolution2D::EnhancedLIC
int EnhancedLIC
Definition: vtkLineIntegralConvolution2D.h:424
vtkLineIntegralConvolution2D::MaskThreshold
double MaskThreshold
Definition: vtkLineIntegralConvolution2D.h:430
vtkLineIntegralConvolution2D::SetComponentIds
void SetComponentIds(int c0, int c1)
If VectorField has >= 3 components, we must choose which 2 components form the (X,...
vtkLineIntegralConvolution2D::SetTransformVectors
void SetTransformVectors(int val)
This class performs LIC in the normalized image space.
vtkWeakPointer.h
VTK_FLOAT_MAX
#define VTK_FLOAT_MAX
Definition: vtkType.h:161
vtkLineIntegralConvolution2D::EnhanceContrast
int EnhanceContrast
Definition: vtkLineIntegralConvolution2D.h:425
vtkLineIntegralConvolution2D::LowContrastEnhancementFactor
double LowContrastEnhancementFactor
Definition: vtkLineIntegralConvolution2D.h:426
vtkObject.h
vtkLineIntegralConvolution2D::LICNShader
vtkShaderProgram2 * LICNShader
Definition: vtkLineIntegralConvolution2D.h:416
vtkBooleanMacro
vtkBooleanMacro(IgnoreDriverBugs, bool)
Updates the extensions string.
vtkLineIntegralConvolution2D::EEShader
vtkShaderProgram2 * EEShader
Definition: vtkLineIntegralConvolution2D.h:417
vtkPainterCommunicator
A communicator that can safely be used inside a painter.
Definition: vtkPainterCommunicator.h:31
vtkLineIntegralConvolution2D
GPU-based implementation of Line Integral Convolution (LIC)
Definition: vtkLineIntegralConvolution2D.h:108
vtkLineIntegralConvolution2D::~vtkLineIntegralConvolution2D
virtual ~vtkLineIntegralConvolution2D()
vtkShaderProgram2
GLSL Program.
Definition: vtkShaderProgram2.h:69
vtkLineIntegralConvolution2D::LICIShader
vtkShaderProgram2 * LICIShader
Definition: vtkLineIntegralConvolution2D.h:415
vtkLineIntegralConvolution2D::AllocateBuffer
vtkTextureObject * AllocateBuffer(unsigned int texSize[2])
vtkLineIntegralConvolution2D::TransformVectors
int TransformVectors
Definition: vtkLineIntegralConvolution2D.h:431
vtkLineIntegralConvolution2D::PrintSelf
void PrintSelf(ostream &os, vtkIndent indent)
Methods invoked by print to print information about the object including superclasses.
vtkLineIntegralConvolution2D::IsSupported
static bool IsSupported(vtkRenderWindow *renWin)
Returns if the context supports the required extensions.
vtkX3D::extent
@ extent
Definition: vtkX3D.h:345
vtkLineIntegralConvolution2D::SetCommunicator
virtual void SetCommunicator(vtkPainterCommunicator *)
Set the communicator to use during parallel operation The communicator will not be duplicated or refe...
Definition: vtkLineIntegralConvolution2D.h:350
vtkLineIntegralConvolution2D::MaxNoiseValue
double MaxNoiseValue
Definition: vtkLineIntegralConvolution2D.h:434
vtkLineIntegralConvolution2D::New
static vtkLineIntegralConvolution2D * New()
vtkRenderWindow
create a window for renderers to draw into
Definition: vtkRenderWindow.h:87
vtkLineIntegralConvolution2D::LIC0Shader
vtkShaderProgram2 * LIC0Shader
Definition: vtkLineIntegralConvolution2D.h:414
vtkLineIntegralConvolution2D::RenderQuad
void RenderQuad(float computeBounds[4], vtkPixelExtent computeExtent)
vtkFrameBufferObject2
Interface to OpenGL framebuffer object.
Definition: vtkFrameBufferObject2.h:87
vtkLineIntegralConvolution2D::WriteTimerLog
virtual void WriteTimerLog(const char *)
Methods used for parallel benchmarks.
Definition: vtkLineIntegralConvolution2D.h:368
vtkLineIntegralConvolution2D::GetGlobalMinMax
virtual void GetGlobalMinMax(vtkPainterCommunicator *, float &, float &)
For parallel operation, find global min/max min/max are in/out.
Definition: vtkLineIntegralConvolution2D.h:357
vtkWeakPointer< vtkRenderWindow >
vtkLineIntegralConvolution2D::SetNoiseTexParameters
static void SetNoiseTexParameters(vtkTextureObject *noise)
vtkLineIntegralConvolution2D::FBO
vtkFrameBufferObject2 * FBO
Definition: vtkLineIntegralConvolution2D.h:410
vtkLineIntegralConvolution2D::SetAAHShader
void SetAAHShader(vtkShaderProgram2 *prog)
vtkLineIntegralConvolution2D::AntiAlias
int AntiAlias
Definition: vtkLineIntegralConvolution2D.h:428
vtkLineIntegralConvolution2D::VTShader
vtkShaderProgram2 * VTShader
Definition: vtkLineIntegralConvolution2D.h:413
vtkLineIntegralConvolution2D::NumberOfSteps
int NumberOfSteps
Definition: vtkLineIntegralConvolution2D.h:422
vtkLineIntegralConvolution2D::Comm
vtkPainterCommunicator * Comm
Definition: vtkLineIntegralConvolution2D.h:407