VTK
vtkSurfaceLICInterface.h
Go to the documentation of this file.
1 /*=========================================================================
2 
3  Program: Visualization Toolkit
4  Module: vtkSurfaceLICMapper.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 =========================================================================*/
59 #ifndef vtkSurfaceLICInterface_h
60 #define vtkSurfaceLICInterface_h
61 
62 #include "vtkRenderingLICOpenGL2Module.h" // For export macro
63 #include "vtkOpenGLPolyDataMapper.h"
64 
65 class vtkRenderWindow;
66 class vtkRenderer;
67 class vtkActor;
68 class vtkImageData;
69 class vtkDataObject;
70 class vtkDataArray;
73 
74 class VTKRENDERINGLICOPENGL2_EXPORT vtkSurfaceLICInterface : public vtkObject
75 {
76 public:
79  void PrintSelf(ostream& os, vtkIndent indent);
80 
82 
85  void SetNumberOfSteps(int val);
86  vtkGetMacro(NumberOfSteps, int);
88 
90 
93  void SetStepSize(double val);
94  vtkGetMacro(StepSize, double);
96 
98 
109  void SetNormalizeVectors(int val);
110  vtkBooleanMacro(NormalizeVectors, int);
111  vtkGetMacro(NormalizeVectors, int);
113 
115 
120  void SetMaskOnSurface(int val);
121  vtkBooleanMacro(MaskOnSurface, int);
122  vtkGetMacro(MaskOnSurface, int);
124 
126 
142  void SetMaskThreshold(double val);
143  vtkGetMacro(MaskThreshold, double);
145 
147 
152  void SetMaskColor(double *val);
153  void SetMaskColor(double r, double g, double b)
154  { double rgb[3]={r,g,b}; this->SetMaskColor(rgb); }
155  vtkGetVector3Macro(MaskColor, double);
157 
159 
167  void SetMaskIntensity(double val);
168  vtkGetMacro(MaskIntensity, double);
170 
172 
177  void SetEnhancedLIC(int val);
178  vtkGetMacro(EnhancedLIC, int);
179  vtkBooleanMacro(EnhancedLIC, int);
181 
183 
216  enum {
217  ENHANCE_CONTRAST_OFF=0,
218  ENHANCE_CONTRAST_LIC=1,
219  ENHANCE_CONTRAST_COLOR=3,
220  ENHANCE_CONTRAST_BOTH=4
221  };
222  void SetEnhanceContrast(int val);
223  vtkGetMacro(EnhanceContrast, int);
225 
227 
243  vtkGetMacro(LowLICContrastEnhancementFactor, double);
244  vtkGetMacro(HighLICContrastEnhancementFactor, double);
247  //
248  vtkGetMacro(LowColorContrastEnhancementFactor, double);
249  vtkGetMacro(HighColorContrastEnhancementFactor, double);
253 
255 
261  void SetAntiAlias(int val);
262  vtkBooleanMacro(AntiAlias, int);
263  vtkGetMacro(AntiAlias, int);
265 
267 
276  enum {
277  COLOR_MODE_BLEND=0,
278  COLOR_MODE_MAP
279  };
280  void SetColorMode(int val);
281  vtkGetMacro(ColorMode, int);
283 
285 
294  void SetLICIntensity(double val);
295  vtkGetMacro(LICIntensity, double);
297 
299 
306  void SetMapModeBias(double val);
307  vtkGetMacro(MapModeBias, double);
309 
311 
319 
321 
340  void SetGenerateNoiseTexture(int shouldGenerate);
341  vtkGetMacro(GenerateNoiseTexture, int);
343 
345 
350  enum {
351  NOISE_TYPE_UNIFORM=0,
352  NOISE_TYPE_GAUSSIAN=1,
353  NOISE_TYPE_PERLIN=2
354  };
355  void SetNoiseType(int type);
356  vtkGetMacro(NoiseType, int);
358 
360 
365  vtkGetMacro(NoiseTextureSize, int);
367 
369 
372  void SetNoiseGrainSize(int val);
373  vtkGetMacro(NoiseGrainSize, int);
375 
377 
383  void SetMinNoiseValue(double val);
384  void SetMaxNoiseValue(double val);
385  vtkGetMacro(MinNoiseValue, double);
386  vtkGetMacro(MaxNoiseValue, double);
388 
390 
394  void SetNumberOfNoiseLevels(int val);
395  vtkGetMacro(NumberOfNoiseLevels, int);
397 
399 
403  void SetImpulseNoiseProbability(double val);
404  vtkGetMacro(ImpulseNoiseProbability, double);
406 
408 
412  vtkGetMacro(ImpulseNoiseBackgroundValue, double);
414 
416 
419  void SetNoiseGeneratorSeed(int val);
420  vtkGetMacro(NoiseGeneratorSeed, int);
422 
424 
427  enum {
428  COMPOSITE_INPLACE=0,
429  COMPOSITE_INPLACE_DISJOINT=1,
430  COMPOSITE_BALANCED=2,
431  COMPOSITE_AUTO=3
432  };
433  void SetCompositeStrategy(int val);
434  vtkGetMacro(CompositeStrategy, int);
436 
441  static bool IsSupported(vtkRenderWindow *context);
442 
449  virtual void WriteTimerLog(const char *){}
450 
455 
461  virtual void ReleaseGraphicsResources(vtkWindow * win);
462 
467 
471  void ValidateContext(vtkRenderer *renderer);
472 
480 
486 
488 
494  vtkActor *actor, vtkDataObject *data);
495 
497 
500  void SetHasVectors(bool val);
503 
508 
512  void ApplyLIC();
514  void CopyToScreen();
515 
521  virtual void GetGlobalMinMax(vtkPainterCommunicator*, float&, float&){}
522 
524 
527  vtkSetMacro(Enable, int);
528  vtkGetMacro(Enable, int);
529  vtkBooleanMacro(Enable, int);
531 
532 protected:
535 
540 
542 
545  virtual bool NeedToUpdateCommunicator();
546  bool NeedToRenderGeometry(vtkRenderer *renderer, vtkActor *actor);
550  void SetUpdateAll();
552 
553  int Enable;
554 
555  // Unit is a pixel length.
557  double StepSize;
559 
567 
571  double MaskColor[3];
572 
574  double LICIntensity;
575  double MapModeBias;
576 
587 
590 
592 
593  // save the active fbo and its draw buffer
595  int PrevFbo;
596 
597 private:
598  vtkSurfaceLICInterface(const vtkSurfaceLICInterface&) VTK_DELETE_FUNCTION;
599  void operator=(const vtkSurfaceLICInterface&) VTK_DELETE_FUNCTION;
600 };
601 
602 #endif
603 // VTK-HeaderTest-Exclude: vtkSurfaceLICInterface.h
vtkSurfaceLICInterface::NoiseType
int NoiseType
Definition: vtkSurfaceLICInterface.h:578
vtkSurfaceLICInterface::NoiseGrainSize
int NoiseGrainSize
Definition: vtkSurfaceLICInterface.h:580
vtkSurfaceLICInterface::PrevFbo
int PrevFbo
Definition: vtkSurfaceLICInterface.h:595
vtkSurfaceLICInterface::CreateCommunicator
virtual vtkPainterCommunicator * CreateCommunicator(int)
Creates a new communicator with/without the calling processes as indicated by the passed in flag,...
vtkSurfaceLICInterface::SetImpulseNoiseBackgroundValue
void SetImpulseNoiseBackgroundValue(double val)
The color to use for untouched pixels when impulse noise probability < 1.
vtkSurfaceLICInterface::ReleaseGraphicsResources
virtual void ReleaseGraphicsResources(vtkWindow *win)
Release any graphics resources that are being consumed by this mapper.
vtkSurfaceLICInterface::SetColorMode
void SetColorMode(int val)
vtkSurfaceLICInterface::NeedToComputeLIC
bool NeedToComputeLIC()
vtkSurfaceLICInterface::HighColorContrastEnhancementFactor
double HighColorContrastEnhancementFactor
Definition: vtkSurfaceLICInterface.h:565
vtkSurfaceLICInterface::PrevDrawBuf
int PrevDrawBuf
Definition: vtkSurfaceLICInterface.h:594
vtkSurfaceLICInterface::MapModeBias
double MapModeBias
Definition: vtkSurfaceLICInterface.h:575
vtkSurfaceLICInterface::GatherVectors
void GatherVectors()
vtkSurfaceLICInterface::GetGlobalMinMax
virtual void GetGlobalMinMax(vtkPainterCommunicator *, float &, float &)
Get the min/max across all ranks.
Definition: vtkSurfaceLICInterface.h:521
vtkSurfaceLICInterface::ShallowCopy
void ShallowCopy(vtkSurfaceLICInterface *m)
Make a shallow copy of this interface.
vtkSurfaceLICInterface::SetNumberOfSteps
void SetNumberOfSteps(int val)
Get/Set the number of integration steps in each direction.
vtkSurfaceLICInterface::CombineColorsAndLIC
void CombineColorsAndLIC()
vtkSurfaceLICInterface::MaskIntensity
double MaskIntensity
Definition: vtkSurfaceLICInterface.h:570
vtkSurfaceLICInterface::NeedToRenderGeometry
bool NeedToRenderGeometry(vtkRenderer *renderer, vtkActor *actor)
vtkX3D::type
@ type
Definition: vtkX3D.h:516
vtkSurfaceLICInterface::IsSupported
static bool IsSupported(vtkRenderWindow *context)
Returns true if the rendering context supports extensions needed by this painter.
vtkSurfaceLICInterface::LICIntensity
double LICIntensity
Definition: vtkSurfaceLICInterface.h:574
vtkSurfaceLICInterface::SetNoiseDataSet
void SetNoiseDataSet(vtkImageData *data)
Set the data containing a noise array as active scalars.
vtkX3D::data
@ data
Definition: vtkX3D.h:315
vtkSurfaceLICInterface::SetLICIntensity
void SetLICIntensity(double val)
Factor used when blend mode is set to COLOR_MODE_BLEND.
vtkSurfaceLICInterface::SetMinNoiseValue
void SetMinNoiseValue(double val)
Set/Get the minimum and mximum gray scale values that the generated noise can take on.
vtkSurfaceLICInterface::HighLICContrastEnhancementFactor
double HighLICContrastEnhancementFactor
Definition: vtkSurfaceLICInterface.h:563
vtkSurfaceLICInterface::StepSize
double StepSize
Definition: vtkSurfaceLICInterface.h:557
vtkSurfaceLICInterface::MinNoiseValue
double MinNoiseValue
Definition: vtkSurfaceLICInterface.h:581
vtkSurfaceLICInterface::CompositeStrategy
int CompositeStrategy
Definition: vtkSurfaceLICInterface.h:589
vtkSurfaceLICInterface::AlwaysUpdate
int AlwaysUpdate
Definition: vtkSurfaceLICInterface.h:588
vtkSurfaceLICInterface
public API for surface lic parameters arbitrary geometry.
Definition: vtkSurfaceLICInterface.h:75
vtkObject
abstract base class for most VTK objects
Definition: vtkObject.h:60
vtkSurfaceLICInterface::SetLowLICContrastEnhancementFactor
void SetLowLICContrastEnhancementFactor(double val)
vtkSurfaceLICInterface::SetLowColorContrastEnhancementFactor
void SetLowColorContrastEnhancementFactor(double val)
vtkSurfaceLICHelper
A small collection of noise routines for LIC.
Definition: vtkSurfaceLICHelper.h:44
vtkSurfaceLICInterface::SetMaskIntensity
void SetMaskIntensity(double val)
The MaskIntensity controls the blending of the mask color and the geometry color.
vtkSurfaceLICInterface::EnhancedLIC
int EnhancedLIC
Definition: vtkSurfaceLICInterface.h:560
vtkSurfaceLICInterface::MaskThreshold
double MaskThreshold
Definition: vtkSurfaceLICInterface.h:569
vtkSurfaceLICInterface::SetMaskColor
void SetMaskColor(double r, double g, double b)
Definition: vtkSurfaceLICInterface.h:153
vtkX3D::length
@ length
Definition: vtkX3D.h:393
vtkSurfaceLICInterface::NormalizeVectors
int NormalizeVectors
Definition: vtkSurfaceLICInterface.h:558
vtkSurfaceLICInterface::NoiseGeneratorSeed
int NoiseGeneratorSeed
Definition: vtkSurfaceLICInterface.h:586
vtkDataArray
abstract superclass for arrays of numeric data
Definition: vtkDataArray.h:55
vtkSurfaceLICInterface::UpdateCommunicator
void UpdateCommunicator(vtkRenderer *renderer, vtkActor *actor, vtkDataObject *data)
Called from a mapper, does what is needed to make sure the communicators are ready.
vtkSurfaceLICInterface::WriteTimerLog
virtual void WriteTimerLog(const char *)
Methods used for parallel benchmarks.
Definition: vtkSurfaceLICInterface.h:449
vtkSurfaceLICInterface::NeedToUpdateCommunicator
virtual bool NeedToUpdateCommunicator()
Return false if stage can be skipped.
vtkWindow
window superclass for vtkRenderWindow
Definition: vtkWindow.h:35
vtkSurfaceLICInterface::SetNoiseTextureSize
void SetNoiseTextureSize(int length)
Set/Get the side length in pixels of the noise texture.
vtkSurfaceLICInterface::MaskOnSurface
int MaskOnSurface
Definition: vtkSurfaceLICInterface.h:568
vtkSurfaceLICInterface::SetEnhancedLIC
void SetEnhancedLIC(int val)
EnhancedLIC mean compute the LIC twice with the second pass using the edge-enhanced result of the fir...
vtkSurfaceLICInterface::SetMaskThreshold
void SetMaskThreshold(double val)
The MaskThreshold controls the rendering of fragments in stagnant regions of flow.
vtkSurfaceLICInterface::SetNumberOfNoiseLevels
void SetNumberOfNoiseLevels(int val)
Set/Get the number of discrete values a noise pixel may take on.
vtkSurfaceLICInterface::MaxNoiseValue
double MaxNoiseValue
Definition: vtkSurfaceLICInterface.h:582
vtkSurfaceLICInterface::Internals
vtkSurfaceLICHelper * Internals
Definition: vtkSurfaceLICInterface.h:591
vtkSurfaceLICInterface::CopyToScreen
void CopyToScreen()
vtkSurfaceLICInterface::SetNoiseGeneratorSeed
void SetNoiseGeneratorSeed(int val)
Set/Get the seed value used by the random number generator.
vtkSurfaceLICInterface::SetEnhanceContrast
void SetEnhanceContrast(int val)
vtkSurfaceLICInterface::ColorMode
int ColorMode
Definition: vtkSurfaceLICInterface.h:573
vtkSurfaceLICInterface::CompletedGeometry
void CompletedGeometry()
vtkSurfaceLICInterface::SetNormalizeVectors
void SetNormalizeVectors(int val)
Normalize vectors during integration.
vtkSurfaceLICInterface::SetHighColorContrastEnhancementFactor
void SetHighColorContrastEnhancementFactor(double val)
vtkSurfaceLICInterface::SetMaskColor
void SetMaskColor(double *val)
The MaskColor is used on masked fragments.
vtkSurfaceLICInterface::GetHasVectors
bool GetHasVectors()
vtkSurfaceLICInterface::ValidateContext
void ValidateContext(vtkRenderer *renderer)
Look for changes that would trigger stage updates.
vtkSurfaceLICInterface::PrintSelf
void PrintSelf(ostream &os, vtkIndent indent)
Methods invoked by print to print information about the object including superclasses.
vtkSurfaceLICInterface::LowLICContrastEnhancementFactor
double LowLICContrastEnhancementFactor
Definition: vtkSurfaceLICInterface.h:562
vtkActor
represents an object (geometry & properties) in a rendered scene
Definition: vtkActor.h:52
vtkSurfaceLICInterface::PrepareForGeometry
void PrepareForGeometry()
vtkImageData
topologically and geometrically regular array of data
Definition: vtkImageData.h:46
vtkIndent
a simple class to control print indentation
Definition: vtkIndent.h:40
vtkSurfaceLICInterface::SetMapModeBias
void SetMapModeBias(double val)
Factor used when blend mode is set to COLOR_MODE_MAP.
vtkSurfaceLICInterface::ImpulseNoiseBackgroundValue
double ImpulseNoiseBackgroundValue
Definition: vtkSurfaceLICInterface.h:585
vtkSurfaceLICInterface::CanRenderSurfaceLIC
bool CanRenderSurfaceLIC(vtkActor *actor)
Returns true when rendering LIC is possible.
vtkSurfaceLICInterface::ApplyLIC
void ApplyLIC()
vtkSurfaceLICInterface::SetMaxNoiseValue
void SetMaxNoiseValue(double val)
vtkSurfaceLICInterface::New
static vtkSurfaceLICInterface * New()
vtkSurfaceLICInterface::SetCompositeStrategy
void SetCompositeStrategy(int val)
vtkSurfaceLICInterface::NumberOfSteps
int NumberOfSteps
Definition: vtkSurfaceLICInterface.h:556
vtkSurfaceLICInterface::SetHighLICContrastEnhancementFactor
void SetHighLICContrastEnhancementFactor(double val)
vtkSurfaceLICInterface::UpdateNoiseImage
void UpdateNoiseImage(vtkRenderWindow *renWin)
Updates the noise texture, downsampling by the requested sample rate.
vtkSurfaceLICInterface::SetImpulseNoiseProbability
void SetImpulseNoiseProbability(double val)
Control the density of of the noise.
vtkBooleanMacro
vtkBooleanMacro(IgnoreDriverBugs, bool)
Updates the extensions string.
vtkSetMacro
vtkSetMacro(IgnoreDriverBugs, bool)
Updates the extensions string.
vtkPainterCommunicator
A communicator that can safely be used inside a painter.
Definition: vtkPainterCommunicator.h:31
vtkSurfaceLICInterface::AntiAlias
int AntiAlias
Definition: vtkSurfaceLICInterface.h:566
vtkSurfaceLICInterface::NeedToGatherVectors
bool NeedToGatherVectors()
vtkSurfaceLICInterface::GenerateNoiseTexture
int GenerateNoiseTexture
Definition: vtkSurfaceLICInterface.h:577
vtkSurfaceLICInterface::LowColorContrastEnhancementFactor
double LowColorContrastEnhancementFactor
Definition: vtkSurfaceLICInterface.h:564
vtkSurfaceLICInterface::SetHasVectors
void SetHasVectors(bool val)
Does the data have vectors which we require.
vtkRenderer
abstract specification for renderers
Definition: vtkRenderer.h:64
vtkSurfaceLICInterface::EnhanceContrast
int EnhanceContrast
Definition: vtkSurfaceLICInterface.h:561
vtkSurfaceLICInterface::SetNoiseGrainSize
void SetNoiseGrainSize(int val)
Each noise value will be length^2 pixels in area.
vtkSurfaceLICInterface::SetMaskOnSurface
void SetMaskOnSurface(int val)
When set MaskOnSurface computes |V| for use in the fragment masking tests on the surface.
vtkSurfaceLICInterface::GetNoiseDataSet
vtkImageData * GetNoiseDataSet()
vtkSurfaceLICInterface::ImpulseNoiseProbability
double ImpulseNoiseProbability
Definition: vtkSurfaceLICInterface.h:584
vtkSurfaceLICInterface::NoiseTextureSize
int NoiseTextureSize
Definition: vtkSurfaceLICInterface.h:579
vtkRenderWindow
create a window for renderers to draw into
Definition: vtkRenderWindow.h:87
vtkSurfaceLICInterface::~vtkSurfaceLICInterface
~vtkSurfaceLICInterface()
vtkSurfaceLICInterface::SetNoiseType
void SetNoiseType(int type)
vtkSurfaceLICInterface::Enable
int Enable
Definition: vtkSurfaceLICInterface.h:553
vtkSurfaceLICInterface::SetStepSize
void SetStepSize(double val)
Get/Set the step size (in pixels).
vtkDataObject
general representation of visualization data
Definition: vtkDataObject.h:65
vtkSurfaceLICInterface::SetUpdateAll
void SetUpdateAll()
vtkSurfaceLICInterface::vtkSurfaceLICInterface
vtkSurfaceLICInterface()
vtkSurfaceLICInterface::CreateCommunicator
void CreateCommunicator(vtkRenderer *, vtkActor *, vtkDataObject *data)
Creates a new communicator for internal use based on this rank's visible data.
vtkSurfaceLICInterface::NumberOfNoiseLevels
int NumberOfNoiseLevels
Definition: vtkSurfaceLICInterface.h:583
vtkSurfaceLICInterface::InitializeResources
void InitializeResources()
resoucre allocators
vtkSurfaceLICInterface::GetCommunicator
vtkPainterCommunicator * GetCommunicator()
vtkSurfaceLICInterface::SetGenerateNoiseTexture
void SetGenerateNoiseTexture(int shouldGenerate)
Set/Get the noise texture source.
vtkSurfaceLICInterface::NeedToColorLIC
bool NeedToColorLIC()
vtkSurfaceLICInterface::SetAntiAlias
void SetAntiAlias(int val)
Enable/Disable the anti-aliasing pass.