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 =========================================================================*/
56 #ifndef vtkSurfaceLICInterface_h
57 #define vtkSurfaceLICInterface_h
58 
59 #include "vtkRenderingLICOpenGL2Module.h" // For export macro
60 #include "vtkOpenGLPolyDataMapper.h"
61 
62 class vtkRenderWindow;
63 class vtkRenderer;
64 class vtkActor;
65 class vtkImageData;
66 class vtkDataObject;
67 class vtkDataArray;
70 
71 class VTKRENDERINGLICOPENGL2_EXPORT vtkSurfaceLICInterface : public vtkObject
72 {
73 public:
74  static vtkSurfaceLICInterface* New();
76  void PrintSelf(ostream& os, vtkIndent indent) VTK_OVERRIDE;
77 
79 
82  void SetNumberOfSteps(int val);
83  vtkGetMacro(NumberOfSteps, int);
85 
87 
90  void SetStepSize(double val);
91  vtkGetMacro(StepSize, double);
93 
95 
106  void SetNormalizeVectors(int val);
107  vtkBooleanMacro(NormalizeVectors, int);
108  vtkGetMacro(NormalizeVectors, int);
110 
112 
117  void SetMaskOnSurface(int val);
118  vtkBooleanMacro(MaskOnSurface, int);
119  vtkGetMacro(MaskOnSurface, int);
121 
123 
139  void SetMaskThreshold(double val);
140  vtkGetMacro(MaskThreshold, double);
142 
144 
149  void SetMaskColor(double *val);
150  void SetMaskColor(double r, double g, double b)
151  { double rgb[3]={r,g,b}; this->SetMaskColor(rgb); }
152  vtkGetVector3Macro(MaskColor, double);
154 
156 
164  void SetMaskIntensity(double val);
165  vtkGetMacro(MaskIntensity, double);
167 
169 
174  void SetEnhancedLIC(int val);
175  vtkGetMacro(EnhancedLIC, int);
176  vtkBooleanMacro(EnhancedLIC, int);
178 
180 
213  enum {
214  ENHANCE_CONTRAST_OFF=0,
215  ENHANCE_CONTRAST_LIC=1,
216  ENHANCE_CONTRAST_COLOR=3,
217  ENHANCE_CONTRAST_BOTH=4
218  };
219  void SetEnhanceContrast(int val);
220  vtkGetMacro(EnhanceContrast, int);
222 
224 
240  vtkGetMacro(LowLICContrastEnhancementFactor, double);
241  vtkGetMacro(HighLICContrastEnhancementFactor, double);
242  void SetLowLICContrastEnhancementFactor(double val);
243  void SetHighLICContrastEnhancementFactor(double val);
244  //
245  vtkGetMacro(LowColorContrastEnhancementFactor, double);
246  vtkGetMacro(HighColorContrastEnhancementFactor, double);
247  void SetLowColorContrastEnhancementFactor(double val);
248  void SetHighColorContrastEnhancementFactor(double val);
250 
252 
258  void SetAntiAlias(int val);
259  vtkBooleanMacro(AntiAlias, int);
260  vtkGetMacro(AntiAlias, int);
262 
264 
273  enum {
274  COLOR_MODE_BLEND=0,
275  COLOR_MODE_MAP
276  };
277  void SetColorMode(int val);
278  vtkGetMacro(ColorMode, int);
280 
282 
291  void SetLICIntensity(double val);
292  vtkGetMacro(LICIntensity, double);
294 
296 
303  void SetMapModeBias(double val);
304  vtkGetMacro(MapModeBias, double);
306 
308 
313  void SetNoiseDataSet(vtkImageData *data);
314  vtkImageData *GetNoiseDataSet();
316 
318 
337  void SetGenerateNoiseTexture(int shouldGenerate);
338  vtkGetMacro(GenerateNoiseTexture, int);
340 
342 
347  enum {
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 
391  void SetNumberOfNoiseLevels(int val);
392  vtkGetMacro(NumberOfNoiseLevels, int);
394 
396 
400  void SetImpulseNoiseProbability(double val);
401  vtkGetMacro(ImpulseNoiseProbability, double);
403 
405 
408  void SetImpulseNoiseBackgroundValue(double val);
409  vtkGetMacro(ImpulseNoiseBackgroundValue, double);
411 
413 
416  void SetNoiseGeneratorSeed(int val);
417  vtkGetMacro(NoiseGeneratorSeed, int);
419 
421 
424  enum {
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 
451  void ShallowCopy(vtkSurfaceLICInterface *m);
452 
458  virtual void ReleaseGraphicsResources(vtkWindow * win);
459 
463  bool CanRenderSurfaceLIC(vtkActor *actor);
464 
468  void ValidateContext(vtkRenderer *renderer);
469 
476  virtual vtkPainterCommunicator *CreateCommunicator(int);
477 
482  void CreateCommunicator(vtkRenderer *, vtkActor *, vtkDataObject *data);
483 
484  vtkPainterCommunicator *GetCommunicator();
485 
490  void UpdateCommunicator(vtkRenderer *renderer,
491  vtkActor *actor, vtkDataObject *data);
492 
494 
497  void SetHasVectors(bool val);
498  bool GetHasVectors();
500 
504  void InitializeResources();
505 
506  void PrepareForGeometry();
507  void CompletedGeometry();
508  void GatherVectors();
509  void ApplyLIC();
510  void CombineColorsAndLIC();
511  void CopyToScreen();
512 
518  virtual void GetGlobalMinMax(vtkPainterCommunicator*, float&, float&){}
519 
521 
524  vtkSetMacro(Enable, int);
525  vtkGetMacro(Enable, int);
526  vtkBooleanMacro(Enable, int);
528 
529 protected:
532 
536  void UpdateNoiseImage(vtkRenderWindow *renWin);
537 
539 
542  virtual bool NeedToUpdateCommunicator();
543  bool NeedToRenderGeometry(vtkRenderer *renderer, vtkActor *actor);
544  bool NeedToGatherVectors();
545  bool NeedToComputeLIC();
546  bool NeedToColorLIC();
547  void SetUpdateAll();
549 
550  int Enable;
551 
552  // Unit is a pixel length.
554  double StepSize;
556 
564 
568  double MaskColor[3];
569 
571  double LICIntensity;
572  double MapModeBias;
573 
584 
587 
589 
590  // save the active fbo and its draw buffer
592  int PrevFbo;
593 
594 private:
595  vtkSurfaceLICInterface(const vtkSurfaceLICInterface&) VTK_DELETE_FUNCTION;
596  void operator=(const vtkSurfaceLICInterface&) VTK_DELETE_FUNCTION;
597 };
598 
599 #endif
600 // VTK-HeaderTest-Exclude: vtkSurfaceLICInterface.h
void SetMaskColor(double r, double g, double b)
The MaskColor is used on masked fragments.
represents an object (geometry & properties) in a rendered scene
Definition: vtkActor.h:45
abstract base class for most VTK objects
Definition: vtkObject.h:53
void PrintSelf(ostream &os, vtkIndent indent) override
Methods invoked by print to print information about the object including superclasses.
abstract specification for renderers
Definition: vtkRenderer.h:57
vtkSurfaceLICHelper * Internals
window superclass for vtkRenderWindow
Definition: vtkWindow.h:34
a simple class to control print indentation
Definition: vtkIndent.h:33
topologically and geometrically regular array of data
Definition: vtkImageData.h:39
virtual void WriteTimerLog(const char *)
Methods used for parallel benchmarks.
abstract superclass for arrays of numeric data
Definition: vtkDataArray.h:48
virtual void GetGlobalMinMax(vtkPainterCommunicator *, float &, float &)
Get the min/max across all ranks.
vtkSetMacro(IgnoreDriverBugs, bool)
When set known driver bugs are ignored during driver feature detection.
create a window for renderers to draw into
public API for surface lic parameters arbitrary geometry.
A communicator that can safely be used inside a painter.
vtkBooleanMacro(IgnoreDriverBugs, bool)
When set known driver bugs are ignored during driver feature detection.
static vtkObject * New()
Create an object with Debug turned off, modified time initialized to zero, and reference counting on...
general representation of visualization data
Definition: vtkDataObject.h:58
A small collection of noise routines for LIC.