VTK
vtkSurfaceLICPainter.h
Go to the documentation of this file.
1/*=========================================================================
2
3 Program: Visualization Toolkit
4 Module: vtkSurfaceLICPainter.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 vtkSurfaceLICPainter_h
60#define vtkSurfaceLICPainter_h
61
62#include "vtkRenderingLICModule.h" // For export macro
63#include "vtkPainter.h"
64
65class vtkRenderWindow;
66class vtkRenderer;
67class vtkActor;
68class vtkImageData;
69class vtkDataObject;
70class vtkDataArray;
72
73class VTKRENDERINGLIC_EXPORT vtkSurfaceLICPainter : public vtkPainter
74{
75public:
78 void PrintSelf(ostream& os, vtkIndent indent);
79
86
94
96
99 void SetEnable(int val);
100 vtkGetMacro(Enable, int);
101 void SetEnableOn(){ this->SetEnable(1); }
102 void SetEnableOff(){ this->SetEnable(0); }
104
106
112 void SetInputArrayToProcess(int fieldAssociation, const char *name);
113 void SetInputArrayToProcess(int fieldAssociation, int fieldAttributeType);
115
117
120 void SetNumberOfSteps(int val);
121 vtkGetMacro(NumberOfSteps, int);
123
125
128 void SetStepSize(double val);
129 vtkGetMacro(StepSize, double);
131
133
144 void SetNormalizeVectors(int val);
145 vtkBooleanMacro(NormalizeVectors, int);
146 vtkGetMacro(NormalizeVectors, int);
148
150
155 void SetMaskOnSurface(int val);
156 vtkBooleanMacro(MaskOnSurface, int);
157 vtkGetMacro(MaskOnSurface, int);
159
161
177 void SetMaskThreshold(double val);
178 vtkGetMacro(MaskThreshold, double);
180
182
187 void SetMaskColor(double *val);
188 void SetMaskColor(double r, double g, double b)
189 { double rgb[3]={r,g,b}; this->SetMaskColor(rgb); }
190 vtkGetVector3Macro(MaskColor, double);
192
194
202 void SetMaskIntensity(double val);
203 vtkGetMacro(MaskIntensity, double);
205
207
212 void SetEnhancedLIC(int val);
213 vtkGetMacro(EnhancedLIC, int);
214 vtkBooleanMacro(EnhancedLIC, int);
216
218
251 enum {
252 ENHANCE_CONTRAST_OFF=0,
253 ENHANCE_CONTRAST_LIC=1,
254 ENHANCE_CONTRAST_COLOR=3,
255 ENHANCE_CONTRAST_BOTH=4
256 };
257 void SetEnhanceContrast(int val);
258 vtkGetMacro(EnhanceContrast, int);
260
262
278 vtkGetMacro(LowLICContrastEnhancementFactor, double);
279 vtkGetMacro(HighLICContrastEnhancementFactor, double);
282 //
283 vtkGetMacro(LowColorContrastEnhancementFactor, double);
284 vtkGetMacro(HighColorContrastEnhancementFactor, double);
288
290
296 void SetAntiAlias(int val);
297 vtkBooleanMacro(AntiAlias, int);
298 vtkGetMacro(AntiAlias, int);
300
302
311 enum {
312 COLOR_MODE_BLEND=0,
313 COLOR_MODE_MAP
314 };
315 void SetColorMode(int val);
316 vtkGetMacro(ColorMode, int);
318
320
329 void SetLICIntensity(double val);
330 vtkGetMacro(LICIntensity, double);
332
334
341 void SetMapModeBias(double val);
342 vtkGetMacro(MapModeBias, double);
344
346
354
356
375 void SetGenerateNoiseTexture(int shouldGenerate);
376 vtkGetMacro(GenerateNoiseTexture, int);
378
380
385 enum {
386 NOISE_TYPE_UNIFORM=0,
387 NOISE_TYPE_GAUSSIAN=1,
388 NOISE_TYPE_PERLIN=2
389 };
391 vtkGetMacro(NoiseType, int);
393
395
400 vtkGetMacro(NoiseTextureSize, int);
402
404
408 void SetNoiseGrainSize(int val);
409 vtkGetMacro(NoiseGrainSize, int);
411
413
419 void SetMinNoiseValue(double val);
420 void SetMaxNoiseValue(double val);
421 vtkGetMacro(MinNoiseValue, double);
422 vtkGetMacro(MaxNoiseValue, double);
424
426
431 vtkGetMacro(NumberOfNoiseLevels, int);
433
435
440 vtkGetMacro(ImpulseNoiseProbability, double);
442
444
448 vtkGetMacro(ImpulseNoiseBackgroundValue, double);
450
452
456 vtkGetMacro(NoiseGeneratorSeed, int);
458
460
463 enum {
464 COMPOSITE_INPLACE=0,
465 COMPOSITE_INPLACE_DISJOINT=1,
466 COMPOSITE_BALANCED=2,
467 COMPOSITE_AUTO=3
468 };
469 void SetCompositeStrategy(int val);
470 vtkGetMacro(CompositeStrategy, int);
472
477 static bool IsSupported(vtkRenderWindow *context);
478
485 virtual void WriteTimerLog(const char *){}
486
487protected:
490
497
503 virtual void GetGlobalMinMax(vtkPainterCommunicator*, float&, float&){}
504
511 virtual void StartTimerEvent(const char *){}
512 virtual void EndTimerEvent(const char *){}
513
521
527
531 void GetBounds(vtkDataObject* data, double bounds[6]);
532
536 void ReportReferences(vtkGarbageCollector *collector) VTK_OVERRIDE;
537
542
550 virtual void RenderInternal(
551 vtkRenderer* renderer,
552 vtkActor* actor,
553 unsigned long typeflags,
554 bool forceCompileOnly);
555
556
561
563
574
576
582
584
591
595 bool CanRenderSurfaceLIC(vtkActor *actor, int typeflags);
596
597protected:
598 // Unit is a pixel length.
600 double StepSize;
602
610
614 double MaskColor[3];
615
619
630
634
636 class vtkInternals;
637 vtkInternals* Internals;
638
639private:
640 vtkSurfaceLICPainter(const vtkSurfaceLICPainter&) VTK_DELETE_FUNCTION;
641 void operator=(const vtkSurfaceLICPainter&) VTK_DELETE_FUNCTION;
642};
643
644#endif
represents an object (geometry & properties) in a rendered scene
Definition: vtkActor.h:52
abstract superclass for arrays of numeric data
Definition: vtkDataArray.h:55
general representation of visualization data
Definition: vtkDataObject.h:65
abstract class to specify dataset behavior
Definition: vtkDataSet.h:63
Detect and break reference loops.
topologically and geometrically regular array of data
Definition: vtkImageData.h:46
a simple class to control print indentation
Definition: vtkIndent.h:40
Store vtkAlgorithm input/output information.
A communicator that can safely be used inside a painter.
Abstract class for drawing poly data.
Definition: vtkPainter.h:62
create a window for renderers to draw into
abstract specification for renderers
Definition: vtkRenderer.h:64
painter that performs LIC on the surface of arbitrary geometry.
void SetMapModeBias(double val)
Factor used when blend mode is set to COLOR_MODE_MAP.
void SetColorMode(int val)
virtual bool NeedToUpdateCommunicator()
void SetLICIntensity(double val)
Factor used when blend mode is set to COLOR_MODE_BLEND.
void SetHighLICContrastEnhancementFactor(double val)
void SetInputArrayToProcess(int fieldAssociation, int fieldAttributeType)
void SetMaskThreshold(double val)
The MaskThreshold controls the rendering of fragments in stagnant regions of flow.
void SetNoiseTextureSize(int length)
Set/Get the side length in pixels of the noise texture.
bool NeedToRenderGeometry(vtkRenderer *renderer, vtkActor *actor)
virtual vtkPainterCommunicator * CreateCommunicator(int)
Creates a new communicator with/without the calling processes as indicated by the passed in flag,...
virtual void WriteTimerLog(const char *)
Methods used for parallel benchmarks.
void SetNumberOfNoiseLevels(int val)
Set/Get the number of discrete values a noise pixel may take on.
void SetLowLICContrastEnhancementFactor(double val)
void SetEnable(int val)
Enable/Disable this painter.
void SetCompositeStrategy(int val)
void SetGenerateNoiseTexture(int shouldGenerate)
Set/Get the noise texture source.
void SetNoiseGeneratorSeed(int val)
Set/Get the seed value used by the random number generator.
void UpdateNoiseImage(vtkRenderWindow *renWin)
Updates the noise texture, downsampling by the requested sample rate.
void SetAntiAlias(int val)
Enable/Disable the anti-aliasing pass.
void ValidateContext(vtkRenderer *renderer)
Look for changes that would trigger stage updates.
virtual void ProcessInformation(vtkInformation *info)
Called before RenderInternal() if the Information has been changed since the last time this method wa...
void ClearTCoords(vtkDataSet *data)
void SetNoiseGrainSize(int val)
Set/Get the side length in pixels of the noise values in the noise texture.
virtual void StartTimerEvent(const char *)
Methods used for parallel benchmarks.
void SetNumberOfSteps(int val)
Get/Set the number of integration steps in each direction.
virtual void EndTimerEvent(const char *)
void SetImpulseNoiseBackgroundValue(double val)
The color to use for untouched pixels when impulse noise probability < 1.
bool PrepareOutput()
resoucre allocators
void PrintSelf(ostream &os, vtkIndent indent)
Methods invoked by print to print information about the object including superclasses.
void SetStepSize(double val)
Get/Set the step size (in pixels).
void SetMaxNoiseValue(double val)
void SetNoiseDataSet(vtkImageData *data)
Set the data containing a noise array as active scalars.
bool VectorsToTCoords(vtkDataObject *dataObj)
set tcoords with vectors
void SetMinNoiseValue(double val)
Set/Get the minimum and mximum gray scale values that the generated noise can take on.
void SetMaskColor(double *val)
The MaskColor is used on masked fragments.
void SetNoiseType(int type)
void ReportReferences(vtkGarbageCollector *collector) override
Take part in garbage collection.
void SetEnhanceContrast(int val)
void SetHighColorContrastEnhancementFactor(double val)
bool VectorsToTCoords(vtkDataSet *dataObj)
virtual void RenderInternal(vtkRenderer *renderer, vtkActor *actor, unsigned long typeflags, bool forceCompileOnly)
Performs the actual rendering.
virtual vtkDataObject * GetOutput()
Get the output data object from this painter.
bool CanRenderSurfaceLIC(vtkActor *actor, int typeflags)
Returns true when rendering LIC is possible.
void SetImpulseNoiseProbability(double val)
Control the density of of the noise.
void SetNormalizeVectors(int val)
Normalize vectors during integration.
virtual void GetGlobalMinMax(vtkPainterCommunicator *, float &, float &)
Get the min/max across all ranks.
void CreateCommunicator()
Creates a new communicator for internal use based on this rank's visible data.
void SetMaskOnSurface(int val)
When set MaskOnSurface computes |V| for use in the fragment masking tests on the surface.
static vtkSurfaceLICPainter * New()
void SetLowColorContrastEnhancementFactor(double val)
void SetEnhancedLIC(int val)
EnhancedLIC mean compute the LIC twice with the second pass using the edge-enhanced result of the fir...
static bool IsSupported(vtkRenderWindow *context)
Returns true if the rendering context supports extensions needed by this painter.
virtual void ReleaseGraphicsResources(vtkWindow *win)
Release any graphics resources that are being consumed by this mapper.
void SetMaskIntensity(double val)
The MaskIntensity controls the blending of the mask color and the geometry color.
vtkImageData * GetNoiseDataSet()
bool NeedToUpdateOutputData()
Return false if stage can be skipped.
void GetBounds(vtkDataObject *data, double bounds[6])
Computes data bounds.
void SetInputArrayToProcess(int fieldAssociation, const char *name)
Set the vectors to used for applying LIC.
void SetMaskColor(double r, double g, double b)
window superclass for vtkRenderWindow
Definition: vtkWindow.h:35
@ info
Definition: vtkX3D.h:376
@ length
Definition: vtkX3D.h:393
@ type
Definition: vtkX3D.h:516
@ name
Definition: vtkX3D.h:219
@ data
Definition: vtkX3D.h:315
vtkBooleanMacro(IgnoreDriverBugs, bool)
Updates the extensions string.