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:
77  void PrintSelf(ostream& os, vtkIndent indent);
78 
82  virtual void ReleaseGraphicsResources(vtkWindow * win);
83 
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 
110  vtkGetMacro(NumberOfSteps, int);
112 
114 
115  void SetStepSize(double val);
116  vtkGetMacro(StepSize, double);
118 
120 
130  vtkBooleanMacro(NormalizeVectors, int);
131  vtkGetMacro(NormalizeVectors, int);
133 
135 
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  };
218  vtkGetMacro(EnhanceContrast, int);
220 
222 
234  vtkGetMacro(LowLICContrastEnhancementFactor, double);
235  vtkGetMacro(HighLICContrastEnhancementFactor, double);
238  //
239  vtkGetMacro(LowColorContrastEnhancementFactor, double);
240  vtkGetMacro(HighColorContrastEnhancementFactor, double);
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 
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 
336  vtkGetMacro(NoiseTextureSize, int);
338 
340 
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 
361  vtkGetMacro(NumberOfNoiseLevels, int);
363 
365 
369  vtkGetMacro(ImpulseNoiseProbability, double);
371 
373 
376  vtkGetMacro(ImpulseNoiseBackgroundValue, double);
378 
380 
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  };
394  vtkGetMacro(CompositeStrategy, int);
396 
399  static bool IsSupported(vtkRenderWindow *context);
400 
405  virtual void WriteTimerLog(const char *){}
406 
407 protected:
410 
415 
419  virtual void GetGlobalMinMax(vtkPainterCommunicator*, float&, float&){}
420 
422 
426  virtual void StartTimerEvent(const char *){}
427  virtual void EndTimerEvent(const char *){}
429 
435 
439 
441  void GetBounds(vtkDataObject* data, double bounds[6]);
442 
444  virtual void ReportReferences(vtkGarbageCollector *collector);
445 
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 
469  virtual bool NeedToUpdateCommunicator();
470  bool NeedToRenderGeometry(vtkRenderer *renderer, vtkActor *actor);
474  void SetUpdateAll();
476 
478 
482 
484 
486  bool VectorsToTCoords(vtkDataSet *dataObj);
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
vtkSurfaceLICPainter::MapModeBias
double MapModeBias
Definition: vtkSurfaceLICPainter.h:514
vtkSurfaceLICPainter::SetMaskOnSurface
void SetMaskOnSurface(int val)
vtkSurfaceLICPainter::MaskIntensity
double MaskIntensity
Definition: vtkSurfaceLICPainter.h:509
vtkSurfaceLICPainter::MaskThreshold
double MaskThreshold
Definition: vtkSurfaceLICPainter.h:508
vtkgl::data
GLsizei GLsizei GLenum GLenum const GLvoid * data
Definition: vtkgl.h:11339
vtkSurfaceLICPainter::SetMinNoiseValue
void SetMinNoiseValue(double val)
vtkSurfaceLICPainter::VectorsToTCoords
bool VectorsToTCoords(vtkDataSet *dataObj)
vtkSurfaceLICPainter::GetOutput
virtual vtkDataObject * GetOutput()
vtkSurfaceLICPainter::NeedToRenderGeometry
bool NeedToRenderGeometry(vtkRenderer *renderer, vtkActor *actor)
vtkSurfaceLICPainter::ImpulseNoiseBackgroundValue
double ImpulseNoiseBackgroundValue
Definition: vtkSurfaceLICPainter.h:524
vtkSurfaceLICPainter
painter that performs LIC on the surface of arbitrary geometry.
Definition: vtkSurfaceLICPainter.h:73
vtkSurfaceLICPainter::NeedToUpdateOutputData
bool NeedToUpdateOutputData()
vtkSurfaceLICPainter::SetInputArrayToProcess
void SetInputArrayToProcess(int fieldAssociation, const char *name)
vtkgl::b
GLboolean GLboolean GLboolean b
Definition: vtkgl.h:12312
vtkSurfaceLICPainter::ColorMode
int ColorMode
Definition: vtkSurfaceLICPainter.h:512
vtkSurfaceLICPainter::CanRenderSurfaceLIC
bool CanRenderSurfaceLIC(vtkActor *actor, int typeflags)
vtkSurfaceLICPainter::SetNoiseGeneratorSeed
void SetNoiseGeneratorSeed(int val)
vtkSurfaceLICPainter::SetNoiseDataSet
void SetNoiseDataSet(vtkImageData *data)
vtkSurfaceLICPainter::NoiseGrainSize
int NoiseGrainSize
Definition: vtkSurfaceLICPainter.h:519
vtkSurfaceLICPainter::SetHighLICContrastEnhancementFactor
void SetHighLICContrastEnhancementFactor(double val)
vtkSurfaceLICPainter::HighColorContrastEnhancementFactor
double HighColorContrastEnhancementFactor
Definition: vtkSurfaceLICPainter.h:504
vtkSurfaceLICPainter::InitializeResources
void InitializeResources()
vtkSurfaceLICPainter::~vtkSurfaceLICPainter
~vtkSurfaceLICPainter()
vtkSurfaceLICPainter::SetCompositeStrategy
void SetCompositeStrategy(int val)
vtkSurfaceLICPainter::GenerateNoiseTexture
int GenerateNoiseTexture
Definition: vtkSurfaceLICPainter.h:516
vtkSurfaceLICPainter::CompositeStrategy
int CompositeStrategy
Definition: vtkSurfaceLICPainter.h:529
vtkSurfaceLICPainter::GetBounds
void GetBounds(vtkDataObject *data, double bounds[6])
vtkSurfaceLICPainter::StartTimerEvent
virtual void StartTimerEvent(const char *)
Definition: vtkSurfaceLICPainter.h:426
vtkSurfaceLICPainter::SetMapModeBias
void SetMapModeBias(double val)
vtkTypeMacro
#define vtkTypeMacro(thisClass, superclass)
Definition: vtkSetGet.h:642
vtkSurfaceLICPainter::Internals
vtkInternals * Internals
Definition: vtkSurfaceLICPainter.h:532
vtkSurfaceLICPainter::SetLowColorContrastEnhancementFactor
void SetLowColorContrastEnhancementFactor(double val)
vtkSurfaceLICPainter::Output
vtkDataObject * Output
Definition: vtkSurfaceLICPainter.h:531
vtkSurfaceLICPainter::SetNormalizeVectors
void SetNormalizeVectors(int val)
vtkSurfaceLICPainter::SetNoiseGrainSize
void SetNoiseGrainSize(int val)
vtkRenderingLICModule.h
vtkSurfaceLICPainter::SetImpulseNoiseBackgroundValue
void SetImpulseNoiseBackgroundValue(double val)
vtkSurfaceLICPainter::EndTimerEvent
virtual void EndTimerEvent(const char *)
Definition: vtkSurfaceLICPainter.h:427
vtkSurfaceLICPainter::PrintSelf
void PrintSelf(ostream &os, vtkIndent indent)
vtkSurfaceLICPainter::SetEnableOff
void SetEnableOff()
Definition: vtkSurfaceLICPainter.h:95
vtkSurfaceLICPainter::EnhancedLIC
int EnhancedLIC
Definition: vtkSurfaceLICPainter.h:499
vtkSurfaceLICPainter::SetEnhanceContrast
void SetEnhanceContrast(int val)
vtkDataArray
abstract superclass for arrays of numeric data
Definition: vtkDataArray.h:55
vtkSurfaceLICPainter::CreateCommunicator
virtual vtkPainterCommunicator * CreateCommunicator(int)
vtkSurfaceLICPainter::ReleaseGraphicsResources
virtual void ReleaseGraphicsResources(vtkWindow *win)
vtkSurfaceLICPainter::SetMaskColor
void SetMaskColor(double r, double g, double b)
Definition: vtkSurfaceLICPainter.h:166
vtkSurfaceLICPainter::SetUpdateAll
void SetUpdateAll()
vtkSurfaceLICPainter::AlwaysUpdate
int AlwaysUpdate
Definition: vtkSurfaceLICPainter.h:527
vtkgl::length
GLuint GLsizei GLsizei * length
Definition: vtkgl.h:11992
vtkSurfaceLICPainter::WriteTimerLog
virtual void WriteTimerLog(const char *)
Definition: vtkSurfaceLICPainter.h:405
vtkSurfaceLICPainter::SetMaxNoiseValue
void SetMaxNoiseValue(double val)
vtkSurfaceLICPainter::ImpulseNoiseProbability
double ImpulseNoiseProbability
Definition: vtkSurfaceLICPainter.h:523
vtkSurfaceLICPainter::SetNoiseTextureSize
void SetNoiseTextureSize(int length)
vtkSurfaceLICPainter::RenderInternal
virtual void RenderInternal(vtkRenderer *renderer, vtkActor *actor, unsigned long typeflags, bool forceCompileOnly)
vtkWindow
window superclass for vtkRenderWindow
Definition: vtkWindow.h:34
vtkSurfaceLICPainter::ProcessInformation
virtual void ProcessInformation(vtkInformation *info)
vtkSurfaceLICPainter::NoiseType
int NoiseType
Definition: vtkSurfaceLICPainter.h:517
vtkSurfaceLICPainter::AntiAlias
int AntiAlias
Definition: vtkSurfaceLICPainter.h:505
vtkSurfaceLICPainter::LICIntensity
double LICIntensity
Definition: vtkSurfaceLICPainter.h:513
vtkSurfaceLICPainter::SetLICIntensity
void SetLICIntensity(double val)
vtkSurfaceLICPainter::NumberOfSteps
int NumberOfSteps
Definition: vtkSurfaceLICPainter.h:495
vtkgl::val
GLuint GLfloat * val
Definition: vtkgl.h:13789
vtkSurfaceLICPainter::NoiseGeneratorSeed
int NoiseGeneratorSeed
Definition: vtkSurfaceLICPainter.h:525
vtkgl::name
GLuint const GLchar * name
Definition: vtkgl.h:11983
vtkGetVector3Macro
#define vtkGetVector3Macro(name, type)
Definition: vtkSetGet.h:304
vtkSurfaceLICPainter::NeedToColorLIC
bool NeedToColorLIC()
vtkSurfaceLICPainter::SetColorMode
void SetColorMode(int val)
vtkSurfaceLICPainter::SetAntiAlias
void SetAntiAlias(int val)
vtkSurfaceLICPainter::NeedToGatherVectors
bool NeedToGatherVectors()
vtkSurfaceLICPainter::NoiseTextureSize
int NoiseTextureSize
Definition: vtkSurfaceLICPainter.h:518
vtkSurfaceLICPainter::SetNoiseType
void SetNoiseType(int type)
vtkSurfaceLICPainter::SetHighColorContrastEnhancementFactor
void SetHighColorContrastEnhancementFactor(double val)
vtkSurfaceLICPainter::GetNoiseDataSet
vtkImageData * GetNoiseDataSet()
vtkSurfaceLICPainter::SetMaskIntensity
void SetMaskIntensity(double val)
vtkActor
represents an object (geometry & properties) in a rendered scene
Definition: vtkActor.h:51
vtkSurfaceLICPainter::HighLICContrastEnhancementFactor
double HighLICContrastEnhancementFactor
Definition: vtkSurfaceLICPainter.h:502
vtkImageData
topologically and geometrically regular array of data
Definition: vtkImageData.h:45
vtkIndent
a simple class to control print indentation
Definition: vtkIndent.h:39
vtkSurfaceLICPainter::SetInputArrayToProcess
void SetInputArrayToProcess(int fieldAssociation, int fieldAttributeType)
vtkSurfaceLICPainter::MaxNoiseValue
double MaxNoiseValue
Definition: vtkSurfaceLICPainter.h:521
vtkSurfaceLICPainter::CreateCommunicator
void CreateCommunicator()
vtkPainter
Abstract class for drawing poly data.
Definition: vtkPainter.h:64
vtkSurfaceLICPainter::StepSize
double StepSize
Definition: vtkSurfaceLICPainter.h:496
vtkSurfaceLICPainter::SetNumberOfNoiseLevels
void SetNumberOfNoiseLevels(int val)
vtkSurfaceLICPainter::MaskOnSurface
int MaskOnSurface
Definition: vtkSurfaceLICPainter.h:507
vtkSurfaceLICPainter::SetNumberOfSteps
void SetNumberOfSteps(int val)
vtkSurfaceLICPainter::SetEnableOn
void SetEnableOn()
Definition: vtkSurfaceLICPainter.h:94
vtkGetMacro
#define vtkGetMacro(name, type)
Definition: vtkSetGet.h:93
VTKRENDERINGLIC_EXPORT
#define VTKRENDERINGLIC_EXPORT
Definition: vtkRenderingLICModule.h:15
vtkPainter.h
vtkSurfaceLICPainter::ReportReferences
virtual void ReportReferences(vtkGarbageCollector *collector)
vtkGarbageCollector
Detect and break reference loops.
Definition: vtkGarbageCollector.h:99
vtkSurfaceLICPainter::IsSupported
static bool IsSupported(vtkRenderWindow *context)
vtkSurfaceLICPainter::NeedToUpdateCommunicator
virtual bool NeedToUpdateCommunicator()
vtkSurfaceLICPainter::SetGenerateNoiseTexture
void SetGenerateNoiseTexture(int shouldGenerate)
vtkDataSet
abstract class to specify dataset behavior
Definition: vtkDataSet.h:62
vtkBooleanMacro
vtkBooleanMacro(IgnoreDriverBugs, bool)
vtkSurfaceLICPainter::NumberOfNoiseLevels
int NumberOfNoiseLevels
Definition: vtkSurfaceLICPainter.h:522
vtkInformation
Store vtkAlgorithm input/output information.
Definition: vtkInformation.h:86
vtkSurfaceLICPainter::ValidateContext
void ValidateContext(vtkRenderer *renderer)
vtkX3D::info
@ info
Definition: vtkX3D.h:376
vtkPainterCommunicator
Definition: vtkPainterCommunicator.h:32
vtkSurfaceLICPainter::NormalizeVectors
int NormalizeVectors
Definition: vtkSurfaceLICPainter.h:497
vtkSurfaceLICPainter::SetImpulseNoiseProbability
void SetImpulseNoiseProbability(double val)
vtkSurfaceLICPainter::MinNoiseValue
double MinNoiseValue
Definition: vtkSurfaceLICPainter.h:520
vtkgl::r
GLdouble GLdouble GLdouble r
Definition: vtkgl.h:11610
vtkSurfaceLICPainter::GetGlobalMinMax
virtual void GetGlobalMinMax(vtkPainterCommunicator *, float &, float &)
Definition: vtkSurfaceLICPainter.h:419
vtkgl::g
GLboolean GLboolean g
Definition: vtkgl.h:12312
vtkSurfaceLICPainter::EnhanceContrast
int EnhanceContrast
Definition: vtkSurfaceLICPainter.h:500
vtkSurfaceLICPainter::VectorsToTCoords
bool VectorsToTCoords(vtkDataObject *dataObj)
vtkRenderer
abstract specification for renderers
Definition: vtkRenderer.h:64
vtkSurfaceLICPainter::UpdateNoiseImage
void UpdateNoiseImage(vtkRenderWindow *renWin)
vtkSurfaceLICPainter::LowColorContrastEnhancementFactor
double LowColorContrastEnhancementFactor
Definition: vtkSurfaceLICPainter.h:503
vtkSurfaceLICPainter::SetEnable
void SetEnable(int val)
vtkRenderWindow
create a window for renderers to draw into
Definition: vtkRenderWindow.h:89
vtkSurfaceLICPainter::ClearTCoords
void ClearTCoords(vtkDataSet *data)
vtkSurfaceLICPainter::PrepareOutput
bool PrepareOutput()
vtkDataObject
general representation of visualization data
Definition: vtkDataObject.h:65
vtkgl::type
GLuint GLuint GLsizei GLenum type
Definition: vtkgl.h:11315
vtkSurfaceLICPainter::vtkSurfaceLICPainter
vtkSurfaceLICPainter()
vtkSurfaceLICPainter::SetEnhancedLIC
void SetEnhancedLIC(int val)
vtkSurfaceLICPainter::Enable
int Enable
Definition: vtkSurfaceLICPainter.h:528
vtkSurfaceLICPainter::LowLICContrastEnhancementFactor
double LowLICContrastEnhancementFactor
Definition: vtkSurfaceLICPainter.h:501
vtkSurfaceLICPainter::NeedToComputeLIC
bool NeedToComputeLIC()
vtkSurfaceLICPainter::SetStepSize
void SetStepSize(double val)
vtkSurfaceLICPainter::SetMaskColor
void SetMaskColor(double *val)
vtkSurfaceLICPainter::New
static vtkSurfaceLICPainter * New()
vtkSurfaceLICPainter::SetMaskThreshold
void SetMaskThreshold(double val)
vtkSurfaceLICPainter::SetLowLICContrastEnhancementFactor
void SetLowLICContrastEnhancementFactor(double val)