VTK  9.7.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 #include "vtkWrappingHints.h" // For VTK_MARSHALAUTO
53 
54 VTK_ABI_NAMESPACE_BEGIN
55 class vtkRenderWindow;
56 class vtkRenderer;
57 class vtkActor;
58 class vtkImageData;
59 class vtkDataObject;
60 class vtkDataArray;
63 class vtkWindow;
64 
65 class VTKRENDERINGLICOPENGL2_EXPORT VTK_MARSHALAUTO vtkSurfaceLICInterface : public vtkObject
66 {
67 public:
68  static vtkSurfaceLICInterface* New();
70  void PrintSelf(ostream& os, vtkIndent indent) override;
71 
73 
76  void SetNumberOfSteps(int val);
77  vtkGetMacro(NumberOfSteps, int);
79 
81 
84  void SetStepSize(double val);
85  vtkGetMacro(StepSize, double);
87 
89 
100  void SetNormalizeVectors(int val);
101  vtkBooleanMacro(NormalizeVectors, int);
102  vtkGetMacro(NormalizeVectors, int);
104 
106 
111  void SetMaskOnSurface(int val);
112  vtkBooleanMacro(MaskOnSurface, int);
113  vtkGetMacro(MaskOnSurface, int);
115 
117 
133  void SetMaskThreshold(double val);
134  vtkGetMacro(MaskThreshold, double);
136 
138 
143  void SetMaskColor(double* val);
144  void SetMaskColor(double r, double g, double b)
145  {
146  double rgb[3] = { r, g, b };
147  this->SetMaskColor(rgb);
148  }
149  vtkGetVector3Macro(MaskColor, double);
151 
153 
161  void SetMaskIntensity(double val);
162  vtkGetMacro(MaskIntensity, double);
164 
166 
171  void SetEnhancedLIC(int val);
172  vtkGetMacro(EnhancedLIC, int);
173  vtkBooleanMacro(EnhancedLIC, int);
175 
177 
210  enum
211  {
212  ENHANCE_CONTRAST_OFF = 0,
213  ENHANCE_CONTRAST_LIC = 1,
214  ENHANCE_CONTRAST_COLOR = 3,
215  ENHANCE_CONTRAST_BOTH = 4
216  };
217  void SetEnhanceContrast(int val);
218  vtkGetMacro(EnhanceContrast, int);
220 
222 
238  vtkGetMacro(LowLICContrastEnhancementFactor, double);
239  vtkGetMacro(HighLICContrastEnhancementFactor, double);
240  void SetLowLICContrastEnhancementFactor(double val);
241  void SetHighLICContrastEnhancementFactor(double val);
242  //
243  vtkGetMacro(LowColorContrastEnhancementFactor, double);
244  vtkGetMacro(HighColorContrastEnhancementFactor, double);
245  void SetLowColorContrastEnhancementFactor(double val);
246  void SetHighColorContrastEnhancementFactor(double val);
248 
250 
256  void SetAntiAlias(int val);
257  vtkBooleanMacro(AntiAlias, int);
258  vtkGetMacro(AntiAlias, int);
260 
262 
271  enum
272  {
273  COLOR_MODE_BLEND = 0,
274  COLOR_MODE_MAP
275  };
276  void SetColorMode(int val);
277  vtkGetMacro(ColorMode, int);
279 
281 
290  void SetLICIntensity(double val);
291  vtkGetMacro(LICIntensity, double);
293 
295 
302  void SetMapModeBias(double val);
303  vtkGetMacro(MapModeBias, double);
305 
307 
312  void SetNoiseDataSet(vtkImageData* data);
313  vtkImageData* GetNoiseDataSet();
315 
317 
336  void SetGenerateNoiseTexture(int shouldGenerate);
337  vtkGetMacro(GenerateNoiseTexture, int);
339 
341 
346  enum
347  {
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  {
426  COMPOSITE_INPLACE = 0,
427  COMPOSITE_INPLACE_DISJOINT = 1,
428  COMPOSITE_BALANCED = 2,
429  COMPOSITE_AUTO = 3
430  };
431  void SetCompositeStrategy(int val);
432  vtkGetMacro(CompositeStrategy, int);
434 
439  static bool IsSupported(vtkRenderWindow* context);
440 
447  virtual void WriteTimerLog(const char*) {}
448 
452  void ShallowCopy(vtkSurfaceLICInterface* m);
453 
459  virtual void ReleaseGraphicsResources(vtkWindow* win);
460 
464  bool CanRenderSurfaceLIC(vtkActor* actor);
465 
469  void ValidateContext(vtkRenderer* renderer);
470 
477  virtual vtkPainterCommunicator* CreateCommunicator(int);
478 
483  void CreateCommunicator(vtkRenderer*, vtkActor*, vtkDataObject* data);
484 
485  vtkPainterCommunicator* GetCommunicator();
486 
491  void UpdateCommunicator(vtkRenderer* renderer, 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:
531  ~vtkSurfaceLICInterface() override;
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 private:
592  void operator=(const vtkSurfaceLICInterface&) = delete;
593 };
594 
595 VTK_ABI_NAMESPACE_END
596 #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:41
abstract base class for most VTK objects
Definition: vtkObject.h:52
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:41
a simple class to control print indentation
Definition: vtkIndent.h:28
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: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.
#define VTK_MARSHALAUTO
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:55
A small collection of noise routines for LIC.