VTK  9.1.0
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 
59 #include "vtkObject.h"
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 class vtkWindow;
71 
72 class VTKRENDERINGLICOPENGL2_EXPORT vtkSurfaceLICInterface : public vtkObject
73 {
74 public:
77  void PrintSelf(ostream& os, vtkIndent indent) override;
78 
80 
83  void SetNumberOfSteps(int val);
84  vtkGetMacro(NumberOfSteps, int);
86 
88 
91  void SetStepSize(double val);
92  vtkGetMacro(StepSize, double);
94 
96 
107  void SetNormalizeVectors(int val);
108  vtkBooleanMacro(NormalizeVectors, int);
109  vtkGetMacro(NormalizeVectors, int);
111 
113 
118  void SetMaskOnSurface(int val);
119  vtkBooleanMacro(MaskOnSurface, int);
120  vtkGetMacro(MaskOnSurface, int);
122 
124 
140  void SetMaskThreshold(double val);
141  vtkGetMacro(MaskThreshold, double);
143 
145 
150  void SetMaskColor(double* val);
151  void SetMaskColor(double r, double g, double b)
152  {
153  double rgb[3] = { r, g, b };
154  this->SetMaskColor(rgb);
155  }
156  vtkGetVector3Macro(MaskColor, double);
158 
160 
168  void SetMaskIntensity(double val);
169  vtkGetMacro(MaskIntensity, double);
171 
173 
178  void SetEnhancedLIC(int val);
179  vtkGetMacro(EnhancedLIC, int);
180  vtkBooleanMacro(EnhancedLIC, int);
182 
184 
217  enum
218  {
219  ENHANCE_CONTRAST_OFF = 0,
220  ENHANCE_CONTRAST_LIC = 1,
221  ENHANCE_CONTRAST_COLOR = 3,
222  ENHANCE_CONTRAST_BOTH = 4
223  };
224  void SetEnhanceContrast(int val);
225  vtkGetMacro(EnhanceContrast, int);
227 
229 
245  vtkGetMacro(LowLICContrastEnhancementFactor, double);
246  vtkGetMacro(HighLICContrastEnhancementFactor, double);
249  //
250  vtkGetMacro(LowColorContrastEnhancementFactor, double);
251  vtkGetMacro(HighColorContrastEnhancementFactor, double);
255 
257 
263  void SetAntiAlias(int val);
264  vtkBooleanMacro(AntiAlias, int);
265  vtkGetMacro(AntiAlias, int);
267 
269 
278  enum
279  {
280  COLOR_MODE_BLEND = 0,
281  COLOR_MODE_MAP
282  };
283  void SetColorMode(int val);
284  vtkGetMacro(ColorMode, int);
286 
288 
297  void SetLICIntensity(double val);
298  vtkGetMacro(LICIntensity, double);
300 
302 
309  void SetMapModeBias(double val);
310  vtkGetMacro(MapModeBias, double);
312 
314 
322 
324 
343  void SetGenerateNoiseTexture(int shouldGenerate);
344  vtkGetMacro(GenerateNoiseTexture, int);
346 
348 
353  enum
354  {
355  NOISE_TYPE_UNIFORM = 0,
356  NOISE_TYPE_GAUSSIAN = 1,
357  NOISE_TYPE_PERLIN = 2
358  };
359  void SetNoiseType(int type);
360  vtkGetMacro(NoiseType, int);
362 
364 
369  vtkGetMacro(NoiseTextureSize, int);
371 
373 
376  void SetNoiseGrainSize(int val);
377  vtkGetMacro(NoiseGrainSize, int);
379 
381 
387  void SetMinNoiseValue(double val);
388  void SetMaxNoiseValue(double val);
389  vtkGetMacro(MinNoiseValue, double);
390  vtkGetMacro(MaxNoiseValue, double);
392 
394 
398  void SetNumberOfNoiseLevels(int val);
399  vtkGetMacro(NumberOfNoiseLevels, int);
401 
403 
407  void SetImpulseNoiseProbability(double val);
408  vtkGetMacro(ImpulseNoiseProbability, double);
410 
412 
416  vtkGetMacro(ImpulseNoiseBackgroundValue, double);
418 
420 
423  void SetNoiseGeneratorSeed(int val);
424  vtkGetMacro(NoiseGeneratorSeed, int);
426 
428 
431  enum
432  {
433  COMPOSITE_INPLACE = 0,
434  COMPOSITE_INPLACE_DISJOINT = 1,
435  COMPOSITE_BALANCED = 2,
436  COMPOSITE_AUTO = 3
437  };
438  void SetCompositeStrategy(int val);
439  vtkGetMacro(CompositeStrategy, int);
441 
446  static bool IsSupported(vtkRenderWindow* context);
447 
454  virtual void WriteTimerLog(const char*) {}
455 
460 
467 
472 
476  void ValidateContext(vtkRenderer* renderer);
477 
485 
491 
493 
499 
501 
504  void SetHasVectors(bool val);
507 
512 
516  void ApplyLIC();
518  void CopyToScreen();
519 
525  virtual void GetGlobalMinMax(vtkPainterCommunicator*, float&, float&) {}
526 
528 
531  vtkSetMacro(Enable, int);
532  vtkGetMacro(Enable, int);
533  vtkBooleanMacro(Enable, int);
535 
536 protected:
539 
544 
546 
549  virtual bool NeedToUpdateCommunicator();
550  bool NeedToRenderGeometry(vtkRenderer* renderer, vtkActor* actor);
554  void SetUpdateAll();
556 
557  int Enable;
558 
559  // Unit is a pixel length.
561  double StepSize;
563 
571 
575  double MaskColor[3];
576 
578  double LICIntensity;
579  double MapModeBias;
580 
591 
594 
596 
597 private:
599  void operator=(const vtkSurfaceLICInterface&) = delete;
600 };
601 
602 #endif
vtkSurfaceLICInterface::NoiseType
int NoiseType
Definition: vtkSurfaceLICInterface.h:582
vtkSurfaceLICInterface::NoiseGrainSize
int NoiseGrainSize
Definition: vtkSurfaceLICInterface.h:584
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)
Set/Get the color mode.
vtkSurfaceLICInterface::NeedToComputeLIC
bool NeedToComputeLIC()
Return false if stage can be skipped.
vtkSurfaceLICInterface::HighColorContrastEnhancementFactor
double HighColorContrastEnhancementFactor
Definition: vtkSurfaceLICInterface.h:569
vtkSurfaceLICInterface::MapModeBias
double MapModeBias
Definition: vtkSurfaceLICInterface.h:579
vtkSurfaceLICInterface::GatherVectors
void GatherVectors()
vtkSurfaceLICInterface::GetGlobalMinMax
virtual void GetGlobalMinMax(vtkPainterCommunicator *, float &, float &)
Get the min/max across all ranks.
Definition: vtkSurfaceLICInterface.h:525
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:574
vtkSurfaceLICInterface::NeedToRenderGeometry
bool NeedToRenderGeometry(vtkRenderer *renderer, vtkActor *actor)
Return false if stage can be skipped.
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:578
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:567
vtkSurfaceLICInterface::StepSize
double StepSize
Definition: vtkSurfaceLICInterface.h:561
vtkSurfaceLICInterface::MinNoiseValue
double MinNoiseValue
Definition: vtkSurfaceLICInterface.h:585
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:593
vtkSurfaceLICInterface::AlwaysUpdate
int AlwaysUpdate
Definition: vtkSurfaceLICInterface.h:592
vtkSurfaceLICInterface
public API for surface lic parameters arbitrary geometry.
Definition: vtkSurfaceLICInterface.h:73
vtkObject
abstract base class for most VTK objects
Definition: vtkObject.h:82
vtkSurfaceLICInterface::SetLowLICContrastEnhancementFactor
void SetLowLICContrastEnhancementFactor(double val)
This feature is used to fine tune the contrast enhancement.
vtkSurfaceLICInterface::SetLowColorContrastEnhancementFactor
void SetLowColorContrastEnhancementFactor(double val)
This feature is used to fine tune the contrast enhancement.
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:564
vtkSurfaceLICInterface::MaskThreshold
double MaskThreshold
Definition: vtkSurfaceLICInterface.h:573
vtkSurfaceLICInterface::SetMaskColor
void SetMaskColor(double r, double g, double b)
The MaskColor is used on masked fragments.
Definition: vtkSurfaceLICInterface.h:151
vtkX3D::length
@ length
Definition: vtkX3D.h:399
vtkSurfaceLICInterface::NormalizeVectors
int NormalizeVectors
Definition: vtkSurfaceLICInterface.h:562
vtkSurfaceLICInterface::NoiseGeneratorSeed
int NoiseGeneratorSeed
Definition: vtkSurfaceLICInterface.h:590
vtkDataArray
abstract superclass for arrays of numeric data
Definition: vtkDataArray.h:159
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:454
vtkSurfaceLICInterface::NeedToUpdateCommunicator
virtual bool NeedToUpdateCommunicator()
Return false if stage can be skipped.
vtkWindow
window superclass for vtkRenderWindow
Definition: vtkWindow.h:39
vtkSurfaceLICInterface::SetNoiseTextureSize
void SetNoiseTextureSize(int length)
Set/Get the side length in pixels of the noise texture.
vtkSurfaceLICInterface::MaskOnSurface
int MaskOnSurface
Definition: vtkSurfaceLICInterface.h:572
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:586
vtkSurfaceLICInterface::Internals
vtkSurfaceLICHelper * Internals
Definition: vtkSurfaceLICInterface.h:595
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)
Enable/Disable contrast and dynamic range correction stages.
vtkSurfaceLICInterface::ColorMode
int ColorMode
Definition: vtkSurfaceLICInterface.h:577
vtkSurfaceLICInterface::CompletedGeometry
void CompletedGeometry()
vtkSurfaceLICInterface::SetNormalizeVectors
void SetNormalizeVectors(int val)
Normalize vectors during integration.
vtkSurfaceLICInterface::SetHighColorContrastEnhancementFactor
void SetHighColorContrastEnhancementFactor(double val)
This feature is used to fine tune the contrast enhancement.
vtkSurfaceLICInterface::SetMaskColor
void SetMaskColor(double *val)
The MaskColor is used on masked fragments.
vtkSurfaceLICInterface::GetHasVectors
bool GetHasVectors()
Does the data have vectors which we require.
vtkSurfaceLICInterface::ValidateContext
void ValidateContext(vtkRenderer *renderer)
Look for changes that would trigger stage updates.
vtkSurfaceLICInterface::LowLICContrastEnhancementFactor
double LowLICContrastEnhancementFactor
Definition: vtkSurfaceLICInterface.h:566
vtkActor
represents an object (geometry & properties) in a rendered scene
Definition: vtkActor.h:155
vtkSurfaceLICInterface::PrepareForGeometry
void PrepareForGeometry()
vtkImageData
topologically and geometrically regular array of data
Definition: vtkImageData.h:157
vtkIndent
a simple class to control print indentation
Definition: vtkIndent.h:113
vtkSurfaceLICInterface::SetMapModeBias
void SetMapModeBias(double val)
Factor used when blend mode is set to COLOR_MODE_MAP.
vtkSurfaceLICInterface::ImpulseNoiseBackgroundValue
double ImpulseNoiseBackgroundValue
Definition: vtkSurfaceLICInterface.h:589
vtkSurfaceLICInterface::CanRenderSurfaceLIC
bool CanRenderSurfaceLIC(vtkActor *actor)
Returns true when rendering LIC is possible.
vtkSurfaceLICInterface::ApplyLIC
void ApplyLIC()
vtkSurfaceLICInterface::SetMaxNoiseValue
void SetMaxNoiseValue(double val)
Set/Get the minimum and mximum gray scale values that the generated noise can take on.
vtkSurfaceLICInterface::New
static vtkSurfaceLICInterface * New()
vtkSurfaceLICInterface::SetCompositeStrategy
void SetCompositeStrategy(int val)
Control the screen space decomposition where LIC is computed.
vtkSurfaceLICInterface::NumberOfSteps
int NumberOfSteps
Definition: vtkSurfaceLICInterface.h:560
vtkSurfaceLICInterface::SetHighLICContrastEnhancementFactor
void SetHighLICContrastEnhancementFactor(double val)
This feature is used to fine tune the contrast enhancement.
vtkSurfaceLICInterface::UpdateNoiseImage
void UpdateNoiseImage(vtkRenderWindow *renWin)
Updates the noise texture, downsampling by the requested sample rate.
vtkObject.h
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:570
vtkSurfaceLICInterface::NeedToGatherVectors
bool NeedToGatherVectors()
Return false if stage can be skipped.
vtkSurfaceLICInterface::GenerateNoiseTexture
int GenerateNoiseTexture
Definition: vtkSurfaceLICInterface.h:581
vtkSurfaceLICInterface::LowColorContrastEnhancementFactor
double LowColorContrastEnhancementFactor
Definition: vtkSurfaceLICInterface.h:568
vtkSurfaceLICInterface::SetHasVectors
void SetHasVectors(bool val)
Does the data have vectors which we require.
vtkRenderer
abstract specification for renderers
Definition: vtkRenderer.h:182
vtkSurfaceLICInterface::EnhanceContrast
int EnhanceContrast
Definition: vtkSurfaceLICInterface.h:565
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()
Set the data containing a noise array as active scalars.
vtkSurfaceLICInterface::ImpulseNoiseProbability
double ImpulseNoiseProbability
Definition: vtkSurfaceLICInterface.h:588
vtkSurfaceLICInterface::NoiseTextureSize
int NoiseTextureSize
Definition: vtkSurfaceLICInterface.h:583
vtkRenderWindow
create a window for renderers to draw into
Definition: vtkRenderWindow.h:205
vtkSurfaceLICInterface::SetNoiseType
void SetNoiseType(int type)
Select the statistical distribution of randomly generated noise values.
vtkSurfaceLICInterface::Enable
int Enable
Definition: vtkSurfaceLICInterface.h:557
vtkSurfaceLICInterface::SetStepSize
void SetStepSize(double val)
Get/Set the step size (in pixels).
vtkDataObject
general representation of visualization data
Definition: vtkDataObject.h:169
vtkSurfaceLICInterface::SetUpdateAll
void SetUpdateAll()
Return false if stage can be skipped.
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:587
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()
Return false if stage can be skipped.
vtkSurfaceLICInterface::SetAntiAlias
void SetAntiAlias(int val)
Enable/Disable the anti-aliasing pass.