VTK
vtkSurfaceLICMapper.h
Go to the documentation of this file.
1 /*=========================================================================
2 
3  Program: Visualization Toolkit
4  Module: vtkSurfaceLICMapper.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 vtkSurfaceLICMapper_h
59 #define vtkSurfaceLICMapper_h
60 
61 #include "vtkRenderingLICOpenGL2Module.h" // For export macro
62 #include "vtkOpenGLPolyDataMapper.h"
63 
64 class vtkRenderWindow;
65 class vtkRenderer;
66 class vtkActor;
67 class vtkImageData;
68 class vtkDataObject;
69 class vtkDataArray;
71 
72 class VTKRENDERINGLICOPENGL2_EXPORT vtkSurfaceLICMapper : public vtkOpenGLPolyDataMapper
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 
101  vtkGetMacro(NumberOfSteps, int);
103 
105 
106  void SetStepSize(double val);
107  vtkGetMacro(StepSize, double);
109 
111 
121  vtkBooleanMacro(NormalizeVectors, int);
122  vtkGetMacro(NormalizeVectors, int);
124 
126 
130  vtkBooleanMacro(MaskOnSurface, int);
131  vtkGetMacro(MaskOnSurface, int);
133 
135 
148  void SetMaskThreshold(double val);
149  vtkGetMacro(MaskThreshold, double);
151 
153 
156  void SetMaskColor(double *val);
157  void SetMaskColor(double r, double g, double b)
158  { double rgb[3]={r,g,b}; this->SetMaskColor(rgb); }
159  vtkGetVector3Macro(MaskColor, double);
161 
163 
167  void SetMaskIntensity(double val);
168  vtkGetMacro(MaskIntensity, double);
170 
172 
175  void SetEnhancedLIC(int val);
176  vtkGetMacro(EnhancedLIC, int);
177  vtkBooleanMacro(EnhancedLIC, int);
179 
181 
202  enum {
203  ENHANCE_CONTRAST_OFF=0,
204  ENHANCE_CONTRAST_LIC=1,
205  ENHANCE_CONTRAST_COLOR=3,
206  ENHANCE_CONTRAST_BOTH=4
207  };
209  vtkGetMacro(EnhanceContrast, int);
211 
213 
225  vtkGetMacro(LowLICContrastEnhancementFactor, double);
226  vtkGetMacro(HighLICContrastEnhancementFactor, double);
229  //
230  vtkGetMacro(LowColorContrastEnhancementFactor, double);
231  vtkGetMacro(HighColorContrastEnhancementFactor, double);
235 
237 
241  void SetAntiAlias(int val);
242  vtkBooleanMacro(AntiAlias, int);
243  vtkGetMacro(AntiAlias, int);
245 
247 
253  enum {
254  COLOR_MODE_BLEND=0,
255  COLOR_MODE_MAP
256  };
257  void SetColorMode(int val);
258  vtkGetMacro(ColorMode, int);
260 
262 
267  void SetLICIntensity(double val);
268  vtkGetMacro(LICIntensity, double);
270 
272 
277  void SetMapModeBias(double val);
278  vtkGetMacro(MapModeBias, double);
280 
282 
288 
290 
306  void SetGenerateNoiseTexture(int shouldGenerate);
307  vtkGetMacro(GenerateNoiseTexture, int);
309 
311 
314  enum {
315  NOISE_TYPE_UNIFORM=0,
316  NOISE_TYPE_GAUSSIAN=1,
317  NOISE_TYPE_PERLIN=2
318  };
319  void SetNoiseType(int type);
320  vtkGetMacro(NoiseType, int);
322 
324 
327  vtkGetMacro(NoiseTextureSize, int);
329 
331 
333  vtkGetMacro(NoiseGrainSize, int);
335 
337 
341  void SetMinNoiseValue(double val);
342  void SetMaxNoiseValue(double val);
343  vtkGetMacro(MinNoiseValue, double);
344  vtkGetMacro(MaxNoiseValue, double);
346 
348 
351  vtkGetMacro(NumberOfNoiseLevels, int);
353 
355 
359  vtkGetMacro(ImpulseNoiseProbability, double);
361 
363 
366  vtkGetMacro(ImpulseNoiseBackgroundValue, double);
368 
370 
372  vtkGetMacro(NoiseGeneratorSeed, int);
374 
376 
377  enum {
378  COMPOSITE_INPLACE=0,
379  COMPOSITE_INPLACE_DISJOINT=1,
380  COMPOSITE_BALANCED=2,
381  COMPOSITE_AUTO=3
382  };
384  vtkGetMacro(CompositeStrategy, int);
386 
389  static bool IsSupported(vtkRenderWindow *context);
390 
395  virtual void WriteTimerLog(const char *){}
396 
398  virtual void RenderPiece(vtkRenderer *ren, vtkActor *act);
399 
402 
403 protected:
406 
411 
415  virtual void GetGlobalMinMax(vtkPainterCommunicator*, float&, float&){}
416 
418 
422  virtual void StartTimerEvent(const char *){}
423  virtual void EndTimerEvent(const char *){}
425 
431 
435 
437  virtual void ReportReferences(vtkGarbageCollector *collector);
438 
441 
443  void ValidateContext(vtkRenderer *renderer);
444 
446 
448  virtual bool NeedToUpdateCommunicator();
449  bool NeedToRenderGeometry(vtkRenderer *renderer, vtkActor *actor);
453  void SetUpdateAll();
455 
457 
461 
463 
465  bool VectorsToTCoords(vtkDataSet *dataObj);
468 
471 
472 protected:
473  // Unit is a pixel length.
475  double StepSize;
477 
485 
489  double MaskColor[3];
490 
492  double LICIntensity;
493  double MapModeBias;
494 
505 
507  int Enable;
509 
511  class vtkInternals;
512  vtkInternals* Internals;
513 
517 
519 
520  virtual void ReplaceShaderValues(
521  std::map<vtkShader::Type, vtkShader *> shaders,
522  vtkRenderer *ren, vtkActor *act);
524 
525 private:
526  vtkSurfaceLICMapper(const vtkSurfaceLICMapper&); // Not implemented.
527  void operator=(const vtkSurfaceLICMapper&); // Not implemented.
528 };
529 
530 #endif
vtkSurfaceLICMapper::SetEnhanceContrast
void SetEnhanceContrast(int val)
vtkSurfaceLICMapper::ProcessInformation
virtual void ProcessInformation(vtkInformation *info)
vtkSurfaceLICMapper::EndTimerEvent
virtual void EndTimerEvent(const char *)
Definition: vtkSurfaceLICMapper.h:423
vtkgl::data
GLsizei GLsizei GLenum GLenum const GLvoid * data
Definition: vtkgl.h:11339
vtkSurfaceLICMapper::AlwaysUpdate
int AlwaysUpdate
Definition: vtkSurfaceLICMapper.h:506
vtkSurfaceLICMapper::PrintSelf
void PrintSelf(ostream &os, vtkIndent indent)
vtkSurfaceLICMapper::NoiseGrainSize
int NoiseGrainSize
Definition: vtkSurfaceLICMapper.h:498
vtkSurfaceLICMapper::PrepareOutput
bool PrepareOutput()
vtkSurfaceLICMapper::SetEnable
void SetEnable(int val)
vtkSurfaceLICMapper::ClearTCoords
void ClearTCoords(vtkDataSet *data)
vtkSurfaceLICMapper::SetMaskColor
void SetMaskColor(double *val)
vtkgl::b
GLboolean GLboolean GLboolean b
Definition: vtkgl.h:12312
vtkSurfaceLICMapper::NeedToUpdateCommunicator
virtual bool NeedToUpdateCommunicator()
vtkSurfaceLICMapper::GetOutput
virtual vtkDataObject * GetOutput()
vtkSurfaceLICMapper::SetEnhancedLIC
void SetEnhancedLIC(int val)
vtkSurfaceLICMapper::NeedToUpdateOutputData
bool NeedToUpdateOutputData()
vtkSurfaceLICMapper::NeedToRenderGeometry
bool NeedToRenderGeometry(vtkRenderer *renderer, vtkActor *actor)
vtkSurfaceLICMapper::SetImpulseNoiseProbability
void SetImpulseNoiseProbability(double val)
vtkSurfaceLICMapper::~vtkSurfaceLICMapper
~vtkSurfaceLICMapper()
vtkSurfaceLICMapper::UpdateNoiseImage
void UpdateNoiseImage(vtkRenderWindow *renWin)
vtkTypeMacro
#define vtkTypeMacro(thisClass, superclass)
Definition: vtkSetGet.h:642
vtkSurfaceLICMapper::MaskIntensity
double MaskIntensity
Definition: vtkSurfaceLICMapper.h:488
vtkSurfaceLICMapper::SetNoiseType
void SetNoiseType(int type)
vtkSurfaceLICMapper::NoiseType
int NoiseType
Definition: vtkSurfaceLICMapper.h:496
vtkSurfaceLICMapper::NormalizeVectors
int NormalizeVectors
Definition: vtkSurfaceLICMapper.h:476
vtkSurfaceLICMapper::SetGenerateNoiseTexture
void SetGenerateNoiseTexture(int shouldGenerate)
vtkSurfaceLICMapper::ReleaseGraphicsResources
virtual void ReleaseGraphicsResources(vtkWindow *win)
vtkSurfaceLICMapper::ReplaceShaderValues
virtual void ReplaceShaderValues(std::map< vtkShader::Type, vtkShader * > shaders, vtkRenderer *ren, vtkActor *act)
vtkDataArray
abstract superclass for arrays of numeric data
Definition: vtkDataArray.h:55
vtkSurfaceLICMapper::New
static vtkSurfaceLICMapper * New()
vtkSurfaceLICMapper::EnhancedLIC
int EnhancedLIC
Definition: vtkSurfaceLICMapper.h:478
vtkgl::length
GLuint GLsizei GLsizei * length
Definition: vtkgl.h:11992
vtkSurfaceLICMapper::StartTimerEvent
virtual void StartTimerEvent(const char *)
Definition: vtkSurfaceLICMapper.h:422
vtkSurfaceLICMapper::NoiseGeneratorSeed
int NoiseGeneratorSeed
Definition: vtkSurfaceLICMapper.h:504
vtkSurfaceLICMapper::SetCompositeStrategy
void SetCompositeStrategy(int val)
vtkSurfaceLICMapper::SetColorMode
void SetColorMode(int val)
vtkSurfaceLICMapper::SetNoiseGeneratorSeed
void SetNoiseGeneratorSeed(int val)
vtkWindow
window superclass for vtkRenderWindow
Definition: vtkWindow.h:34
vtkSurfaceLICMapper::SetMaskIntensity
void SetMaskIntensity(double val)
vtkSurfaceLICMapper::SetEnableOn
void SetEnableOn()
Definition: vtkSurfaceLICMapper.h:94
vtkgl::shaders
const GLuint * shaders
Definition: vtkgl.h:14179
vtkgl::val
GLuint GLfloat * val
Definition: vtkgl.h:13789
vtkSurfaceLICMapper
mapper that performs LIC on the surface of arbitrary geometry.
Definition: vtkSurfaceLICMapper.h:73
vtkSurfaceLICMapper::ColorMode
int ColorMode
Definition: vtkSurfaceLICMapper.h:491
vtkSurfaceLICMapper::NumberOfSteps
int NumberOfSteps
Definition: vtkSurfaceLICMapper.h:474
vtkSurfaceLICMapper::vtkSurfaceLICMapper
vtkSurfaceLICMapper()
vtkSurfaceLICMapper::SetUpdateAll
void SetUpdateAll()
vtkSurfaceLICMapper::StepSize
double StepSize
Definition: vtkSurfaceLICMapper.h:475
vtkSurfaceLICMapper::WriteTimerLog
virtual void WriteTimerLog(const char *)
Definition: vtkSurfaceLICMapper.h:395
vtkGetVector3Macro
#define vtkGetVector3Macro(name, type)
Definition: vtkSetGet.h:304
vtkSurfaceLICMapper::MaskThreshold
double MaskThreshold
Definition: vtkSurfaceLICMapper.h:487
vtkSurfaceLICMapper::SetHighColorContrastEnhancementFactor
void SetHighColorContrastEnhancementFactor(double val)
vtkSurfaceLICMapper::RenderPiece
virtual void RenderPiece(vtkRenderer *ren, vtkActor *act)
vtkSurfaceLICMapper::ImpulseNoiseProbability
double ImpulseNoiseProbability
Definition: vtkSurfaceLICMapper.h:502
vtkSurfaceLICMapper::CreateCommunicator
void CreateCommunicator(vtkRenderer *, vtkActor *)
vtkSurfaceLICMapper::SetLowLICContrastEnhancementFactor
void SetLowLICContrastEnhancementFactor(double val)
vtkSurfaceLICMapper::SetMapperShaderParameters
virtual void SetMapperShaderParameters(vtkOpenGLHelper &cellBO, vtkRenderer *ren, vtkActor *act)
vtkSurfaceLICMapper::LICIntensity
double LICIntensity
Definition: vtkSurfaceLICMapper.h:492
vtkSurfaceLICMapper::SetAntiAlias
void SetAntiAlias(int val)
vtkSurfaceLICMapper::IsSupported
static bool IsSupported(vtkRenderWindow *context)
vtkOpenGLHelper
Definition: vtkOpenGLHelper.h:31
vtkSurfaceLICMapper::SetHighLICContrastEnhancementFactor
void SetHighLICContrastEnhancementFactor(double val)
vtkActor
represents an object (geometry & properties) in a rendered scene
Definition: vtkActor.h:51
vtkSurfaceLICMapper::AntiAlias
int AntiAlias
Definition: vtkSurfaceLICMapper.h:484
vtkSurfaceLICMapper::SetMaskOnSurface
void SetMaskOnSurface(int val)
vtkImageData
topologically and geometrically regular array of data
Definition: vtkImageData.h:45
vtkSurfaceLICMapper::SetNumberOfNoiseLevels
void SetNumberOfNoiseLevels(int val)
vtkIndent
a simple class to control print indentation
Definition: vtkIndent.h:39
vtkSurfaceLICMapper::HighLICContrastEnhancementFactor
double HighLICContrastEnhancementFactor
Definition: vtkSurfaceLICMapper.h:481
vtkSurfaceLICMapper::SetNoiseGrainSize
void SetNoiseGrainSize(int val)
vtkSurfaceLICMapper::SetNormalizeVectors
void SetNormalizeVectors(int val)
vtkSurfaceLICMapper::GenerateNoiseTexture
int GenerateNoiseTexture
Definition: vtkSurfaceLICMapper.h:495
vtkSurfaceLICMapper::GetNoiseDataSet
vtkImageData * GetNoiseDataSet()
vtkSurfaceLICMapper::SetMaskThreshold
void SetMaskThreshold(double val)
vtkSurfaceLICMapper::NoiseTextureSize
int NoiseTextureSize
Definition: vtkSurfaceLICMapper.h:497
vtkSurfaceLICMapper::SetNoiseDataSet
void SetNoiseDataSet(vtkImageData *data)
vtkSurfaceLICMapper::MaskOnSurface
int MaskOnSurface
Definition: vtkSurfaceLICMapper.h:486
vtkSurfaceLICMapper::LowColorContrastEnhancementFactor
double LowColorContrastEnhancementFactor
Definition: vtkSurfaceLICMapper.h:482
vtkSurfaceLICMapper::LowLICContrastEnhancementFactor
double LowLICContrastEnhancementFactor
Definition: vtkSurfaceLICMapper.h:480
vtkGetMacro
#define vtkGetMacro(name, type)
Definition: vtkSetGet.h:93
vtkSurfaceLICMapper::NumberOfNoiseLevels
int NumberOfNoiseLevels
Definition: vtkSurfaceLICMapper.h:501
vtkSurfaceLICMapper::SetStepSize
void SetStepSize(double val)
vtkSurfaceLICMapper::VectorsToTCoords
bool VectorsToTCoords(vtkDataSet *dataObj)
vtkSurfaceLICMapper::VectorsToTCoords
bool VectorsToTCoords(vtkDataObject *dataObj)
vtkSurfaceLICMapper::MapModeBias
double MapModeBias
Definition: vtkSurfaceLICMapper.h:493
vtkGarbageCollector
Detect and break reference loops.
Definition: vtkGarbageCollector.h:99
vtkSurfaceLICMapper::Enable
int Enable
Definition: vtkSurfaceLICMapper.h:507
vtkSurfaceLICMapper::ReportReferences
virtual void ReportReferences(vtkGarbageCollector *collector)
vtkSurfaceLICMapper::NeedToComputeLIC
bool NeedToComputeLIC()
vtkSurfaceLICMapper::SetMaskColor
void SetMaskColor(double r, double g, double b)
Definition: vtkSurfaceLICMapper.h:157
vtkSurfaceLICMapper::EnhanceContrast
int EnhanceContrast
Definition: vtkSurfaceLICMapper.h:479
vtkDataSet
abstract class to specify dataset behavior
Definition: vtkDataSet.h:62
vtkSurfaceLICMapper::GetGlobalMinMax
virtual void GetGlobalMinMax(vtkPainterCommunicator *, float &, float &)
Definition: vtkSurfaceLICMapper.h:415
vtkBooleanMacro
vtkBooleanMacro(IgnoreDriverBugs, bool)
vtkInformation
Store vtkAlgorithm input/output information.
Definition: vtkInformation.h:86
vtkX3D::info
@ info
Definition: vtkX3D.h:376
vtkSurfaceLICMapper::SetLowColorContrastEnhancementFactor
void SetLowColorContrastEnhancementFactor(double val)
vtkSurfaceLICMapper::Internals
vtkInternals * Internals
Definition: vtkSurfaceLICMapper.h:511
vtkPainterCommunicator
Definition: vtkPainterCommunicator.h:32
vtkgl::r
GLdouble GLdouble GLdouble r
Definition: vtkgl.h:11610
vtkSurfaceLICMapper::SetImpulseNoiseBackgroundValue
void SetImpulseNoiseBackgroundValue(double val)
vtkgl::g
GLboolean GLboolean g
Definition: vtkgl.h:12312
vtkSurfaceLICMapper::HighColorContrastEnhancementFactor
double HighColorContrastEnhancementFactor
Definition: vtkSurfaceLICMapper.h:483
vtkSurfaceLICMapper::SetEnableOff
void SetEnableOff()
Definition: vtkSurfaceLICMapper.h:95
vtkSurfaceLICMapper::ShallowCopy
void ShallowCopy(vtkAbstractMapper *)
vtkRenderer
abstract specification for renderers
Definition: vtkRenderer.h:64
vtkSurfaceLICMapper::ImpulseNoiseBackgroundValue
double ImpulseNoiseBackgroundValue
Definition: vtkSurfaceLICMapper.h:503
vtkSurfaceLICMapper::SetMinNoiseValue
void SetMinNoiseValue(double val)
vtkSurfaceLICMapper::InitializeResources
void InitializeResources()
vtkSurfaceLICMapper::NeedToColorLIC
bool NeedToColorLIC()
vtkSurfaceLICMapper::SetMapModeBias
void SetMapModeBias(double val)
vtkSurfaceLICMapper::CanRenderSurfaceLIC
bool CanRenderSurfaceLIC(vtkActor *actor)
vtkSurfaceLICMapper::SetNumberOfSteps
void SetNumberOfSteps(int val)
vtkSurfaceLICMapper::MaxNoiseValue
double MaxNoiseValue
Definition: vtkSurfaceLICMapper.h:500
vtkSurfaceLICMapper::ValidateContext
void ValidateContext(vtkRenderer *renderer)
vtkRenderWindow
create a window for renderers to draw into
Definition: vtkRenderWindow.h:89
vtkDataObject
general representation of visualization data
Definition: vtkDataObject.h:65
vtkSurfaceLICMapper::NeedToGatherVectors
bool NeedToGatherVectors()
vtkSurfaceLICMapper::CreateCommunicator
virtual vtkPainterCommunicator * CreateCommunicator(int)
vtkSurfaceLICMapper::Output
vtkDataObject * Output
Definition: vtkSurfaceLICMapper.h:510
vtkgl::type
GLuint GLuint GLsizei GLenum type
Definition: vtkgl.h:11315
vtkOpenGLPolyDataMapper
a PolyDataMapper for the OpenGL library
Definition: vtkOpenGLPolyDataMapper.h:43
vtkSurfaceLICMapper::MinNoiseValue
double MinNoiseValue
Definition: vtkSurfaceLICMapper.h:499
vtkSurfaceLICMapper::SetLICIntensity
void SetLICIntensity(double val)
vtkSurfaceLICMapper::CompositeStrategy
int CompositeStrategy
Definition: vtkSurfaceLICMapper.h:508
vtkSurfaceLICMapper::SetNoiseTextureSize
void SetNoiseTextureSize(int length)
vtkSurfaceLICMapper::SetMaxNoiseValue
void SetMaxNoiseValue(double val)
vtkAbstractMapper
abstract class specifies interface to map data
Definition: vtkAbstractMapper.h:52