VTK  9.4.20250206
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#include "vtkWrappingHints.h" // For VTK_MARSHALAUTO
53
54VTK_ABI_NAMESPACE_BEGIN
55class vtkRenderWindow;
56class vtkRenderer;
57class vtkActor;
58class vtkImageData;
59class vtkDataObject;
60class vtkDataArray;
63class vtkWindow;
64
65class VTKRENDERINGLICOPENGL2_EXPORT VTK_MARSHALAUTO vtkSurfaceLICInterface : public vtkObject
66{
67public:
70 void PrintSelf(ostream& os, vtkIndent indent) override;
71
73
76 void SetNumberOfSteps(int val);
77 vtkGetMacro(NumberOfSteps, int);
79
81
84 void SetStepSize(double val);
85 vtkGetMacro(StepSize, double);
87
89
100 void SetNormalizeVectors(int val);
101 vtkBooleanMacro(NormalizeVectors, int);
102 vtkGetMacro(NormalizeVectors, int);
104
106
111 void SetMaskOnSurface(int val);
112 vtkBooleanMacro(MaskOnSurface, int);
113 vtkGetMacro(MaskOnSurface, int);
115
117
133 void SetMaskThreshold(double val);
134 vtkGetMacro(MaskThreshold, double);
136
138
143 void SetMaskColor(double* val);
144 void SetMaskColor(double r, double g, double b)
145 {
146 double rgb[3] = { r, g, b };
147 this->SetMaskColor(rgb);
148 }
149 vtkGetVector3Macro(MaskColor, double);
151
153
161 void SetMaskIntensity(double val);
162 vtkGetMacro(MaskIntensity, double);
164
166
171 void SetEnhancedLIC(int val);
172 vtkGetMacro(EnhancedLIC, int);
173 vtkBooleanMacro(EnhancedLIC, int);
175
177
210 enum
211 {
212 ENHANCE_CONTRAST_OFF = 0,
213 ENHANCE_CONTRAST_LIC = 1,
214 ENHANCE_CONTRAST_COLOR = 3,
215 ENHANCE_CONTRAST_BOTH = 4
216 };
217 void SetEnhanceContrast(int val);
218 vtkGetMacro(EnhanceContrast, int);
220
222
238 vtkGetMacro(LowLICContrastEnhancementFactor, double);
239 vtkGetMacro(HighLICContrastEnhancementFactor, double);
242 //
243 vtkGetMacro(LowColorContrastEnhancementFactor, double);
244 vtkGetMacro(HighColorContrastEnhancementFactor, double);
248
250
256 void SetAntiAlias(int val);
257 vtkBooleanMacro(AntiAlias, int);
258 vtkGetMacro(AntiAlias, int);
260
262
271 enum
272 {
273 COLOR_MODE_BLEND = 0,
274 COLOR_MODE_MAP
275 };
276 void SetColorMode(int val);
277 vtkGetMacro(ColorMode, int);
279
281
290 void SetLICIntensity(double val);
291 vtkGetMacro(LICIntensity, double);
293
295
302 void SetMapModeBias(double val);
303 vtkGetMacro(MapModeBias, double);
305
307
315
317
336 void SetGenerateNoiseTexture(int shouldGenerate);
337 vtkGetMacro(GenerateNoiseTexture, int);
339
341
346 enum
347 {
348 NOISE_TYPE_UNIFORM = 0,
349 NOISE_TYPE_GAUSSIAN = 1,
350 NOISE_TYPE_PERLIN = 2
351 };
352 void SetNoiseType(int type);
353 vtkGetMacro(NoiseType, int);
355
357
361 void SetNoiseTextureSize(int length);
362 vtkGetMacro(NoiseTextureSize, int);
364
366
369 void SetNoiseGrainSize(int val);
370 vtkGetMacro(NoiseGrainSize, int);
372
374
380 void SetMinNoiseValue(double val);
381 void SetMaxNoiseValue(double val);
382 vtkGetMacro(MinNoiseValue, double);
383 vtkGetMacro(MaxNoiseValue, double);
385
387
392 vtkGetMacro(NumberOfNoiseLevels, int);
394
396
401 vtkGetMacro(ImpulseNoiseProbability, double);
403
405
409 vtkGetMacro(ImpulseNoiseBackgroundValue, double);
411
413
417 vtkGetMacro(NoiseGeneratorSeed, int);
419
421
424 enum
425 {
426 COMPOSITE_INPLACE = 0,
427 COMPOSITE_INPLACE_DISJOINT = 1,
428 COMPOSITE_BALANCED = 2,
429 COMPOSITE_AUTO = 3
430 };
431 void SetCompositeStrategy(int val);
432 vtkGetMacro(CompositeStrategy, int);
434
439 static bool IsSupported(vtkRenderWindow* context);
440
447 virtual void WriteTimerLog(const char*) {}
448
453
460
465
470
478
484
486
491 void UpdateCommunicator(vtkRenderer* renderer, vtkActor* actor, vtkDataObject* data);
492
494
497 void SetHasVectors(bool val);
500
505
509 void ApplyLIC();
512
518 virtual void GetGlobalMinMax(vtkPainterCommunicator*, float&, float&) {}
519
521
524 vtkSetMacro(Enable, int);
525 vtkGetMacro(Enable, int);
526 vtkBooleanMacro(Enable, int);
528
529protected:
532
537
539
549
551
552 // Unit is a pixel length.
554 double StepSize;
556
564
568 double MaskColor[3];
569
573
584
587
589
590private:
592 void operator=(const vtkSurfaceLICInterface&) = delete;
593};
594
595VTK_ABI_NAMESPACE_END
596#endif
represents an object (geometry & properties) in a rendered scene
Definition vtkActor.h:151
abstract superclass for arrays of numeric data
general representation of visualization data
topologically and geometrically regular array of data
a simple class to control print indentation
Definition vtkIndent.h:108
abstract base class for most VTK objects
Definition vtkObject.h:162
A communicator that can safely be used inside a painter.
create a window for renderers to draw into
abstract specification for renderers
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.
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.
vtkImageData * GetNoiseDataSet()
Set the data containing a noise array as active scalars.
void UpdateCommunicator(vtkRenderer *renderer, vtkActor *actor, vtkDataObject *data)
Called from a mapper, does what is needed to make sure the communicators are ready.
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.
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.
virtual vtkPainterCommunicator * CreateCommunicator(int)
Creates a new communicator with/without the calling processes as indicated by the passed in flag,...
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.
static vtkSurfaceLICInterface * New()
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.
vtkPainterCommunicator * GetCommunicator()
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:48
#define VTK_MARSHALAUTO