VTK  9.0.1
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 =========================================================================*/
56 #ifndef vtkSurfaceLICInterface_h
57 #define vtkSurfaceLICInterface_h
58 
60 #include "vtkRenderingLICOpenGL2Module.h" // For export macro
61 
62 class vtkRenderWindow;
63 class vtkRenderer;
64 class vtkActor;
65 class vtkImageData;
66 class vtkDataObject;
67 class vtkDataArray;
70 
71 class VTKRENDERINGLICOPENGL2_EXPORT vtkSurfaceLICInterface : public vtkObject
72 {
73 public:
76  void PrintSelf(ostream& os, vtkIndent indent) override;
77 
79 
82  void SetNumberOfSteps(int val);
83  vtkGetMacro(NumberOfSteps, int);
85 
87 
90  void SetStepSize(double val);
91  vtkGetMacro(StepSize, double);
93 
95 
106  void SetNormalizeVectors(int val);
107  vtkBooleanMacro(NormalizeVectors, int);
108  vtkGetMacro(NormalizeVectors, int);
110 
112 
117  void SetMaskOnSurface(int val);
118  vtkBooleanMacro(MaskOnSurface, int);
119  vtkGetMacro(MaskOnSurface, int);
121 
123 
139  void SetMaskThreshold(double val);
140  vtkGetMacro(MaskThreshold, double);
142 
144 
149  void SetMaskColor(double* val);
150  void SetMaskColor(double r, double g, double b)
151  {
152  double rgb[3] = { r, g, b };
153  this->SetMaskColor(rgb);
154  }
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  {
218  ENHANCE_CONTRAST_OFF = 0,
219  ENHANCE_CONTRAST_LIC = 1,
220  ENHANCE_CONTRAST_COLOR = 3,
221  ENHANCE_CONTRAST_BOTH = 4
222  };
223  void SetEnhanceContrast(int val);
224  vtkGetMacro(EnhanceContrast, int);
226 
228 
244  vtkGetMacro(LowLICContrastEnhancementFactor, double);
245  vtkGetMacro(HighLICContrastEnhancementFactor, double);
248  //
249  vtkGetMacro(LowColorContrastEnhancementFactor, double);
250  vtkGetMacro(HighColorContrastEnhancementFactor, double);
254 
256 
262  void SetAntiAlias(int val);
263  vtkBooleanMacro(AntiAlias, int);
264  vtkGetMacro(AntiAlias, int);
266 
268 
277  enum
278  {
279  COLOR_MODE_BLEND = 0,
280  COLOR_MODE_MAP
281  };
282  void SetColorMode(int val);
283  vtkGetMacro(ColorMode, int);
285 
287 
296  void SetLICIntensity(double val);
297  vtkGetMacro(LICIntensity, double);
299 
301 
308  void SetMapModeBias(double val);
309  vtkGetMacro(MapModeBias, double);
311 
313 
321 
323 
342  void SetGenerateNoiseTexture(int shouldGenerate);
343  vtkGetMacro(GenerateNoiseTexture, int);
345 
347 
352  enum
353  {
354  NOISE_TYPE_UNIFORM = 0,
355  NOISE_TYPE_GAUSSIAN = 1,
356  NOISE_TYPE_PERLIN = 2
357  };
358  void SetNoiseType(int type);
359  vtkGetMacro(NoiseType, int);
361 
363 
368  vtkGetMacro(NoiseTextureSize, int);
370 
372 
375  void SetNoiseGrainSize(int val);
376  vtkGetMacro(NoiseGrainSize, int);
378 
380 
386  void SetMinNoiseValue(double val);
387  void SetMaxNoiseValue(double val);
388  vtkGetMacro(MinNoiseValue, double);
389  vtkGetMacro(MaxNoiseValue, double);
391 
393 
397  void SetNumberOfNoiseLevels(int val);
398  vtkGetMacro(NumberOfNoiseLevels, int);
400 
402 
406  void SetImpulseNoiseProbability(double val);
407  vtkGetMacro(ImpulseNoiseProbability, double);
409 
411 
415  vtkGetMacro(ImpulseNoiseBackgroundValue, double);
417 
419 
422  void SetNoiseGeneratorSeed(int val);
423  vtkGetMacro(NoiseGeneratorSeed, int);
425 
427 
430  enum
431  {
432  COMPOSITE_INPLACE = 0,
433  COMPOSITE_INPLACE_DISJOINT = 1,
434  COMPOSITE_BALANCED = 2,
435  COMPOSITE_AUTO = 3
436  };
437  void SetCompositeStrategy(int val);
438  vtkGetMacro(CompositeStrategy, int);
440 
445  static bool IsSupported(vtkRenderWindow* context);
446 
453  virtual void WriteTimerLog(const char*) {}
454 
459 
466 
471 
475  void ValidateContext(vtkRenderer* renderer);
476 
484 
490 
492 
498 
500 
503  void SetHasVectors(bool val);
506 
511 
515  void ApplyLIC();
517  void CopyToScreen();
518 
524  virtual void GetGlobalMinMax(vtkPainterCommunicator*, float&, float&) {}
525 
527 
530  vtkSetMacro(Enable, int);
531  vtkGetMacro(Enable, int);
532  vtkBooleanMacro(Enable, int);
534 
535 protected:
538 
543 
545 
548  virtual bool NeedToUpdateCommunicator();
549  bool NeedToRenderGeometry(vtkRenderer* renderer, vtkActor* actor);
553  void SetUpdateAll();
555 
556  int Enable;
557 
558  // Unit is a pixel length.
560  double StepSize;
562 
570 
574  double MaskColor[3];
575 
577  double LICIntensity;
578  double MapModeBias;
579 
590 
593 
595 
596 private:
598  void operator=(const vtkSurfaceLICInterface&) = delete;
599 };
600 
601 #endif
602 // VTK-HeaderTest-Exclude: vtkSurfaceLICInterface.h
vtkSurfaceLICInterface::NoiseType
int NoiseType
Definition: vtkSurfaceLICInterface.h:581
vtkSurfaceLICInterface::NoiseGrainSize
int NoiseGrainSize
Definition: vtkSurfaceLICInterface.h:583
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:568
vtkSurfaceLICInterface::MapModeBias
double MapModeBias
Definition: vtkSurfaceLICInterface.h:578
vtkSurfaceLICInterface::GatherVectors
void GatherVectors()
vtkSurfaceLICInterface::GetGlobalMinMax
virtual void GetGlobalMinMax(vtkPainterCommunicator *, float &, float &)
Get the min/max across all ranks.
Definition: vtkSurfaceLICInterface.h:524
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:573
vtkSurfaceLICInterface::NeedToRenderGeometry
bool NeedToRenderGeometry(vtkRenderer *renderer, vtkActor *actor)
vtkX3D::type
@ type
Definition: vtkX3D.h:522
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:577
vtkSurfaceLICInterface::SetNoiseDataSet
void SetNoiseDataSet(vtkImageData *data)
Set the data containing a noise array as active scalars.
vtkX3D::data
@ data
Definition: vtkX3D.h:321
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:566
vtkSurfaceLICInterface::StepSize
double StepSize
Definition: vtkSurfaceLICInterface.h:560
vtkSurfaceLICInterface::MinNoiseValue
double MinNoiseValue
Definition: vtkSurfaceLICInterface.h:584
vtkSurfaceLICInterface::PrintSelf
void PrintSelf(ostream &os, vtkIndent indent) override
Methods invoked by print to print information about the object including superclasses.
vtkSurfaceLICInterface::CompositeStrategy
int CompositeStrategy
Definition: vtkSurfaceLICInterface.h:592
vtkSurfaceLICInterface::AlwaysUpdate
int AlwaysUpdate
Definition: vtkSurfaceLICInterface.h:591
vtkSurfaceLICInterface
public API for surface lic parameters arbitrary geometry.
Definition: vtkSurfaceLICInterface.h:72
vtkObject
abstract base class for most VTK objects
Definition: vtkObject.h:54
vtkSurfaceLICInterface::SetLowLICContrastEnhancementFactor
void SetLowLICContrastEnhancementFactor(double val)
vtkSurfaceLICInterface::SetLowColorContrastEnhancementFactor
void SetLowColorContrastEnhancementFactor(double val)
vtkSurfaceLICHelper
A small collection of noise routines for LIC.
Definition: vtkSurfaceLICHelper.h:45
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:563
vtkSurfaceLICInterface::MaskThreshold
double MaskThreshold
Definition: vtkSurfaceLICInterface.h:572
vtkSurfaceLICInterface::SetMaskColor
void SetMaskColor(double r, double g, double b)
Definition: vtkSurfaceLICInterface.h:150
vtkX3D::length
@ length
Definition: vtkX3D.h:399
vtkSurfaceLICInterface::NormalizeVectors
int NormalizeVectors
Definition: vtkSurfaceLICInterface.h:561
vtkSurfaceLICInterface::NoiseGeneratorSeed
int NoiseGeneratorSeed
Definition: vtkSurfaceLICInterface.h:589
vtkDataArray
abstract superclass for arrays of numeric data
Definition: vtkDataArray.h:50
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:453
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:571
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:585
vtkSurfaceLICInterface::Internals
vtkSurfaceLICHelper * Internals
Definition: vtkSurfaceLICInterface.h:594
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:576
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::LowLICContrastEnhancementFactor
double LowLICContrastEnhancementFactor
Definition: vtkSurfaceLICInterface.h:565
vtkActor
represents an object (geometry & properties) in a rendered scene
Definition: vtkActor.h:46
vtkSurfaceLICInterface::PrepareForGeometry
void PrepareForGeometry()
vtkImageData
topologically and geometrically regular array of data
Definition: vtkImageData.h:42
vtkIndent
a simple class to control print indentation
Definition: vtkIndent.h:34
vtkSurfaceLICInterface::SetMapModeBias
void SetMapModeBias(double val)
Factor used when blend mode is set to COLOR_MODE_MAP.
vtkSurfaceLICInterface::ImpulseNoiseBackgroundValue
double ImpulseNoiseBackgroundValue
Definition: vtkSurfaceLICInterface.h:588
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:559
vtkSurfaceLICInterface::SetHighLICContrastEnhancementFactor
void SetHighLICContrastEnhancementFactor(double val)
vtkSurfaceLICInterface::UpdateNoiseImage
void UpdateNoiseImage(vtkRenderWindow *renWin)
Updates the noise texture, downsampling by the requested sample rate.
vtkSurfaceLICInterface::~vtkSurfaceLICInterface
~vtkSurfaceLICInterface() override
vtkSurfaceLICInterface::SetImpulseNoiseProbability
void SetImpulseNoiseProbability(double val)
Control the density of the noise.
vtkPainterCommunicator
A communicator that can safely be used inside a painter.
Definition: vtkPainterCommunicator.h:31
vtkSurfaceLICInterface::AntiAlias
int AntiAlias
Definition: vtkSurfaceLICInterface.h:569
vtkSurfaceLICInterface::NeedToGatherVectors
bool NeedToGatherVectors()
vtkSurfaceLICInterface::GenerateNoiseTexture
int GenerateNoiseTexture
Definition: vtkSurfaceLICInterface.h:580
vtkSurfaceLICInterface::LowColorContrastEnhancementFactor
double LowColorContrastEnhancementFactor
Definition: vtkSurfaceLICInterface.h:567
vtkSurfaceLICInterface::SetHasVectors
void SetHasVectors(bool val)
Does the data have vectors which we require.
vtkRenderer
abstract specification for renderers
Definition: vtkRenderer.h:59
vtkSurfaceLICInterface::EnhanceContrast
int EnhanceContrast
Definition: vtkSurfaceLICInterface.h:564
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:587
vtkSurfaceLICInterface::NoiseTextureSize
int NoiseTextureSize
Definition: vtkSurfaceLICInterface.h:582
vtkRenderWindow
create a window for renderers to draw into
Definition: vtkRenderWindow.h:85
vtkSurfaceLICInterface::SetNoiseType
void SetNoiseType(int type)
vtkSurfaceLICInterface::Enable
int Enable
Definition: vtkSurfaceLICInterface.h:556
vtkSurfaceLICInterface::SetStepSize
void SetStepSize(double val)
Get/Set the step size (in pixels).
vtkDataObject
general representation of visualization data
Definition: vtkDataObject.h:60
vtkOpenGLPolyDataMapper.h
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:586
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.