VTK  9.3.20240328
vtkSurfaceLICInterface.h
Go to the documentation of this file.
1 // SPDX-FileCopyrightText: Copyright (c) Ken Martin, Will Schroeder, Bill Lorensen
2 // SPDX-License-Identifier: BSD-3-Clause
47 #ifndef vtkSurfaceLICInterface_h
48 #define vtkSurfaceLICInterface_h
49 
50 #include "vtkObject.h"
51 #include "vtkRenderingLICOpenGL2Module.h" // For export macro
52 
53 VTK_ABI_NAMESPACE_BEGIN
54 class vtkRenderWindow;
55 class vtkRenderer;
56 class vtkActor;
57 class vtkImageData;
58 class vtkDataObject;
59 class vtkDataArray;
62 class vtkWindow;
63 
64 class VTKRENDERINGLICOPENGL2_EXPORT vtkSurfaceLICInterface : public vtkObject
65 {
66 public:
69  void PrintSelf(ostream& os, vtkIndent indent) override;
70 
72 
75  void SetNumberOfSteps(int val);
76  vtkGetMacro(NumberOfSteps, int);
78 
80 
83  void SetStepSize(double val);
84  vtkGetMacro(StepSize, double);
86 
88 
99  void SetNormalizeVectors(int val);
100  vtkBooleanMacro(NormalizeVectors, int);
101  vtkGetMacro(NormalizeVectors, int);
103 
105 
110  void SetMaskOnSurface(int val);
111  vtkBooleanMacro(MaskOnSurface, int);
112  vtkGetMacro(MaskOnSurface, int);
114 
116 
132  void SetMaskThreshold(double val);
133  vtkGetMacro(MaskThreshold, double);
135 
137 
142  void SetMaskColor(double* val);
143  void SetMaskColor(double r, double g, double b)
144  {
145  double rgb[3] = { r, g, b };
146  this->SetMaskColor(rgb);
147  }
148  vtkGetVector3Macro(MaskColor, double);
150 
152 
160  void SetMaskIntensity(double val);
161  vtkGetMacro(MaskIntensity, double);
163 
165 
170  void SetEnhancedLIC(int val);
171  vtkGetMacro(EnhancedLIC, int);
172  vtkBooleanMacro(EnhancedLIC, int);
174 
176 
209  enum
210  {
211  ENHANCE_CONTRAST_OFF = 0,
212  ENHANCE_CONTRAST_LIC = 1,
213  ENHANCE_CONTRAST_COLOR = 3,
214  ENHANCE_CONTRAST_BOTH = 4
215  };
216  void SetEnhanceContrast(int val);
217  vtkGetMacro(EnhanceContrast, int);
219 
221 
237  vtkGetMacro(LowLICContrastEnhancementFactor, double);
238  vtkGetMacro(HighLICContrastEnhancementFactor, double);
241  //
242  vtkGetMacro(LowColorContrastEnhancementFactor, double);
243  vtkGetMacro(HighColorContrastEnhancementFactor, double);
247 
249 
255  void SetAntiAlias(int val);
256  vtkBooleanMacro(AntiAlias, int);
257  vtkGetMacro(AntiAlias, int);
259 
261 
270  enum
271  {
272  COLOR_MODE_BLEND = 0,
273  COLOR_MODE_MAP
274  };
275  void SetColorMode(int val);
276  vtkGetMacro(ColorMode, int);
278 
280 
289  void SetLICIntensity(double val);
290  vtkGetMacro(LICIntensity, double);
292 
294 
301  void SetMapModeBias(double val);
302  vtkGetMacro(MapModeBias, double);
304 
306 
314 
316 
335  void SetGenerateNoiseTexture(int shouldGenerate);
336  vtkGetMacro(GenerateNoiseTexture, int);
338 
340 
345  enum
346  {
347  NOISE_TYPE_UNIFORM = 0,
348  NOISE_TYPE_GAUSSIAN = 1,
349  NOISE_TYPE_PERLIN = 2
350  };
351  void SetNoiseType(int type);
352  vtkGetMacro(NoiseType, int);
354 
356 
361  vtkGetMacro(NoiseTextureSize, int);
363 
365 
368  void SetNoiseGrainSize(int val);
369  vtkGetMacro(NoiseGrainSize, int);
371 
373 
379  void SetMinNoiseValue(double val);
380  void SetMaxNoiseValue(double val);
381  vtkGetMacro(MinNoiseValue, double);
382  vtkGetMacro(MaxNoiseValue, double);
384 
386 
390  void SetNumberOfNoiseLevels(int val);
391  vtkGetMacro(NumberOfNoiseLevels, int);
393 
395 
399  void SetImpulseNoiseProbability(double val);
400  vtkGetMacro(ImpulseNoiseProbability, double);
402 
404 
408  vtkGetMacro(ImpulseNoiseBackgroundValue, double);
410 
412 
415  void SetNoiseGeneratorSeed(int val);
416  vtkGetMacro(NoiseGeneratorSeed, int);
418 
420 
423  enum
424  {
425  COMPOSITE_INPLACE = 0,
426  COMPOSITE_INPLACE_DISJOINT = 1,
427  COMPOSITE_BALANCED = 2,
428  COMPOSITE_AUTO = 3
429  };
430  void SetCompositeStrategy(int val);
431  vtkGetMacro(CompositeStrategy, int);
433 
438  static bool IsSupported(vtkRenderWindow* context);
439 
446  virtual void WriteTimerLog(const char*) {}
447 
452 
459 
464 
468  void ValidateContext(vtkRenderer* renderer);
469 
477 
483 
485 
491 
493 
496  void SetHasVectors(bool val);
499 
504 
508  void ApplyLIC();
510  void CopyToScreen();
511 
517  virtual void GetGlobalMinMax(vtkPainterCommunicator*, float&, float&) {}
518 
520 
523  vtkSetMacro(Enable, int);
524  vtkGetMacro(Enable, int);
525  vtkBooleanMacro(Enable, int);
527 
528 protected:
531 
536 
538 
541  virtual bool NeedToUpdateCommunicator();
542  bool NeedToRenderGeometry(vtkRenderer* renderer, vtkActor* actor);
546  void SetUpdateAll();
548 
549  int Enable;
550 
551  // Unit is a pixel length.
553  double StepSize;
555 
563 
567  double MaskColor[3];
568 
570  double LICIntensity;
571  double MapModeBias;
572 
583 
586 
588 
589 private:
591  void operator=(const vtkSurfaceLICInterface&) = delete;
592 };
593 
594 VTK_ABI_NAMESPACE_END
595 #endif
represents an object (geometry & properties) in a rendered scene
Definition: vtkActor.h:150
abstract superclass for arrays of numeric data
Definition: vtkDataArray.h:154
general representation of visualization data
topologically and geometrically regular array of data
Definition: vtkImageData.h:155
a simple class to control print indentation
Definition: vtkIndent.h:108
abstract base class for most VTK objects
Definition: vtkObject.h:161
A communicator that can safely be used inside a painter.
create a window for renderers to draw into
abstract specification for renderers
Definition: vtkRenderer.h:171
A small collection of noise routines for LIC.
public API for surface lic parameters arbitrary geometry.
void SetNormalizeVectors(int val)
Normalize vectors during integration.
virtual void GetGlobalMinMax(vtkPainterCommunicator *, float &, float &)
Get the min/max across all ranks.
static vtkSurfaceLICInterface * New()
vtkImageData * GetNoiseDataSet()
Set the data containing a noise array as active scalars.
void SetCompositeStrategy(int val)
Control the screen space decomposition where LIC is computed.
void SetNoiseTextureSize(int length)
Set/Get the side length in pixels of the noise texture.
void SetHasVectors(bool val)
Does the data have vectors which we require.
void SetNoiseGeneratorSeed(int val)
Set/Get the seed value used by the random number generator.
void InitializeResources()
resoucre allocators
void SetAntiAlias(int val)
Enable/Disable the anti-aliasing pass.
virtual bool NeedToUpdateCommunicator()
Return false if stage can be skipped.
void SetImpulseNoiseBackgroundValue(double val)
The color to use for untouched pixels when impulse noise probability < 1.
void UpdateCommunicator(vtkRenderer *renderer, vtkActor *actor, vtkDataObject *data)
Called from a mapper, does what is needed to make sure the communicators are ready.
virtual vtkPainterCommunicator * CreateCommunicator(int)
Creates a new communicator with/without the calling processes as indicated by the passed in flag,...
vtkSurfaceLICHelper * Internals
void SetMapModeBias(double val)
Factor used when blend mode is set to COLOR_MODE_MAP.
bool NeedToComputeLIC()
Return false if stage can be skipped.
void SetLICIntensity(double val)
Factor used when blend mode is set to COLOR_MODE_BLEND.
void SetNumberOfSteps(int val)
Get/Set the number of integration steps in each direction.
void PrintSelf(ostream &os, vtkIndent indent) override
Methods invoked by print to print information about the object including superclasses.
vtkPainterCommunicator * GetCommunicator()
bool NeedToColorLIC()
Return false if stage can be skipped.
void SetLowColorContrastEnhancementFactor(double val)
This feature is used to fine tune the contrast enhancement.
~vtkSurfaceLICInterface() override
void ShallowCopy(vtkSurfaceLICInterface *m)
Make a shallow copy of this interface.
void SetMaxNoiseValue(double val)
Set/Get the minimum and mximum gray scale values that the generated noise can take on.
void SetNoiseGrainSize(int val)
Each noise value will be length^2 pixels in area.
bool GetHasVectors()
Does the data have vectors which we require.
void SetUpdateAll()
Return false if stage can be skipped.
static bool IsSupported(vtkRenderWindow *context)
Returns true if the rendering context supports extensions needed by this painter.
void SetImpulseNoiseProbability(double val)
Control the density of the noise.
bool NeedToRenderGeometry(vtkRenderer *renderer, vtkActor *actor)
Return false if stage can be skipped.
bool NeedToGatherVectors()
Return false if stage can be skipped.
void SetMaskColor(double r, double g, double b)
The MaskColor is used on masked fragments.
void SetEnhancedLIC(int val)
EnhancedLIC mean compute the LIC twice with the second pass using the edge-enhanced result of the fir...
void SetHighColorContrastEnhancementFactor(double val)
This feature is used to fine tune the contrast enhancement.
void SetColorMode(int val)
Set/Get the color mode.
virtual void ReleaseGraphicsResources(vtkWindow *win)
Release any graphics resources that are being consumed by this mapper.
void SetStepSize(double val)
Get/Set the step size (in pixels).
bool CanRenderSurfaceLIC(vtkActor *actor)
Returns true when rendering LIC is possible.
void SetNoiseType(int type)
Select the statistical distribution of randomly generated noise values.
void SetHighLICContrastEnhancementFactor(double val)
This feature is used to fine tune the contrast enhancement.
void SetEnhanceContrast(int val)
Enable/Disable contrast and dynamic range correction stages.
void SetNoiseDataSet(vtkImageData *data)
Set the data containing a noise array as active scalars.
void SetLowLICContrastEnhancementFactor(double val)
This feature is used to fine tune the contrast enhancement.
void SetNumberOfNoiseLevels(int val)
Set/Get the number of discrete values a noise pixel may take on.
void ValidateContext(vtkRenderer *renderer)
Look for changes that would trigger stage updates.
void SetMinNoiseValue(double val)
Set/Get the minimum and mximum gray scale values that the generated noise can take on.
virtual void WriteTimerLog(const char *)
Methods used for parallel benchmarks.
void SetMaskColor(double *val)
The MaskColor is used on masked fragments.
void SetMaskIntensity(double val)
The MaskIntensity controls the blending of the mask color and the geometry color.
void SetGenerateNoiseTexture(int shouldGenerate)
Set/Get the noise texture source.
void SetMaskThreshold(double val)
The MaskThreshold controls the rendering of fragments in stagnant regions of flow.
void CreateCommunicator(vtkRenderer *, vtkActor *, vtkDataObject *data)
Creates a new communicator for internal use based on this rank's visible data.
void UpdateNoiseImage(vtkRenderWindow *renWin)
Updates the noise texture, downsampling by the requested sample rate.
void SetMaskOnSurface(int val)
When set MaskOnSurface computes |V| for use in the fragment masking tests on the surface.
window superclass for vtkRenderWindow
Definition: vtkWindow.h:47
@ length
Definition: vtkX3D.h:393
@ type
Definition: vtkX3D.h:516
@ data
Definition: vtkX3D.h:315