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 =========================================================================*/
58 #ifndef vtkSurfaceLICPainter_h
59 #define vtkSurfaceLICPainter_h
60 
61 #include "vtkRenderingLICModule.h" // For export macro
62 #include "vtkPainter.h"
63 
64 class vtkRenderWindow;
65 class vtkRenderer;
66 class vtkActor;
67 class vtkImageData;
68 class vtkDataObject;
69 class vtkDataArray;
71 
73 {
74 public:
75  static vtkSurfaceLICPainter* New();
77  void PrintSelf(ostream& os, vtkIndent indent);
78 
82  virtual void ReleaseGraphicsResources(vtkWindow * win);
83 
88  virtual vtkDataObject* GetOutput();
89 
91 
92  void SetEnable(int val);
93  vtkGetMacro(Enable, int);
94  void SetEnableOn(){ this->SetEnable(1); }
95  void SetEnableOff(){ this->SetEnable(0); }
97 
99 
103  void SetInputArrayToProcess(int fieldAssociation, const char *name);
104  void SetInputArrayToProcess(int fieldAssociation, int fieldAttributeType);
106 
108 
109  void SetNumberOfSteps(int val);
110  vtkGetMacro(NumberOfSteps, int);
112 
114 
115  void SetStepSize(double val);
116  vtkGetMacro(StepSize, double);
118 
120 
129  void SetNormalizeVectors(int val);
130  vtkBooleanMacro(NormalizeVectors, int);
131  vtkGetMacro(NormalizeVectors, int);
133 
135 
138  void SetMaskOnSurface(int val);
139  vtkBooleanMacro(MaskOnSurface, int);
140  vtkGetMacro(MaskOnSurface, int);
142 
144 
157  void SetMaskThreshold(double val);
158  vtkGetMacro(MaskThreshold, double);
160 
162 
165  void SetMaskColor(double *val);
166  void SetMaskColor(double r, double g, double b)
167  { double rgb[3]={r,g,b}; this->SetMaskColor(rgb); }
168  vtkGetVector3Macro(MaskColor, double);
170 
172 
176  void SetMaskIntensity(double val);
177  vtkGetMacro(MaskIntensity, double);
179 
181 
184  void SetEnhancedLIC(int val);
185  vtkGetMacro(EnhancedLIC, int);
186  vtkBooleanMacro(EnhancedLIC, int);
188 
190 
211  enum {
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 
234  vtkGetMacro(LowLICContrastEnhancementFactor, double);
235  vtkGetMacro(HighLICContrastEnhancementFactor, double);
236  void SetLowLICContrastEnhancementFactor(double val);
237  void SetHighLICContrastEnhancementFactor(double val);
238  //
239  vtkGetMacro(LowColorContrastEnhancementFactor, double);
240  vtkGetMacro(HighColorContrastEnhancementFactor, double);
241  void SetLowColorContrastEnhancementFactor(double val);
242  void SetHighColorContrastEnhancementFactor(double val);
244 
246 
250  void SetAntiAlias(int val);
251  vtkBooleanMacro(AntiAlias, int);
252  vtkGetMacro(AntiAlias, int);
254 
256 
262  enum {
263  COLOR_MODE_BLEND=0,
264  COLOR_MODE_MAP
265  };
266  void SetColorMode(int val);
267  vtkGetMacro(ColorMode, int);
269 
271 
276  void SetLICIntensity(double val);
277  vtkGetMacro(LICIntensity, double);
279 
281 
286  void SetMapModeBias(double val);
287  vtkGetMacro(MapModeBias, double);
289 
291 
294  void SetNoiseDataSet(vtkImageData *data);
295  vtkImageData *GetNoiseDataSet();
297 
299 
315  void SetGenerateNoiseTexture(int shouldGenerate);
316  vtkGetMacro(GenerateNoiseTexture, int);
318 
320 
323  enum {
324  NOISE_TYPE_UNIFORM=0,
325  NOISE_TYPE_GAUSSIAN=1,
326  NOISE_TYPE_PERLIN=2
327  };
328  void SetNoiseType(int type);
329  vtkGetMacro(NoiseType, int);
331 
333 
335  void SetNoiseTextureSize(int length);
336  vtkGetMacro(NoiseTextureSize, int);
338 
340 
342  void SetNoiseGrainSize(int val);
343  vtkGetMacro(NoiseGrainSize, int);
345 
347 
351  void SetMinNoiseValue(double val);
352  void SetMaxNoiseValue(double val);
353  vtkGetMacro(MinNoiseValue, double);
354  vtkGetMacro(MaxNoiseValue, double);
356 
358 
360  void SetNumberOfNoiseLevels(int val);
361  vtkGetMacro(NumberOfNoiseLevels, int);
363 
365 
368  void SetImpulseNoiseProbability(double val);
369  vtkGetMacro(ImpulseNoiseProbability, double);
371 
373 
375  void SetImpulseNoiseBackgroundValue(double val);
376  vtkGetMacro(ImpulseNoiseBackgroundValue, double);
378 
380 
381  void SetNoiseGeneratorSeed(int val);
382  vtkGetMacro(NoiseGeneratorSeed, int);
384 
386 
387  enum {
388  COMPOSITE_INPLACE=0,
389  COMPOSITE_INPLACE_DISJOINT=1,
390  COMPOSITE_BALANCED=2,
391  COMPOSITE_AUTO=3
392  };
393  void SetCompositeStrategy(int val);
394  vtkGetMacro(CompositeStrategy, int);
396 
399  static bool IsSupported(vtkRenderWindow *context);
400 
405  virtual void WriteTimerLog(const char *){}
406 
407 protected:
410 
414  virtual void ProcessInformation(vtkInformation* info);
415 
419  virtual void GetGlobalMinMax(vtkPainterCommunicator*, float&, float&){}
420 
422 
426  virtual void StartTimerEvent(const char *){}
427  virtual void EndTimerEvent(const char *){}
429 
434  virtual vtkPainterCommunicator *CreateCommunicator(int);
435 
438  void CreateCommunicator();
439 
441  void GetBounds(vtkDataObject* data, double bounds[6]);
442 
444  virtual void ReportReferences(vtkGarbageCollector *collector);
445 
447  void UpdateNoiseImage(vtkRenderWindow *renWin);
448 
450 
455  virtual void RenderInternal(
456  vtkRenderer* renderer,
457  vtkActor* actor,
458  unsigned long typeflags,
459  bool forceCompileOnly);
461 
462 
464  void ValidateContext(vtkRenderer *renderer);
465 
467 
468  bool NeedToUpdateOutputData();
469  virtual bool NeedToUpdateCommunicator();
470  bool NeedToRenderGeometry(vtkRenderer *renderer, vtkActor *actor);
471  bool NeedToGatherVectors();
472  bool NeedToComputeLIC();
473  bool NeedToColorLIC();
474  void SetUpdateAll();
476 
478 
479  bool PrepareOutput();
480  void InitializeResources();
482 
484 
485  bool VectorsToTCoords(vtkDataObject *dataObj);
486  bool VectorsToTCoords(vtkDataSet *dataObj);
487  void ClearTCoords(vtkDataSet *data);
489 
491  bool CanRenderSurfaceLIC(vtkActor *actor, int typeflags);
492 
493 protected:
494  // Unit is a pixel length.
496  double StepSize;
498 
506 
510  double MaskColor[3];
511 
513  double LICIntensity;
514  double MapModeBias;
515 
526 
528  int Enable;
530 
532  class vtkInternals;
533  vtkInternals* Internals;
534 
535 private:
536  vtkSurfaceLICPainter(const vtkSurfaceLICPainter&); // Not implemented.
537  void operator=(const vtkSurfaceLICPainter&); // Not implemented.
538 };
539 
540 #endif
void SetMaskColor(double r, double g, double b)
represents an object (geometry & properties) in a rendered scene
Definition: vtkActor.h:50
virtual void RenderInternal(vtkRenderer *renderer, vtkActor *actor, unsigned long typeflags, bool forceCompileOnly)
Store vtkAlgorithm input/output information.
abstract class to specify dataset behavior
Definition: vtkDataSet.h:61
virtual void ProcessInformation(vtkInformation *)
Definition: vtkPainter.h:202
virtual void ReportReferences(vtkGarbageCollector *collector)
virtual void EndTimerEvent(const char *)
virtual vtkDataObject * GetOutput()
Definition: vtkPainter.h:156
abstract specification for renderers
Definition: vtkRenderer.h:63
virtual void GetGlobalMinMax(vtkPainterCommunicator *, float &, float &)
virtual void ReleaseGraphicsResources(vtkWindow *)
Detect and break reference loops.
window superclass for vtkRenderWindow
Definition: vtkWindow.h:36
#define VTKRENDERINGLIC_EXPORT
a simple class to control print indentation
Definition: vtkIndent.h:38
topologically and geometrically regular array of data
Definition: vtkImageData.h:44
abstract superclass for arrays of numeric data
Definition: vtkDataArray.h:54
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:63
static vtkObject * New()
general representation of visualization data
Definition: vtkDataObject.h:64
virtual void WriteTimerLog(const char *)
virtual void StartTimerEvent(const char *)
virtual void PrintSelf(ostream &os, vtkIndent indent)