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:
77  static vtkSurfaceLICInterface* New();
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);
245  void SetLowLICContrastEnhancementFactor(double val);
246  void SetHighLICContrastEnhancementFactor(double val);
247  //
248  vtkGetMacro(LowColorContrastEnhancementFactor, double);
249  vtkGetMacro(HighColorContrastEnhancementFactor, double);
250  void SetLowColorContrastEnhancementFactor(double val);
251  void SetHighColorContrastEnhancementFactor(double val);
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 
316  void SetNoiseDataSet(vtkImageData *data);
317  vtkImageData *GetNoiseDataSet();
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 
364  void SetNoiseTextureSize(int length);
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 
411  void SetImpulseNoiseBackgroundValue(double val);
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 
454  void ShallowCopy(vtkSurfaceLICInterface *m);
455 
461  virtual void ReleaseGraphicsResources(vtkWindow * win);
462 
466  bool CanRenderSurfaceLIC(vtkActor *actor);
467 
471  void ValidateContext(vtkRenderer *renderer);
472 
479  virtual vtkPainterCommunicator *CreateCommunicator(int);
480 
485  void CreateCommunicator(vtkRenderer *, vtkActor *, vtkDataObject *data);
486 
487  vtkPainterCommunicator *GetCommunicator();
488 
493  void UpdateCommunicator(vtkRenderer *renderer,
494  vtkActor *actor, vtkDataObject *data);
495 
497 
500  void SetHasVectors(bool val);
501  bool GetHasVectors();
503 
507  void InitializeResources();
508 
509  void PrepareForGeometry();
510  void CompletedGeometry();
511  void GatherVectors();
512  void ApplyLIC();
513  void CombineColorsAndLIC();
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 
539  void UpdateNoiseImage(vtkRenderWindow *renWin);
540 
542 
545  virtual bool NeedToUpdateCommunicator();
546  bool NeedToRenderGeometry(vtkRenderer *renderer, vtkActor *actor);
547  bool NeedToGatherVectors();
548  bool NeedToComputeLIC();
549  bool NeedToColorLIC();
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
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:51
abstract base class for most VTK objects
Definition: vtkObject.h:59
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:63
vtkSurfaceLICHelper * Internals
window superclass for vtkRenderWindow
Definition: vtkWindow.h:37
a simple class to control print indentation
Definition: vtkIndent.h:39
topologically and geometrically regular array of data
Definition: vtkImageData.h:45
virtual void WriteTimerLog(const char *)
Methods used for parallel benchmarks.
abstract superclass for arrays of numeric data
Definition: vtkDataArray.h:54
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:64
A small collection of noise routines for LIC.