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
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) override;
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:
534  ~vtkSurfaceLICInterface() override;
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:
599  void operator=(const vtkSurfaceLICInterface&) = delete;
600 };
601 
602 #endif
603 // VTK-HeaderTest-Exclude: vtkSurfaceLICInterface.h
vtkSurfaceLICInterface::NoiseType
int NoiseType
Definition: vtkSurfaceLICInterface.h:578
vtkSurfaceLICInterface::NoiseGrainSize
int NoiseGrainSize
Definition: vtkSurfaceLICInterface.h:580
vtkSurfaceLICInterface::PrevFbo
int PrevFbo
Definition: vtkSurfaceLICInterface.h:595
vtkSurfaceLICInterface::HighColorContrastEnhancementFactor
double HighColorContrastEnhancementFactor
Definition: vtkSurfaceLICInterface.h:565
vtkSurfaceLICInterface::PrevDrawBuf
int PrevDrawBuf
Definition: vtkSurfaceLICInterface.h:594
vtkSurfaceLICInterface::MapModeBias
double MapModeBias
Definition: vtkSurfaceLICInterface.h:575
vtkSurfaceLICInterface::GetGlobalMinMax
virtual void GetGlobalMinMax(vtkPainterCommunicator *, float &, float &)
Get the min/max across all ranks.
Definition: vtkSurfaceLICInterface.h:521
vtkSurfaceLICInterface::MaskIntensity
double MaskIntensity
Definition: vtkSurfaceLICInterface.h:570
vtkX3D::type
Definition: vtkX3D.h:516
vtkSurfaceLICInterface::LICIntensity
double LICIntensity
Definition: vtkSurfaceLICInterface.h:574
vtkX3D::data
Definition: vtkX3D.h:315
vtkSurfaceLICInterface::HighLICContrastEnhancementFactor
double HighLICContrastEnhancementFactor
Definition: vtkSurfaceLICInterface.h:563
vtkSurfaceLICInterface::StepSize
double StepSize
Definition: vtkSurfaceLICInterface.h:557
vtkObject::New
static vtkObject * New()
Create an object with Debug turned off, modified time initialized to zero, and reference counting on.
vtkSurfaceLICInterface::MinNoiseValue
double MinNoiseValue
Definition: vtkSurfaceLICInterface.h:581
vtkSurfaceLICInterface::CompositeStrategy
int CompositeStrategy
Definition: vtkSurfaceLICInterface.h:589
vtkSurfaceLICInterface::AlwaysUpdate
int AlwaysUpdate
Definition: vtkSurfaceLICInterface.h:588
vtkSurfaceLICInterface
public API for surface lic parameters arbitrary geometry.
Definition: vtkSurfaceLICInterface.h:74
vtkObject
abstract base class for most VTK objects
Definition: vtkObject.h:59
vtkSurfaceLICHelper
Definition: vtkSurfaceLICHelper.h:44
vtkSurfaceLICInterface::EnhancedLIC
int EnhancedLIC
Definition: vtkSurfaceLICInterface.h:560
vtkSurfaceLICInterface::MaskThreshold
double MaskThreshold
Definition: vtkSurfaceLICInterface.h:569
vtkSurfaceLICInterface::SetMaskColor
void SetMaskColor(double r, double g, double b)
Definition: vtkSurfaceLICInterface.h:153
vtkX3D::length
Definition: vtkX3D.h:393
vtkSurfaceLICInterface::NormalizeVectors
int NormalizeVectors
Definition: vtkSurfaceLICInterface.h:558
vtkSurfaceLICInterface::NoiseGeneratorSeed
int NoiseGeneratorSeed
Definition: vtkSurfaceLICInterface.h:586
vtkDataArray
abstract superclass for arrays of numeric data
Definition: vtkDataArray.h:54
vtkSurfaceLICInterface::WriteTimerLog
virtual void WriteTimerLog(const char *)
Methods used for parallel benchmarks.
Definition: vtkSurfaceLICInterface.h:449
vtkWindow
window superclass for vtkRenderWindow
Definition: vtkWindow.h:37
vtkSurfaceLICInterface::MaskOnSurface
int MaskOnSurface
Definition: vtkSurfaceLICInterface.h:568
vtkSurfaceLICInterface::MaxNoiseValue
double MaxNoiseValue
Definition: vtkSurfaceLICInterface.h:582
vtkSurfaceLICInterface::Internals
vtkSurfaceLICHelper * Internals
Definition: vtkSurfaceLICInterface.h:591
vtkSurfaceLICInterface::ColorMode
int ColorMode
Definition: vtkSurfaceLICInterface.h:573
vtkSurfaceLICInterface::LowLICContrastEnhancementFactor
double LowLICContrastEnhancementFactor
Definition: vtkSurfaceLICInterface.h:562
vtkActor
represents an object (geometry & properties) in a rendered scene
Definition: vtkActor.h:51
vtkImageData
topologically and geometrically regular array of data
Definition: vtkImageData.h:45
vtkIndent
a simple class to control print indentation
Definition: vtkIndent.h:39
vtkSurfaceLICInterface::ImpulseNoiseBackgroundValue
double ImpulseNoiseBackgroundValue
Definition: vtkSurfaceLICInterface.h:585
vtkObject::PrintSelf
void PrintSelf(ostream &os, vtkIndent indent) override
Methods invoked by print to print information about the object including superclasses.
vtkSurfaceLICInterface::NumberOfSteps
int NumberOfSteps
Definition: vtkSurfaceLICInterface.h:556
vtkPainterCommunicator
A communicator that can safely be used inside a painter.
Definition: vtkPainterCommunicator.h:30
vtkSurfaceLICInterface::AntiAlias
int AntiAlias
Definition: vtkSurfaceLICInterface.h:566
vtkSurfaceLICInterface::GenerateNoiseTexture
int GenerateNoiseTexture
Definition: vtkSurfaceLICInterface.h:577
vtkSurfaceLICInterface::LowColorContrastEnhancementFactor
double LowColorContrastEnhancementFactor
Definition: vtkSurfaceLICInterface.h:564
vtkRenderer
abstract specification for renderers
Definition: vtkRenderer.h:63
vtkSurfaceLICInterface::EnhanceContrast
int EnhanceContrast
Definition: vtkSurfaceLICInterface.h:561
vtkSurfaceLICInterface::ImpulseNoiseProbability
double ImpulseNoiseProbability
Definition: vtkSurfaceLICInterface.h:584
vtkSurfaceLICInterface::NoiseTextureSize
int NoiseTextureSize
Definition: vtkSurfaceLICInterface.h:579
vtkRenderWindow
create a window for renderers to draw into
Definition: vtkRenderWindow.h:87
vtkSurfaceLICInterface::Enable
int Enable
Definition: vtkSurfaceLICInterface.h:553
vtkDataObject
general representation of visualization data
Definition: vtkDataObject.h:64
vtkOpenGLPolyDataMapper.h
vtkSurfaceLICInterface::NumberOfNoiseLevels
int NumberOfNoiseLevels
Definition: vtkSurfaceLICInterface.h:583