VTK  9.3.1
vtkSurfaceLICInterface.h
Go to the documentation of this file.
1 // SPDX-FileCopyrightText: Copyright (c) Ken Martin, Will Schroeder, Bill Lorensen
2 // SPDX-License-Identifier: BSD-3-Clause
47 #ifndef vtkSurfaceLICInterface_h
48 #define vtkSurfaceLICInterface_h
49 
50 #include "vtkObject.h"
51 #include "vtkRenderingLICOpenGL2Module.h" // For export macro
52 
53 VTK_ABI_NAMESPACE_BEGIN
54 class vtkRenderWindow;
55 class vtkRenderer;
56 class vtkActor;
57 class vtkImageData;
58 class vtkDataObject;
59 class vtkDataArray;
62 class vtkWindow;
63 
64 class VTKRENDERINGLICOPENGL2_EXPORT vtkSurfaceLICInterface : public vtkObject
65 {
66 public:
67  static vtkSurfaceLICInterface* New();
69  void PrintSelf(ostream& os, vtkIndent indent) override;
70 
72 
75  void SetNumberOfSteps(int val);
76  vtkGetMacro(NumberOfSteps, int);
78 
80 
83  void SetStepSize(double val);
84  vtkGetMacro(StepSize, double);
86 
88 
99  void SetNormalizeVectors(int val);
100  vtkBooleanMacro(NormalizeVectors, int);
101  vtkGetMacro(NormalizeVectors, int);
103 
105 
110  void SetMaskOnSurface(int val);
111  vtkBooleanMacro(MaskOnSurface, int);
112  vtkGetMacro(MaskOnSurface, int);
114 
116 
132  void SetMaskThreshold(double val);
133  vtkGetMacro(MaskThreshold, double);
135 
137 
142  void SetMaskColor(double* val);
143  void SetMaskColor(double r, double g, double b)
144  {
145  double rgb[3] = { r, g, b };
146  this->SetMaskColor(rgb);
147  }
148  vtkGetVector3Macro(MaskColor, double);
150 
152 
160  void SetMaskIntensity(double val);
161  vtkGetMacro(MaskIntensity, double);
163 
165 
170  void SetEnhancedLIC(int val);
171  vtkGetMacro(EnhancedLIC, int);
172  vtkBooleanMacro(EnhancedLIC, int);
174 
176 
209  enum
210  {
211  ENHANCE_CONTRAST_OFF = 0,
212  ENHANCE_CONTRAST_LIC = 1,
213  ENHANCE_CONTRAST_COLOR = 3,
214  ENHANCE_CONTRAST_BOTH = 4
215  };
216  void SetEnhanceContrast(int val);
217  vtkGetMacro(EnhanceContrast, int);
219 
221 
237  vtkGetMacro(LowLICContrastEnhancementFactor, double);
238  vtkGetMacro(HighLICContrastEnhancementFactor, double);
239  void SetLowLICContrastEnhancementFactor(double val);
240  void SetHighLICContrastEnhancementFactor(double val);
241  //
242  vtkGetMacro(LowColorContrastEnhancementFactor, double);
243  vtkGetMacro(HighColorContrastEnhancementFactor, double);
244  void SetLowColorContrastEnhancementFactor(double val);
245  void SetHighColorContrastEnhancementFactor(double val);
247 
249 
255  void SetAntiAlias(int val);
256  vtkBooleanMacro(AntiAlias, int);
257  vtkGetMacro(AntiAlias, int);
259 
261 
270  enum
271  {
272  COLOR_MODE_BLEND = 0,
273  COLOR_MODE_MAP
274  };
275  void SetColorMode(int val);
276  vtkGetMacro(ColorMode, int);
278 
280 
289  void SetLICIntensity(double val);
290  vtkGetMacro(LICIntensity, double);
292 
294 
301  void SetMapModeBias(double val);
302  vtkGetMacro(MapModeBias, double);
304 
306 
311  void SetNoiseDataSet(vtkImageData* data);
312  vtkImageData* GetNoiseDataSet();
314 
316 
335  void SetGenerateNoiseTexture(int shouldGenerate);
336  vtkGetMacro(GenerateNoiseTexture, int);
338 
340 
345  enum
346  {
347  NOISE_TYPE_UNIFORM = 0,
348  NOISE_TYPE_GAUSSIAN = 1,
349  NOISE_TYPE_PERLIN = 2
350  };
351  void SetNoiseType(int type);
352  vtkGetMacro(NoiseType, int);
354 
356 
360  void SetNoiseTextureSize(int length);
361  vtkGetMacro(NoiseTextureSize, int);
363 
365 
368  void SetNoiseGrainSize(int val);
369  vtkGetMacro(NoiseGrainSize, int);
371 
373 
379  void SetMinNoiseValue(double val);
380  void SetMaxNoiseValue(double val);
381  vtkGetMacro(MinNoiseValue, double);
382  vtkGetMacro(MaxNoiseValue, double);
384 
386 
390  void SetNumberOfNoiseLevels(int val);
391  vtkGetMacro(NumberOfNoiseLevels, int);
393 
395 
399  void SetImpulseNoiseProbability(double val);
400  vtkGetMacro(ImpulseNoiseProbability, double);
402 
404 
407  void SetImpulseNoiseBackgroundValue(double val);
408  vtkGetMacro(ImpulseNoiseBackgroundValue, double);
410 
412 
415  void SetNoiseGeneratorSeed(int val);
416  vtkGetMacro(NoiseGeneratorSeed, int);
418 
420 
423  enum
424  {
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, vtkActor* actor, vtkDataObject* data);
491 
493 
496  void SetHasVectors(bool val);
497  bool GetHasVectors();
499 
503  void InitializeResources();
504 
505  void PrepareForGeometry();
506  void CompletedGeometry();
507  void GatherVectors();
508  void ApplyLIC();
509  void CombineColorsAndLIC();
510  void CopyToScreen();
511 
517  virtual void GetGlobalMinMax(vtkPainterCommunicator*, float&, float&) {}
518 
520 
523  vtkSetMacro(Enable, int);
524  vtkGetMacro(Enable, int);
525  vtkBooleanMacro(Enable, int);
527 
528 protected:
530  ~vtkSurfaceLICInterface() override;
531 
535  void UpdateNoiseImage(vtkRenderWindow* renWin);
536 
538 
541  virtual bool NeedToUpdateCommunicator();
542  bool NeedToRenderGeometry(vtkRenderer* renderer, vtkActor* actor);
543  bool NeedToGatherVectors();
544  bool NeedToComputeLIC();
545  bool NeedToColorLIC();
546  void SetUpdateAll();
548 
549  int Enable;
550 
551  // Unit is a pixel length.
553  double StepSize;
555 
563 
567  double MaskColor[3];
568 
570  double LICIntensity;
571  double MapModeBias;
572 
583 
586 
588 
589 private:
591  void operator=(const vtkSurfaceLICInterface&) = delete;
592 };
593 
594 VTK_ABI_NAMESPACE_END
595 #endif
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:40
abstract base class for most VTK objects
Definition: vtkObject.h:51
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:61
vtkSurfaceLICHelper * Internals
window superclass for vtkRenderWindow
Definition: vtkWindow.h:27
a simple class to control print indentation
Definition: vtkIndent.h:28
topologically and geometrically regular array of data
Definition: vtkImageData.h:42
virtual void WriteTimerLog(const char *)
Methods used for parallel benchmarks.
abstract superclass for arrays of numeric data
Definition: vtkDataArray.h:44
virtual void GetGlobalMinMax(vtkPainterCommunicator *, float &, float &)
Get the min/max across all ranks.
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.
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:54
A small collection of noise routines for LIC.