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 =========================================================================*/
91 #ifndef vtkLineIntegralConvolution2D_h
92 #define vtkLineIntegralConvolution2D_h
93 
94 #include "vtkObject.h"
95 #include "vtkWeakPointer.h" // for ren context
96 #include "vtkRenderingLICOpenGL2Module.h" // for export macro
97 #include <deque> // for deque
98 
100 class vtkOpenGLHelper;
103 class vtkPixelExtent;
104 class vtkRenderWindow;
105 class vtkShaderProgram;
106 class vtkTextureObject;
107 
108 class VTKRENDERINGLICOPENGL2_EXPORT vtkLineIntegralConvolution2D : public vtkObject
109 {
110 public:
113  void PrintSelf(ostream & os, vtkIndent indent);
114 
116  static bool IsSupported(vtkRenderWindow * renWin);
117 
119 
124 
126 
129  vtkSetClampMacro(EnhancedLIC, int, 0, 1);
130  vtkGetMacro(EnhancedLIC, int);
131  vtkBooleanMacro(EnhancedLIC, int);
133 
135 
148  enum {
149  ENHANCE_CONTRAST_OFF=0,
150  ENHANCE_CONTRAST_ON=1};
151  vtkSetClampMacro(EnhanceContrast, int, 0, 2);
152  vtkGetMacro(EnhanceContrast, int);
153  vtkBooleanMacro(EnhanceContrast, int);
155 
157 
170  vtkSetClampMacro(LowContrastEnhancementFactor, double, 0.0, 1.0);
171  vtkGetMacro(LowContrastEnhancementFactor, double);
172  vtkSetClampMacro(HighContrastEnhancementFactor, double, 0.0, 1.0);
173  vtkGetMacro(HighContrastEnhancementFactor, double);
175 
177 
181  vtkSetClampMacro(AntiAlias, int, 0, VTK_INT_MAX);
182  vtkGetMacro(AntiAlias, int);
183  vtkBooleanMacro(AntiAlias, int);
185 
187 
189  vtkSetClampMacro(NumberOfSteps, int, 0, VTK_INT_MAX);
190  vtkGetMacro(NumberOfSteps, int);
192 
194 
200  vtkSetClampMacro(StepSize, double, 0.0, VTK_FLOAT_MAX);
201  vtkGetMacro(StepSize, double);
203 
205 
208  void SetComponentIds(int c0, int c1);
209  void SetComponentIds(int c[2]){ this->SetComponentIds(c[0], c[1]); }
210  vtkGetVector2Macro(ComponentIds, int);
212 
214 
217  vtkSetClampMacro(MaxNoiseValue, double, 0.0, 1.0);
218  vtkGetMacro(MaxNoiseValue, double);
220 
222 
227  vtkGetMacro(TransformVectors, int);
229 
250  vtkGetMacro(NormalizeVectors, int);
252 
254 
260  vtkSetClampMacro(MaskThreshold, double, -1.0, VTK_FLOAT_MAX);
261  vtkGetMacro(MaskThreshold, double);
263 
264 
266 
268  vtkTextureObject *vectorTex,
269  vtkTextureObject *noiseTex);
271 
273 
275  const int extent[4],
276  vtkTextureObject *vectorTex,
277  vtkTextureObject *noiseTex);
279 
280  //BTX
282 
290  const vtkPixelExtent &inputTexExtent,
291  const std::deque<vtkPixelExtent> &vectorExtent,
292  const std::deque<vtkPixelExtent> &licExtent,
293  vtkTextureObject *vectorTex,
294  vtkTextureObject *maskVectorTex,
295  vtkTextureObject *noiseTex);
296  //ETX
298 
300 
302  static
305 
306  static
308 
309  //BTX
311 
318 
320 
321  virtual void GetGlobalMinMax(
323  float&,
324  float&) {}
325  //ETX
327 
332  virtual void WriteTimerLog(const char *){}
333 
334 protected:
337 
339 
348 
349  void BuildShaders();
350 
352  float computeBounds[4],
353  vtkPixelExtent computeExtent);
354 
355  vtkTextureObject *AllocateBuffer(unsigned int texSize[2]);
356 
360 
362 
366  virtual void StartTimerEvent(const char *){}
367  virtual void EndTimerEvent(const char *){}
369 
370 protected:
373 
374  int ShadersNeedBuild;
385 
386  int NumberOfSteps;
387  double StepSize;
388  int EnhancedLIC;
389  int EnhanceContrast;
390  double LowContrastEnhancementFactor;
391  double HighContrastEnhancementFactor;
392  int AntiAlias;
393  int NoiseTextureLookupCompatibilityMode;
394  double MaskThreshold;
395  int TransformVectors;
396  int NormalizeVectors;
397  int ComponentIds[2];
398  double MaxNoiseValue;
399 
400 private:
401  vtkLineIntegralConvolution2D(const vtkLineIntegralConvolution2D &); // Not implemented.
402  void operator = (const vtkLineIntegralConvolution2D &); // Not implemented.
403 };
404 
405 #endif
vtkLineIntegralConvolution2D::SetVectorTexParameters
static void SetVectorTexParameters(vtkTextureObject *vectors)
vtkLineIntegralConvolution2D::LICNShader
vtkOpenGLHelper * LICNShader
Definition: vtkLineIntegralConvolution2D.h:380
vtkLineIntegralConvolution2D::GetCommunicator
virtual vtkPainterCommunicator * GetCommunicator()
VTK_INT_MAX
#define VTK_INT_MAX
Definition: vtkType.h:132
vtkLineIntegralConvolution2D::FinalBlendProgram
vtkOpenGLHelper * FinalBlendProgram
Definition: vtkLineIntegralConvolution2D.h:375
vtkLineIntegralConvolution2D::LIC0Shader
vtkOpenGLHelper * LIC0Shader
Definition: vtkLineIntegralConvolution2D.h:378
vtkLineIntegralConvolution2D::EndTimerEvent
virtual void EndTimerEvent(const char *)
Definition: vtkLineIntegralConvolution2D.h:367
vtkGetVector2Macro
#define vtkGetVector2Macro(name, type)
Definition: vtkSetGet.h:270
vtkLineIntegralConvolution2D::Execute
vtkTextureObject * Execute(vtkTextureObject *vectorTex, vtkTextureObject *noiseTex)
vtkLineIntegralConvolution2D::SetNoise2TexParameters
void SetNoise2TexParameters(vtkTextureObject *noise)
vtkTypeMacro
#define vtkTypeMacro(thisClass, superclass)
Definition: vtkSetGet.h:642
vtkLineIntegralConvolution2D::Execute
vtkTextureObject * Execute(const vtkPixelExtent &inputTexExtent, const std::deque< vtkPixelExtent > &vectorExtent, const std::deque< vtkPixelExtent > &licExtent, vtkTextureObject *vectorTex, vtkTextureObject *maskVectorTex, vtkTextureObject *noiseTex)
vtkObject
abstract base class for most VTK objects
Definition: vtkObject.h:62
vtkLineIntegralConvolution2D::SetComponentIds
void SetComponentIds(int c[2])
Definition: vtkLineIntegralConvolution2D.h:209
vtkLineIntegralConvolution2D::vtkLineIntegralConvolution2D
vtkLineIntegralConvolution2D()
vtkLineIntegralConvolution2D::StartTimerEvent
virtual void StartTimerEvent(const char *)
Definition: vtkLineIntegralConvolution2D.h:366
vtkLineIntegralConvolution2D::SetEEShader
void SetEEShader(vtkShaderProgram *prog)
vtkLineIntegralConvolution2D::SetVTShader
void SetVTShader(vtkShaderProgram *prog)
vtkPixelExtent
Definition: vtkPixelExtent.h:41
vtkLineIntegralConvolution2D::Execute
vtkTextureObject * Execute(const int extent[4], vtkTextureObject *vectorTex, vtkTextureObject *noiseTex)
vtkgl::val
GLuint GLfloat * val
Definition: vtkgl.h:13789
vtkLineIntegralConvolution2D::SetNormalizeVectors
void SetNormalizeVectors(int val)
vtkSetClampMacro
#define vtkSetClampMacro(name, type, min, max)
Definition: vtkSetGet.h:143
vtkgl::c
const GLubyte * c
Definition: vtkgl.h:15720
vtkLineIntegralConvolution2D::Context
vtkWeakPointer< vtkOpenGLRenderWindow > Context
Definition: vtkLineIntegralConvolution2D.h:371
vtkLineIntegralConvolution2D::BuildShaders
void BuildShaders()
vtkShaderProgram
The ShaderProgram uses one or more Shader objects.
Definition: vtkShaderProgram.h:43
vtkOpenGLHelper
Definition: vtkOpenGLHelper.h:31
vtkIndent
a simple class to control print indentation
Definition: vtkIndent.h:39
vtkTextureObject
abstracts an OpenGL texture object.
Definition: vtkTextureObject.h:40
vtkLineIntegralConvolution2D::SetLICNShader
void SetLICNShader(vtkShaderProgram *prog)
vtkLineIntegralConvolution2D::SetComponentIds
void SetComponentIds(int c0, int c1)
vtkLineIntegralConvolution2D::SetAAVShader
void SetAAVShader(vtkShaderProgram *prog)
vtkLineIntegralConvolution2D::SetTransformVectors
void SetTransformVectors(int val)
vtkWeakPointer.h
VTK_FLOAT_MAX
#define VTK_FLOAT_MAX
Definition: vtkType.h:140
vtkGetMacro
#define vtkGetMacro(name, type)
Definition: vtkSetGet.h:93
vtkLineIntegralConvolution2D::SetContext
void SetContext(vtkOpenGLRenderWindow *context)
vtkLineIntegralConvolution2D::SetLIC0Shader
void SetLIC0Shader(vtkShaderProgram *prog)
vtkLineIntegralConvolution2D::GetContext
vtkOpenGLRenderWindow * GetContext()
vtkObject.h
vtkBooleanMacro
vtkBooleanMacro(IgnoreDriverBugs, bool)
vtkLineIntegralConvolution2D::SetCEShader
void SetCEShader(vtkShaderProgram *prog)
vtkPainterCommunicator
Definition: vtkPainterCommunicator.h:32
vtkLineIntegralConvolution2D::EEShader
vtkOpenGLHelper * EEShader
Definition: vtkLineIntegralConvolution2D.h:381
vtkLineIntegralConvolution2D::AAVShader
vtkOpenGLHelper * AAVShader
Definition: vtkLineIntegralConvolution2D.h:384
vtkLineIntegralConvolution2D
GPU-based implementation of Line Integral Convolution (LIC)
Definition: vtkLineIntegralConvolution2D.h:107
vtkLineIntegralConvolution2D::~vtkLineIntegralConvolution2D
virtual ~vtkLineIntegralConvolution2D()
vtkLineIntegralConvolution2D::SetAAHShader
void SetAAHShader(vtkShaderProgram *prog)
vtkLineIntegralConvolution2D::AllocateBuffer
vtkTextureObject * AllocateBuffer(unsigned int texSize[2])
vtkLineIntegralConvolution2D::IntermediateBlendProgram
vtkOpenGLHelper * IntermediateBlendProgram
Definition: vtkLineIntegralConvolution2D.h:376
vtkLineIntegralConvolution2D::LICIShader
vtkOpenGLHelper * LICIShader
Definition: vtkLineIntegralConvolution2D.h:379
vtkLineIntegralConvolution2D::PrintSelf
void PrintSelf(ostream &os, vtkIndent indent)
vtkLineIntegralConvolution2D::SetLICIShader
void SetLICIShader(vtkShaderProgram *prog)
vtkLineIntegralConvolution2D::IsSupported
static bool IsSupported(vtkRenderWindow *renWin)
vtkOpenGLRenderWindow
OpenGL rendering window.
Definition: vtkOpenGLRenderWindow.h:41
vtkX3D::extent
@ extent
Definition: vtkX3D.h:345
vtkLineIntegralConvolution2D::SetCommunicator
virtual void SetCommunicator(vtkPainterCommunicator *)
Definition: vtkLineIntegralConvolution2D.h:315
vtkLineIntegralConvolution2D::New
static vtkLineIntegralConvolution2D * New()
vtkRenderWindow
create a window for renderers to draw into
Definition: vtkRenderWindow.h:89
vtkLineIntegralConvolution2D::RenderQuad
void RenderQuad(float computeBounds[4], vtkPixelExtent computeExtent)
vtkFrameBufferObject2
Interface to OpenGL framebuffer object.
Definition: vtkFrameBufferObject2.h:86
vtkLineIntegralConvolution2D::CEShader
vtkOpenGLHelper * CEShader
Definition: vtkLineIntegralConvolution2D.h:382
vtkLineIntegralConvolution2D::WriteTimerLog
virtual void WriteTimerLog(const char *)
Definition: vtkLineIntegralConvolution2D.h:332
vtkLineIntegralConvolution2D::GetGlobalMinMax
virtual void GetGlobalMinMax(vtkPainterCommunicator *, float &, float &)
Definition: vtkLineIntegralConvolution2D.h:321
vtkLineIntegralConvolution2D::VTShader
vtkOpenGLHelper * VTShader
Definition: vtkLineIntegralConvolution2D.h:377
vtkWeakPointer< vtkOpenGLRenderWindow >
vtkLineIntegralConvolution2D::SetNoiseTexParameters
static void SetNoiseTexParameters(vtkTextureObject *noise)
vtkLineIntegralConvolution2D::AAHShader
vtkOpenGLHelper * AAHShader
Definition: vtkLineIntegralConvolution2D.h:383