VTK
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 "vtkRenderingLICOpenGL2Module.h" // For export macro
63 #include "vtkOpenGLPolyDataMapper.h"
64 
65 class vtkRenderWindow;
66 class vtkRenderer;
67 class vtkActor;
68 class vtkImageData;
69 class vtkDataObject;
70 class vtkDataArray;
73 
74 class VTKRENDERINGLICOPENGL2_EXPORT vtkSurfaceLICInterface : public vtkObject
75 {
76 public:
79  void PrintSelf(ostream& os, vtkIndent indent);
80 
82 
85  void SetNumberOfSteps(int val);
86  vtkGetMacro(NumberOfSteps, int);
88 
90 
93  void SetStepSize(double val);
94  vtkGetMacro(StepSize, double);
96 
98 
109  void SetNormalizeVectors(int val);
110  vtkBooleanMacro(NormalizeVectors, int);
111  vtkGetMacro(NormalizeVectors, int);
113 
115 
120  void SetMaskOnSurface(int val);
121  vtkBooleanMacro(MaskOnSurface, int);
122  vtkGetMacro(MaskOnSurface, int);
124 
126 
142  void SetMaskThreshold(double val);
143  vtkGetMacro(MaskThreshold, double);
145 
147 
152  void SetMaskColor(double *val);
153  void SetMaskColor(double r, double g, double b)
154  { double rgb[3]={r,g,b}; this->SetMaskColor(rgb); }
155  vtkGetVector3Macro(MaskColor, double);
157 
159 
167  void SetMaskIntensity(double val);
168  vtkGetMacro(MaskIntensity, double);
170 
172 
177  void SetEnhancedLIC(int val);
178  vtkGetMacro(EnhancedLIC, int);
179  vtkBooleanMacro(EnhancedLIC, int);
181 
183 
216  enum {
217  ENHANCE_CONTRAST_OFF=0,
218  ENHANCE_CONTRAST_LIC=1,
219  ENHANCE_CONTRAST_COLOR=3,
220  ENHANCE_CONTRAST_BOTH=4
221  };
222  void SetEnhanceContrast(int val);
223  vtkGetMacro(EnhanceContrast, int);
225 
227 
243  vtkGetMacro(LowLICContrastEnhancementFactor, double);
244  vtkGetMacro(HighLICContrastEnhancementFactor, double);
247  //
248  vtkGetMacro(LowColorContrastEnhancementFactor, double);
249  vtkGetMacro(HighColorContrastEnhancementFactor, double);
253 
255 
261  void SetAntiAlias(int val);
262  vtkBooleanMacro(AntiAlias, int);
263  vtkGetMacro(AntiAlias, int);
265 
267 
276  enum {
277  COLOR_MODE_BLEND=0,
278  COLOR_MODE_MAP
279  };
280  void SetColorMode(int val);
281  vtkGetMacro(ColorMode, int);
283 
285 
294  void SetLICIntensity(double val);
295  vtkGetMacro(LICIntensity, double);
297 
299 
306  void SetMapModeBias(double val);
307  vtkGetMacro(MapModeBias, double);
309 
311 
319 
321 
340  void SetGenerateNoiseTexture(int shouldGenerate);
341  vtkGetMacro(GenerateNoiseTexture, int);
343 
345 
350  enum {
351  NOISE_TYPE_UNIFORM=0,
352  NOISE_TYPE_GAUSSIAN=1,
353  NOISE_TYPE_PERLIN=2
354  };
355  void SetNoiseType(int type);
356  vtkGetMacro(NoiseType, int);
358 
360 
365  vtkGetMacro(NoiseTextureSize, int);
367 
369 
372  void SetNoiseGrainSize(int val);
373  vtkGetMacro(NoiseGrainSize, int);
375 
377 
383  void SetMinNoiseValue(double val);
384  void SetMaxNoiseValue(double val);
385  vtkGetMacro(MinNoiseValue, double);
386  vtkGetMacro(MaxNoiseValue, double);
388 
390 
394  void SetNumberOfNoiseLevels(int val);
395  vtkGetMacro(NumberOfNoiseLevels, int);
397 
399 
403  void SetImpulseNoiseProbability(double val);
404  vtkGetMacro(ImpulseNoiseProbability, double);
406 
408 
412  vtkGetMacro(ImpulseNoiseBackgroundValue, double);
414 
416 
419  void SetNoiseGeneratorSeed(int val);
420  vtkGetMacro(NoiseGeneratorSeed, int);
422 
424 
427  enum {
428  COMPOSITE_INPLACE=0,
429  COMPOSITE_INPLACE_DISJOINT=1,
430  COMPOSITE_BALANCED=2,
431  COMPOSITE_AUTO=3
432  };
433  void SetCompositeStrategy(int val);
434  vtkGetMacro(CompositeStrategy, int);
436 
441  static bool IsSupported(vtkRenderWindow *context);
442 
449  virtual void WriteTimerLog(const char *){}
450 
455 
461  virtual void ReleaseGraphicsResources(vtkWindow * win);
462 
467 
471  void ValidateContext(vtkRenderer *renderer);
472 
480 
486 
488 
494  vtkActor *actor, vtkDataObject *data);
495 
497 
500  void SetHasVectors(bool val);
503 
508 
512  void ApplyLIC();
514  void CopyToScreen();
515 
521  virtual void GetGlobalMinMax(vtkPainterCommunicator*, float&, float&){}
522 
524 
527  vtkSetMacro(Enable, int);
528  vtkGetMacro(Enable, int);
529  vtkBooleanMacro(Enable, int);
531 
532 protected:
535 
540 
542 
545  virtual bool NeedToUpdateCommunicator();
546  bool NeedToRenderGeometry(vtkRenderer *renderer, vtkActor *actor);
550  void SetUpdateAll();
552 
553  int Enable;
554 
555  // Unit is a pixel length.
557  double StepSize;
559 
567 
571  double MaskColor[3];
572 
574  double LICIntensity;
575  double MapModeBias;
576 
587 
590 
592 
593  // save the active fbo and its draw buffer
595  int PrevFbo;
596 
597 private:
598  vtkSurfaceLICInterface(const vtkSurfaceLICInterface&) VTK_DELETE_FUNCTION;
599  void operator=(const vtkSurfaceLICInterface&) VTK_DELETE_FUNCTION;
600 };
601 
602 #endif
603 // VTK-HeaderTest-Exclude: vtkSurfaceLICInterface.h
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
topologically and geometrically regular array of data
Definition: vtkImageData.h:46
a simple class to control print indentation
Definition: vtkIndent.h:40
abstract base class for most VTK objects
Definition: vtkObject.h:60
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:64
A small collection of noise routines for LIC.
public API for surface lic parameters arbitrary geometry.
void PrintSelf(ostream &os, vtkIndent indent)
Methods invoked by print to print information about the object including superclasses.
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()
void SetCompositeStrategy(int val)
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.
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.
vtkPainterCommunicator * GetCommunicator()
void SetLowColorContrastEnhancementFactor(double val)
void ShallowCopy(vtkSurfaceLICInterface *m)
Make a shallow copy of this interface.
void SetMaxNoiseValue(double val)
void SetNoiseGrainSize(int val)
Each noise value will be length^2 pixels in area.
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 of the noise.
bool NeedToRenderGeometry(vtkRenderer *renderer, vtkActor *actor)
void SetMaskColor(double r, double g, double b)
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)
void SetColorMode(int val)
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)
void SetHighLICContrastEnhancementFactor(double val)
void SetEnhanceContrast(int val)
void SetNoiseDataSet(vtkImageData *data)
Set the data containing a noise array as active scalars.
void SetLowLICContrastEnhancementFactor(double val)
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:35
@ length
Definition: vtkX3D.h:393
@ type
Definition: vtkX3D.h:516
@ data
Definition: vtkX3D.h:315
vtkSetMacro(IgnoreDriverBugs, bool)
Updates the extensions string.
vtkBooleanMacro(IgnoreDriverBugs, bool)
Updates the extensions string.