VTK  9.2.6
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=========================================================================*/
59#ifndef vtkSurfaceLICInterface_h
60#define vtkSurfaceLICInterface_h
61
62#include "vtkObject.h"
63#include "vtkRenderingLICOpenGL2Module.h" // For export macro
64
65class vtkRenderWindow;
66class vtkRenderer;
67class vtkActor;
68class vtkImageData;
69class vtkDataObject;
70class vtkDataArray;
73class vtkWindow;
74
75class VTKRENDERINGLICOPENGL2_EXPORT vtkSurfaceLICInterface : public vtkObject
76{
77public:
80 void PrintSelf(ostream& os, vtkIndent indent) override;
81
83
86 void SetNumberOfSteps(int val);
87 vtkGetMacro(NumberOfSteps, int);
89
91
94 void SetStepSize(double val);
95 vtkGetMacro(StepSize, double);
97
99
110 void SetNormalizeVectors(int val);
111 vtkBooleanMacro(NormalizeVectors, int);
112 vtkGetMacro(NormalizeVectors, int);
114
116
121 void SetMaskOnSurface(int val);
122 vtkBooleanMacro(MaskOnSurface, int);
123 vtkGetMacro(MaskOnSurface, int);
125
127
143 void SetMaskThreshold(double val);
144 vtkGetMacro(MaskThreshold, double);
146
148
153 void SetMaskColor(double* val);
154 void SetMaskColor(double r, double g, double b)
155 {
156 double rgb[3] = { r, g, b };
157 this->SetMaskColor(rgb);
158 }
159 vtkGetVector3Macro(MaskColor, double);
161
163
171 void SetMaskIntensity(double val);
172 vtkGetMacro(MaskIntensity, double);
174
176
181 void SetEnhancedLIC(int val);
182 vtkGetMacro(EnhancedLIC, int);
183 vtkBooleanMacro(EnhancedLIC, int);
185
187
220 enum
221 {
222 ENHANCE_CONTRAST_OFF = 0,
223 ENHANCE_CONTRAST_LIC = 1,
224 ENHANCE_CONTRAST_COLOR = 3,
225 ENHANCE_CONTRAST_BOTH = 4
226 };
227 void SetEnhanceContrast(int val);
228 vtkGetMacro(EnhanceContrast, int);
230
232
248 vtkGetMacro(LowLICContrastEnhancementFactor, double);
249 vtkGetMacro(HighLICContrastEnhancementFactor, double);
252 //
253 vtkGetMacro(LowColorContrastEnhancementFactor, double);
254 vtkGetMacro(HighColorContrastEnhancementFactor, double);
258
260
266 void SetAntiAlias(int val);
267 vtkBooleanMacro(AntiAlias, int);
268 vtkGetMacro(AntiAlias, int);
270
272
281 enum
282 {
283 COLOR_MODE_BLEND = 0,
284 COLOR_MODE_MAP
285 };
286 void SetColorMode(int val);
287 vtkGetMacro(ColorMode, int);
289
291
300 void SetLICIntensity(double val);
301 vtkGetMacro(LICIntensity, double);
303
305
312 void SetMapModeBias(double val);
313 vtkGetMacro(MapModeBias, double);
315
317
325
327
346 void SetGenerateNoiseTexture(int shouldGenerate);
347 vtkGetMacro(GenerateNoiseTexture, int);
349
351
356 enum
357 {
358 NOISE_TYPE_UNIFORM = 0,
359 NOISE_TYPE_GAUSSIAN = 1,
360 NOISE_TYPE_PERLIN = 2
361 };
362 void SetNoiseType(int type);
363 vtkGetMacro(NoiseType, int);
365
367
371 void SetNoiseTextureSize(int length);
372 vtkGetMacro(NoiseTextureSize, int);
374
376
379 void SetNoiseGrainSize(int val);
380 vtkGetMacro(NoiseGrainSize, int);
382
384
390 void SetMinNoiseValue(double val);
391 void SetMaxNoiseValue(double val);
392 vtkGetMacro(MinNoiseValue, double);
393 vtkGetMacro(MaxNoiseValue, double);
395
397
402 vtkGetMacro(NumberOfNoiseLevels, int);
404
406
411 vtkGetMacro(ImpulseNoiseProbability, double);
413
415
419 vtkGetMacro(ImpulseNoiseBackgroundValue, double);
421
423
427 vtkGetMacro(NoiseGeneratorSeed, int);
429
431
434 enum
435 {
436 COMPOSITE_INPLACE = 0,
437 COMPOSITE_INPLACE_DISJOINT = 1,
438 COMPOSITE_BALANCED = 2,
439 COMPOSITE_AUTO = 3
440 };
441 void SetCompositeStrategy(int val);
442 vtkGetMacro(CompositeStrategy, int);
444
449 static bool IsSupported(vtkRenderWindow* context);
450
457 virtual void WriteTimerLog(const char*) {}
458
463
470
475
480
488
494
496
501 void UpdateCommunicator(vtkRenderer* renderer, vtkActor* actor, vtkDataObject* data);
502
504
507 void SetHasVectors(bool val);
510
515
519 void ApplyLIC();
522
528 virtual void GetGlobalMinMax(vtkPainterCommunicator*, float&, float&) {}
529
531
534 vtkSetMacro(Enable, int);
535 vtkGetMacro(Enable, int);
536 vtkBooleanMacro(Enable, int);
538
539protected:
542
547
549
559
561
562 // Unit is a pixel length.
564 double StepSize;
566
574
578 double MaskColor[3];
579
583
594
597
599
600private:
602 void operator=(const vtkSurfaceLICInterface&) = delete;
603};
604
605#endif
represents an object (geometry & properties) in a rendered scene
Definition vtkActor.h:52
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:40
abstract base class for most VTK objects
Definition vtkObject.h:63
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:73
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:39