VTK
vtkSurfaceLICPainter.h
Go to the documentation of this file.
1 /*=========================================================================
2 
3  Program: Visualization Toolkit
4  Module: vtkSurfaceLICPainter.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 vtkSurfaceLICPainter_h
60 #define vtkSurfaceLICPainter_h
61 
62 #include "vtkRenderingLICModule.h" // For export macro
63 #include "vtkPainter.h"
64 
65 class vtkRenderWindow;
66 class vtkRenderer;
67 class vtkActor;
68 class vtkImageData;
69 class vtkDataObject;
70 class vtkDataArray;
72 
73 class VTKRENDERINGLIC_EXPORT vtkSurfaceLICPainter : public vtkPainter
74 {
75 public:
78  void PrintSelf(ostream& os, vtkIndent indent);
79 
85  virtual void ReleaseGraphicsResources(vtkWindow * win);
86 
94 
96 
99  void SetEnable(int val);
100  vtkGetMacro(Enable, int);
101  void SetEnableOn(){ this->SetEnable(1); }
102  void SetEnableOff(){ this->SetEnable(0); }
104 
106 
112  void SetInputArrayToProcess(int fieldAssociation, const char *name);
113  void SetInputArrayToProcess(int fieldAssociation, int fieldAttributeType);
115 
117 
120  void SetNumberOfSteps(int val);
121  vtkGetMacro(NumberOfSteps, int);
123 
125 
128  void SetStepSize(double val);
129  vtkGetMacro(StepSize, double);
131 
133 
144  void SetNormalizeVectors(int val);
145  vtkBooleanMacro(NormalizeVectors, int);
146  vtkGetMacro(NormalizeVectors, int);
148 
150 
155  void SetMaskOnSurface(int val);
156  vtkBooleanMacro(MaskOnSurface, int);
157  vtkGetMacro(MaskOnSurface, int);
159 
161 
177  void SetMaskThreshold(double val);
178  vtkGetMacro(MaskThreshold, double);
180 
182 
187  void SetMaskColor(double *val);
188  void SetMaskColor(double r, double g, double b)
189  { double rgb[3]={r,g,b}; this->SetMaskColor(rgb); }
190  vtkGetVector3Macro(MaskColor, double);
192 
194 
202  void SetMaskIntensity(double val);
203  vtkGetMacro(MaskIntensity, double);
205 
207 
212  void SetEnhancedLIC(int val);
213  vtkGetMacro(EnhancedLIC, int);
214  vtkBooleanMacro(EnhancedLIC, int);
216 
218 
251  enum {
252  ENHANCE_CONTRAST_OFF=0,
253  ENHANCE_CONTRAST_LIC=1,
254  ENHANCE_CONTRAST_COLOR=3,
255  ENHANCE_CONTRAST_BOTH=4
256  };
257  void SetEnhanceContrast(int val);
258  vtkGetMacro(EnhanceContrast, int);
260 
262 
278  vtkGetMacro(LowLICContrastEnhancementFactor, double);
279  vtkGetMacro(HighLICContrastEnhancementFactor, double);
282  //
283  vtkGetMacro(LowColorContrastEnhancementFactor, double);
284  vtkGetMacro(HighColorContrastEnhancementFactor, double);
288 
290 
296  void SetAntiAlias(int val);
297  vtkBooleanMacro(AntiAlias, int);
298  vtkGetMacro(AntiAlias, int);
300 
302 
311  enum {
312  COLOR_MODE_BLEND=0,
313  COLOR_MODE_MAP
314  };
315  void SetColorMode(int val);
316  vtkGetMacro(ColorMode, int);
318 
320 
329  void SetLICIntensity(double val);
330  vtkGetMacro(LICIntensity, double);
332 
334 
341  void SetMapModeBias(double val);
342  vtkGetMacro(MapModeBias, double);
344 
346 
354 
356 
375  void SetGenerateNoiseTexture(int shouldGenerate);
376  vtkGetMacro(GenerateNoiseTexture, int);
378 
380 
385  enum {
386  NOISE_TYPE_UNIFORM=0,
387  NOISE_TYPE_GAUSSIAN=1,
388  NOISE_TYPE_PERLIN=2
389  };
390  void SetNoiseType(int type);
391  vtkGetMacro(NoiseType, int);
393 
395 
400  vtkGetMacro(NoiseTextureSize, int);
402 
404 
408  void SetNoiseGrainSize(int val);
409  vtkGetMacro(NoiseGrainSize, int);
411 
413 
419  void SetMinNoiseValue(double val);
420  void SetMaxNoiseValue(double val);
421  vtkGetMacro(MinNoiseValue, double);
422  vtkGetMacro(MaxNoiseValue, double);
424 
426 
430  void SetNumberOfNoiseLevels(int val);
431  vtkGetMacro(NumberOfNoiseLevels, int);
433 
435 
439  void SetImpulseNoiseProbability(double val);
440  vtkGetMacro(ImpulseNoiseProbability, double);
442 
444 
448  vtkGetMacro(ImpulseNoiseBackgroundValue, double);
450 
452 
455  void SetNoiseGeneratorSeed(int val);
456  vtkGetMacro(NoiseGeneratorSeed, int);
458 
460 
463  enum {
464  COMPOSITE_INPLACE=0,
465  COMPOSITE_INPLACE_DISJOINT=1,
466  COMPOSITE_BALANCED=2,
467  COMPOSITE_AUTO=3
468  };
469  void SetCompositeStrategy(int val);
470  vtkGetMacro(CompositeStrategy, int);
472 
477  static bool IsSupported(vtkRenderWindow *context);
478 
485  virtual void WriteTimerLog(const char *){}
486 
487 protected:
490 
497 
503  virtual void GetGlobalMinMax(vtkPainterCommunicator*, float&, float&){}
504 
511  virtual void StartTimerEvent(const char *){}
512  virtual void EndTimerEvent(const char *){}
513 
521 
527 
531  void GetBounds(vtkDataObject* data, double bounds[6]);
532 
536  void ReportReferences(vtkGarbageCollector *collector) VTK_OVERRIDE;
537 
542 
550  virtual void RenderInternal(
551  vtkRenderer* renderer,
552  vtkActor* actor,
553  unsigned long typeflags,
554  bool forceCompileOnly);
555 
556 
560  void ValidateContext(vtkRenderer *renderer);
561 
563 
567  virtual bool NeedToUpdateCommunicator();
568  bool NeedToRenderGeometry(vtkRenderer *renderer, vtkActor *actor);
572  void SetUpdateAll();
574 
576 
582 
584 
588  bool VectorsToTCoords(vtkDataSet *dataObj);
591 
595  bool CanRenderSurfaceLIC(vtkActor *actor, int typeflags);
596 
597 protected:
598  // Unit is a pixel length.
600  double StepSize;
602 
610 
614  double MaskColor[3];
615 
617  double LICIntensity;
618  double MapModeBias;
619 
630 
632  int Enable;
634 
636  class vtkInternals;
637  vtkInternals* Internals;
638 
639 private:
640  vtkSurfaceLICPainter(const vtkSurfaceLICPainter&) VTK_DELETE_FUNCTION;
641  void operator=(const vtkSurfaceLICPainter&) VTK_DELETE_FUNCTION;
642 };
643 
644 #endif
vtkSurfaceLICPainter::MapModeBias
double MapModeBias
Definition: vtkSurfaceLICPainter.h:618
vtkSurfaceLICPainter::SetMaskOnSurface
void SetMaskOnSurface(int val)
When set MaskOnSurface computes |V| for use in the fragment masking tests on the surface.
vtkSurfaceLICPainter::ReportReferences
void ReportReferences(vtkGarbageCollector *collector) override
Take part in garbage collection.
vtkSurfaceLICPainter::MaskIntensity
double MaskIntensity
Definition: vtkSurfaceLICPainter.h:613
vtkSurfaceLICPainter::MaskThreshold
double MaskThreshold
Definition: vtkSurfaceLICPainter.h:612
vtkSurfaceLICPainter::SetMinNoiseValue
void SetMinNoiseValue(double val)
Set/Get the minimum and mximum gray scale values that the generated noise can take on.
vtkSurfaceLICPainter::VectorsToTCoords
bool VectorsToTCoords(vtkDataSet *dataObj)
vtkSurfaceLICPainter::GetOutput
virtual vtkDataObject * GetOutput()
Get the output data object from this painter.
vtkSurfaceLICPainter::NeedToRenderGeometry
bool NeedToRenderGeometry(vtkRenderer *renderer, vtkActor *actor)
vtkSurfaceLICPainter::ImpulseNoiseBackgroundValue
double ImpulseNoiseBackgroundValue
Definition: vtkSurfaceLICPainter.h:628
vtkSurfaceLICPainter
painter that performs LIC on the surface of arbitrary geometry.
Definition: vtkSurfaceLICPainter.h:74
vtkSurfaceLICPainter::NeedToUpdateOutputData
bool NeedToUpdateOutputData()
Return false if stage can be skipped.
vtkSurfaceLICPainter::SetInputArrayToProcess
void SetInputArrayToProcess(int fieldAssociation, const char *name)
Set the vectors to used for applying LIC.
vtkSurfaceLICPainter::ColorMode
int ColorMode
Definition: vtkSurfaceLICPainter.h:616
vtkSurfaceLICPainter::CanRenderSurfaceLIC
bool CanRenderSurfaceLIC(vtkActor *actor, int typeflags)
Returns true when rendering LIC is possible.
vtkX3D::type
@ type
Definition: vtkX3D.h:516
vtkSurfaceLICPainter::SetNoiseGeneratorSeed
void SetNoiseGeneratorSeed(int val)
Set/Get the seed value used by the random number generator.
vtkSurfaceLICPainter::SetNoiseDataSet
void SetNoiseDataSet(vtkImageData *data)
Set the data containing a noise array as active scalars.
vtkX3D::data
@ data
Definition: vtkX3D.h:315
vtkSurfaceLICPainter::NoiseGrainSize
int NoiseGrainSize
Definition: vtkSurfaceLICPainter.h:623
vtkSurfaceLICPainter::SetHighLICContrastEnhancementFactor
void SetHighLICContrastEnhancementFactor(double val)
vtkSurfaceLICPainter::HighColorContrastEnhancementFactor
double HighColorContrastEnhancementFactor
Definition: vtkSurfaceLICPainter.h:608
vtkSurfaceLICPainter::InitializeResources
void InitializeResources()
vtkSurfaceLICPainter::~vtkSurfaceLICPainter
~vtkSurfaceLICPainter()
vtkSurfaceLICPainter::SetCompositeStrategy
void SetCompositeStrategy(int val)
vtkSurfaceLICPainter::GenerateNoiseTexture
int GenerateNoiseTexture
Definition: vtkSurfaceLICPainter.h:620
vtkSurfaceLICPainter::CompositeStrategy
int CompositeStrategy
Definition: vtkSurfaceLICPainter.h:633
vtkSurfaceLICPainter::GetBounds
void GetBounds(vtkDataObject *data, double bounds[6])
Computes data bounds.
vtkSurfaceLICPainter::StartTimerEvent
virtual void StartTimerEvent(const char *)
Methods used for parallel benchmarks.
Definition: vtkSurfaceLICPainter.h:511
vtkSurfaceLICPainter::SetMapModeBias
void SetMapModeBias(double val)
Factor used when blend mode is set to COLOR_MODE_MAP.
vtkSurfaceLICPainter::Internals
vtkInternals * Internals
Definition: vtkSurfaceLICPainter.h:636
vtkSurfaceLICPainter::SetLowColorContrastEnhancementFactor
void SetLowColorContrastEnhancementFactor(double val)
vtkSurfaceLICPainter::Output
vtkDataObject * Output
Definition: vtkSurfaceLICPainter.h:635
vtkSurfaceLICPainter::SetNormalizeVectors
void SetNormalizeVectors(int val)
Normalize vectors during integration.
vtkSurfaceLICPainter::SetNoiseGrainSize
void SetNoiseGrainSize(int val)
Set/Get the side length in pixels of the noise values in the noise texture.
vtkSurfaceLICPainter::SetImpulseNoiseBackgroundValue
void SetImpulseNoiseBackgroundValue(double val)
The color to use for untouched pixels when impulse noise probability < 1.
vtkSurfaceLICPainter::EndTimerEvent
virtual void EndTimerEvent(const char *)
Definition: vtkSurfaceLICPainter.h:512
vtkSurfaceLICPainter::PrintSelf
void PrintSelf(ostream &os, vtkIndent indent)
Methods invoked by print to print information about the object including superclasses.
vtkSurfaceLICPainter::SetEnableOff
void SetEnableOff()
Definition: vtkSurfaceLICPainter.h:102
vtkX3D::length
@ length
Definition: vtkX3D.h:393
vtkSurfaceLICPainter::EnhancedLIC
int EnhancedLIC
Definition: vtkSurfaceLICPainter.h:603
vtkSurfaceLICPainter::SetEnhanceContrast
void SetEnhanceContrast(int val)
vtkDataArray
abstract superclass for arrays of numeric data
Definition: vtkDataArray.h:55
vtkSurfaceLICPainter::CreateCommunicator
virtual vtkPainterCommunicator * CreateCommunicator(int)
Creates a new communicator with/without the calling processes as indicated by the passed in flag,...
vtkSurfaceLICPainter::ReleaseGraphicsResources
virtual void ReleaseGraphicsResources(vtkWindow *win)
Release any graphics resources that are being consumed by this mapper.
vtkSurfaceLICPainter::SetMaskColor
void SetMaskColor(double r, double g, double b)
Definition: vtkSurfaceLICPainter.h:188
vtkSurfaceLICPainter::SetUpdateAll
void SetUpdateAll()
vtkSurfaceLICPainter::AlwaysUpdate
int AlwaysUpdate
Definition: vtkSurfaceLICPainter.h:631
vtkSurfaceLICPainter::WriteTimerLog
virtual void WriteTimerLog(const char *)
Methods used for parallel benchmarks.
Definition: vtkSurfaceLICPainter.h:485
vtkSurfaceLICPainter::SetMaxNoiseValue
void SetMaxNoiseValue(double val)
vtkSurfaceLICPainter::ImpulseNoiseProbability
double ImpulseNoiseProbability
Definition: vtkSurfaceLICPainter.h:627
vtkSurfaceLICPainter::SetNoiseTextureSize
void SetNoiseTextureSize(int length)
Set/Get the side length in pixels of the noise texture.
vtkSurfaceLICPainter::RenderInternal
virtual void RenderInternal(vtkRenderer *renderer, vtkActor *actor, unsigned long typeflags, bool forceCompileOnly)
Performs the actual rendering.
vtkWindow
window superclass for vtkRenderWindow
Definition: vtkWindow.h:35
vtkSurfaceLICPainter::ProcessInformation
virtual void ProcessInformation(vtkInformation *info)
Called before RenderInternal() if the Information has been changed since the last time this method wa...
vtkSurfaceLICPainter::NoiseType
int NoiseType
Definition: vtkSurfaceLICPainter.h:621
vtkSurfaceLICPainter::AntiAlias
int AntiAlias
Definition: vtkSurfaceLICPainter.h:609
vtkSurfaceLICPainter::LICIntensity
double LICIntensity
Definition: vtkSurfaceLICPainter.h:617
vtkSurfaceLICPainter::SetLICIntensity
void SetLICIntensity(double val)
Factor used when blend mode is set to COLOR_MODE_BLEND.
vtkSurfaceLICPainter::NumberOfSteps
int NumberOfSteps
Definition: vtkSurfaceLICPainter.h:599
vtkSurfaceLICPainter::NoiseGeneratorSeed
int NoiseGeneratorSeed
Definition: vtkSurfaceLICPainter.h:629
vtkSurfaceLICPainter::NeedToColorLIC
bool NeedToColorLIC()
vtkSurfaceLICPainter::SetColorMode
void SetColorMode(int val)
vtkSurfaceLICPainter::SetAntiAlias
void SetAntiAlias(int val)
Enable/Disable the anti-aliasing pass.
vtkSurfaceLICPainter::NeedToGatherVectors
bool NeedToGatherVectors()
vtkSurfaceLICPainter::NoiseTextureSize
int NoiseTextureSize
Definition: vtkSurfaceLICPainter.h:622
vtkSurfaceLICPainter::SetNoiseType
void SetNoiseType(int type)
vtkSurfaceLICPainter::SetHighColorContrastEnhancementFactor
void SetHighColorContrastEnhancementFactor(double val)
vtkSurfaceLICPainter::GetNoiseDataSet
vtkImageData * GetNoiseDataSet()
vtkSurfaceLICPainter::SetMaskIntensity
void SetMaskIntensity(double val)
The MaskIntensity controls the blending of the mask color and the geometry color.
vtkActor
represents an object (geometry & properties) in a rendered scene
Definition: vtkActor.h:52
vtkSurfaceLICPainter::HighLICContrastEnhancementFactor
double HighLICContrastEnhancementFactor
Definition: vtkSurfaceLICPainter.h:606
vtkImageData
topologically and geometrically regular array of data
Definition: vtkImageData.h:46
vtkIndent
a simple class to control print indentation
Definition: vtkIndent.h:40
vtkSurfaceLICPainter::SetInputArrayToProcess
void SetInputArrayToProcess(int fieldAssociation, int fieldAttributeType)
vtkSurfaceLICPainter::MaxNoiseValue
double MaxNoiseValue
Definition: vtkSurfaceLICPainter.h:625
vtkSurfaceLICPainter::CreateCommunicator
void CreateCommunicator()
Creates a new communicator for internal use based on this rank's visible data.
vtkPainter
Abstract class for drawing poly data.
Definition: vtkPainter.h:62
vtkSurfaceLICPainter::StepSize
double StepSize
Definition: vtkSurfaceLICPainter.h:600
vtkSurfaceLICPainter::SetNumberOfNoiseLevels
void SetNumberOfNoiseLevels(int val)
Set/Get the number of discrete values a noise pixel may take on.
vtkSurfaceLICPainter::MaskOnSurface
int MaskOnSurface
Definition: vtkSurfaceLICPainter.h:611
vtkSurfaceLICPainter::SetNumberOfSteps
void SetNumberOfSteps(int val)
Get/Set the number of integration steps in each direction.
vtkSurfaceLICPainter::SetEnableOn
void SetEnableOn()
Definition: vtkSurfaceLICPainter.h:101
vtkPainter.h
vtkX3D::name
@ name
Definition: vtkX3D.h:219
vtkGarbageCollector
Detect and break reference loops.
Definition: vtkGarbageCollector.h:100
vtkSurfaceLICPainter::IsSupported
static bool IsSupported(vtkRenderWindow *context)
Returns true if the rendering context supports extensions needed by this painter.
vtkSurfaceLICPainter::NeedToUpdateCommunicator
virtual bool NeedToUpdateCommunicator()
vtkSurfaceLICPainter::SetGenerateNoiseTexture
void SetGenerateNoiseTexture(int shouldGenerate)
Set/Get the noise texture source.
vtkDataSet
abstract class to specify dataset behavior
Definition: vtkDataSet.h:63
vtkBooleanMacro
vtkBooleanMacro(IgnoreDriverBugs, bool)
Updates the extensions string.
vtkSurfaceLICPainter::NumberOfNoiseLevels
int NumberOfNoiseLevels
Definition: vtkSurfaceLICPainter.h:626
vtkInformation
Store vtkAlgorithm input/output information.
Definition: vtkInformation.h:87
vtkSurfaceLICPainter::ValidateContext
void ValidateContext(vtkRenderer *renderer)
Look for changes that would trigger stage updates.
vtkX3D::info
@ info
Definition: vtkX3D.h:376
vtkPainterCommunicator
A communicator that can safely be used inside a painter.
Definition: vtkPainterCommunicator.h:31
vtkSurfaceLICPainter::NormalizeVectors
int NormalizeVectors
Definition: vtkSurfaceLICPainter.h:601
vtkSurfaceLICPainter::SetImpulseNoiseProbability
void SetImpulseNoiseProbability(double val)
Control the density of of the noise.
vtkSurfaceLICPainter::MinNoiseValue
double MinNoiseValue
Definition: vtkSurfaceLICPainter.h:624
vtkSurfaceLICPainter::GetGlobalMinMax
virtual void GetGlobalMinMax(vtkPainterCommunicator *, float &, float &)
Get the min/max across all ranks.
Definition: vtkSurfaceLICPainter.h:503
vtkSurfaceLICPainter::EnhanceContrast
int EnhanceContrast
Definition: vtkSurfaceLICPainter.h:604
vtkSurfaceLICPainter::VectorsToTCoords
bool VectorsToTCoords(vtkDataObject *dataObj)
set tcoords with vectors
vtkRenderer
abstract specification for renderers
Definition: vtkRenderer.h:64
vtkSurfaceLICPainter::UpdateNoiseImage
void UpdateNoiseImage(vtkRenderWindow *renWin)
Updates the noise texture, downsampling by the requested sample rate.
vtkSurfaceLICPainter::LowColorContrastEnhancementFactor
double LowColorContrastEnhancementFactor
Definition: vtkSurfaceLICPainter.h:607
vtkSurfaceLICPainter::SetEnable
void SetEnable(int val)
Enable/Disable this painter.
vtkRenderWindow
create a window for renderers to draw into
Definition: vtkRenderWindow.h:87
vtkSurfaceLICPainter::ClearTCoords
void ClearTCoords(vtkDataSet *data)
vtkSurfaceLICPainter::PrepareOutput
bool PrepareOutput()
resoucre allocators
vtkDataObject
general representation of visualization data
Definition: vtkDataObject.h:65
vtkSurfaceLICPainter::vtkSurfaceLICPainter
vtkSurfaceLICPainter()
vtkSurfaceLICPainter::SetEnhancedLIC
void SetEnhancedLIC(int val)
EnhancedLIC mean compute the LIC twice with the second pass using the edge-enhanced result of the fir...
vtkSurfaceLICPainter::Enable
int Enable
Definition: vtkSurfaceLICPainter.h:632
vtkSurfaceLICPainter::LowLICContrastEnhancementFactor
double LowLICContrastEnhancementFactor
Definition: vtkSurfaceLICPainter.h:605
vtkSurfaceLICPainter::NeedToComputeLIC
bool NeedToComputeLIC()
vtkSurfaceLICPainter::SetStepSize
void SetStepSize(double val)
Get/Set the step size (in pixels).
vtkSurfaceLICPainter::SetMaskColor
void SetMaskColor(double *val)
The MaskColor is used on masked fragments.
vtkSurfaceLICPainter::New
static vtkSurfaceLICPainter * New()
vtkSurfaceLICPainter::SetMaskThreshold
void SetMaskThreshold(double val)
The MaskThreshold controls the rendering of fragments in stagnant regions of flow.
vtkSurfaceLICPainter::SetLowLICContrastEnhancementFactor
void SetLowLICContrastEnhancementFactor(double val)