VTK
vtkSurfaceLICPainter.h
Go to the documentation of this file.
1 /*=========================================================================
2 
3  Program: Visualization Toolkit
4  Module: vtkSurfaceLICPainter.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 vtkSurfaceLICPainter_h
60 #define vtkSurfaceLICPainter_h
61 
62 #include "vtkRenderingLICModule.h" // For export macro
63 #include "vtkPainter.h"
64 
65 class vtkRenderWindow;
66 class vtkRenderer;
67 class vtkActor;
68 class vtkImageData;
69 class vtkDataObject;
70 class vtkDataArray;
72 
73 class VTKRENDERINGLIC_EXPORT vtkSurfaceLICPainter : public vtkPainter
74 {
75 public:
76  static vtkSurfaceLICPainter* New();
78  void PrintSelf(ostream& os, vtkIndent indent);
79 
85  virtual void ReleaseGraphicsResources(vtkWindow * win);
86 
93  virtual vtkDataObject* GetOutput();
94 
96 
99  void SetEnable(int val);
100  vtkGetMacro(Enable, int);
101  void SetEnableOn(){ this->SetEnable(1); }
102  void SetEnableOff(){ this->SetEnable(0); }
104 
106 
112  void SetInputArrayToProcess(int fieldAssociation, const char *name);
113  void SetInputArrayToProcess(int fieldAssociation, int fieldAttributeType);
115 
117 
120  void SetNumberOfSteps(int val);
121  vtkGetMacro(NumberOfSteps, int);
123 
125 
128  void SetStepSize(double val);
129  vtkGetMacro(StepSize, double);
131 
133 
144  void SetNormalizeVectors(int val);
145  vtkBooleanMacro(NormalizeVectors, int);
146  vtkGetMacro(NormalizeVectors, int);
148 
150 
155  void SetMaskOnSurface(int val);
156  vtkBooleanMacro(MaskOnSurface, int);
157  vtkGetMacro(MaskOnSurface, int);
159 
161 
177  void SetMaskThreshold(double val);
178  vtkGetMacro(MaskThreshold, double);
180 
182 
187  void SetMaskColor(double *val);
188  void SetMaskColor(double r, double g, double b)
189  { double rgb[3]={r,g,b}; this->SetMaskColor(rgb); }
190  vtkGetVector3Macro(MaskColor, double);
192 
194 
202  void SetMaskIntensity(double val);
203  vtkGetMacro(MaskIntensity, double);
205 
207 
212  void SetEnhancedLIC(int val);
213  vtkGetMacro(EnhancedLIC, int);
214  vtkBooleanMacro(EnhancedLIC, int);
216 
218 
251  enum {
252  ENHANCE_CONTRAST_OFF=0,
253  ENHANCE_CONTRAST_LIC=1,
254  ENHANCE_CONTRAST_COLOR=3,
255  ENHANCE_CONTRAST_BOTH=4
256  };
257  void SetEnhanceContrast(int val);
258  vtkGetMacro(EnhanceContrast, int);
260 
262 
278  vtkGetMacro(LowLICContrastEnhancementFactor, double);
279  vtkGetMacro(HighLICContrastEnhancementFactor, double);
280  void SetLowLICContrastEnhancementFactor(double val);
281  void SetHighLICContrastEnhancementFactor(double val);
282  //
283  vtkGetMacro(LowColorContrastEnhancementFactor, double);
284  vtkGetMacro(HighColorContrastEnhancementFactor, double);
285  void SetLowColorContrastEnhancementFactor(double val);
286  void SetHighColorContrastEnhancementFactor(double val);
288 
290 
296  void SetAntiAlias(int val);
297  vtkBooleanMacro(AntiAlias, int);
298  vtkGetMacro(AntiAlias, int);
300 
302 
311  enum {
312  COLOR_MODE_BLEND=0,
313  COLOR_MODE_MAP
314  };
315  void SetColorMode(int val);
316  vtkGetMacro(ColorMode, int);
318 
320 
329  void SetLICIntensity(double val);
330  vtkGetMacro(LICIntensity, double);
332 
334 
341  void SetMapModeBias(double val);
342  vtkGetMacro(MapModeBias, double);
344 
346 
351  void SetNoiseDataSet(vtkImageData *data);
352  vtkImageData *GetNoiseDataSet();
354 
356 
375  void SetGenerateNoiseTexture(int shouldGenerate);
376  vtkGetMacro(GenerateNoiseTexture, int);
378 
380 
385  enum {
386  NOISE_TYPE_UNIFORM=0,
387  NOISE_TYPE_GAUSSIAN=1,
388  NOISE_TYPE_PERLIN=2
389  };
390  void SetNoiseType(int type);
391  vtkGetMacro(NoiseType, int);
393 
395 
399  void SetNoiseTextureSize(int length);
400  vtkGetMacro(NoiseTextureSize, int);
402 
404 
408  void SetNoiseGrainSize(int val);
409  vtkGetMacro(NoiseGrainSize, int);
411 
413 
419  void SetMinNoiseValue(double val);
420  void SetMaxNoiseValue(double val);
421  vtkGetMacro(MinNoiseValue, double);
422  vtkGetMacro(MaxNoiseValue, double);
424 
426 
430  void SetNumberOfNoiseLevels(int val);
431  vtkGetMacro(NumberOfNoiseLevels, int);
433 
435 
439  void SetImpulseNoiseProbability(double val);
440  vtkGetMacro(ImpulseNoiseProbability, double);
442 
444 
447  void SetImpulseNoiseBackgroundValue(double val);
448  vtkGetMacro(ImpulseNoiseBackgroundValue, double);
450 
452 
455  void SetNoiseGeneratorSeed(int val);
456  vtkGetMacro(NoiseGeneratorSeed, int);
458 
460 
463  enum {
464  COMPOSITE_INPLACE=0,
465  COMPOSITE_INPLACE_DISJOINT=1,
466  COMPOSITE_BALANCED=2,
467  COMPOSITE_AUTO=3
468  };
469  void SetCompositeStrategy(int val);
470  vtkGetMacro(CompositeStrategy, int);
472 
477  static bool IsSupported(vtkRenderWindow *context);
478 
485  virtual void WriteTimerLog(const char *){}
486 
487 protected:
490 
496  virtual void ProcessInformation(vtkInformation* info);
497 
503  virtual void GetGlobalMinMax(vtkPainterCommunicator*, float&, float&){}
504 
511  virtual void StartTimerEvent(const char *){}
512  virtual void EndTimerEvent(const char *){}
513 
520  virtual vtkPainterCommunicator *CreateCommunicator(int);
521 
526  void CreateCommunicator();
527 
531  void GetBounds(vtkDataObject* data, double bounds[6]);
532 
536  void ReportReferences(vtkGarbageCollector *collector) VTK_OVERRIDE;
537 
541  void UpdateNoiseImage(vtkRenderWindow *renWin);
542 
550  virtual void RenderInternal(
551  vtkRenderer* renderer,
552  vtkActor* actor,
553  unsigned long typeflags,
554  bool forceCompileOnly);
555 
556 
560  void ValidateContext(vtkRenderer *renderer);
561 
563 
566  bool NeedToUpdateOutputData();
567  virtual bool NeedToUpdateCommunicator();
568  bool NeedToRenderGeometry(vtkRenderer *renderer, vtkActor *actor);
569  bool NeedToGatherVectors();
570  bool NeedToComputeLIC();
571  bool NeedToColorLIC();
572  void SetUpdateAll();
574 
576 
579  bool PrepareOutput();
580  void InitializeResources();
582 
584 
587  bool VectorsToTCoords(vtkDataObject *dataObj);
588  bool VectorsToTCoords(vtkDataSet *dataObj);
589  void ClearTCoords(vtkDataSet *data);
591 
595  bool CanRenderSurfaceLIC(vtkActor *actor, int typeflags);
596 
597 protected:
598  // Unit is a pixel length.
600  double StepSize;
602 
610 
614  double MaskColor[3];
615 
617  double LICIntensity;
618  double MapModeBias;
619 
630 
632  int Enable;
634 
636  class vtkInternals;
637  vtkInternals* Internals;
638 
639 private:
640  vtkSurfaceLICPainter(const vtkSurfaceLICPainter&) VTK_DELETE_FUNCTION;
641  void operator=(const vtkSurfaceLICPainter&) VTK_DELETE_FUNCTION;
642 };
643 
644 #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:51
virtual void RenderInternal(vtkRenderer *renderer, vtkActor *actor, unsigned long typeflags, bool forceCompileOnly)
Performs the actual rendering.
Store vtkAlgorithm input/output information.
abstract class to specify dataset behavior
Definition: vtkDataSet.h:62
virtual void ProcessInformation(vtkInformation *)
Called before RenderInternal() if the Information has been changed since the last time this method wa...
Definition: vtkPainter.h:233
virtual void EndTimerEvent(const char *)
virtual vtkDataObject * GetOutput()
Get the output data object from this painter.
Definition: vtkPainter.h:174
abstract specification for renderers
Definition: vtkRenderer.h:63
virtual void GetGlobalMinMax(vtkPainterCommunicator *, float &, float &)
Get the min/max across all ranks.
virtual void ReleaseGraphicsResources(vtkWindow *)
Release any graphics resources that are being consumed by this painter.
Detect and break reference loops.
window superclass for vtkRenderWindow
Definition: vtkWindow.h:37
void ReportReferences(vtkGarbageCollector *collector) override
Take part in garbage collection.
a simple class to control print indentation
Definition: vtkIndent.h:39
topologically and geometrically regular array of data
Definition: vtkImageData.h:45
abstract superclass for arrays of numeric data
Definition: vtkDataArray.h:54
void SetEnableOn()
Enable/Disable this painter.
void SetEnableOff()
Enable/Disable this painter.
painter that performs LIC on the surface of arbitrary geometry.
create a window for renderers to draw into
Abstract class for drawing poly data.
Definition: vtkPainter.h:61
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
virtual void WriteTimerLog(const char *)
Methods used for parallel benchmarks.
virtual void StartTimerEvent(const char *)
Methods used for parallel benchmarks.
virtual void PrintSelf(ostream &os, vtkIndent indent)
Methods invoked by print to print information about the object including superclasses.