VTK
vtkValuePainter.h
Go to the documentation of this file.
1 /*=========================================================================
2 
3  Program: Visualization Toolkit
4  Module: vtkValuePainter.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 =========================================================================*/
31 #ifndef vtkValuePainter_h
32 #define vtkValuePainter_h
33 
34 #include "vtkRenderingOpenGLModule.h" // For export macro
36 
40 
41 class VTKRENDERINGOPENGL_EXPORT vtkValuePainter :
43 {
44 public:
45  static vtkValuePainter* New();
47  void PrintSelf(ostream& os, vtkIndent indent);
48 
50 
56  void SetInputArrayToProcess(int fieldAssociation, const char *name);
57  void SetInputArrayToProcess(int fieldAssociation, int fieldAttributeType);
59 
66 
71  void SetScalarRange(double min, double max);
72 
74 
84 
89  static void ValueToColor(double value, double min, double scale,
90  unsigned char *color);
91 
92  static void ColorToValue(unsigned char *color, double min, double scale,
93  double &value);
94 
95 protected:
98 
103 
107  virtual void RenderInternal(vtkRenderer* renderer, vtkActor* actor,
108  unsigned long typeflags, bool forceCompileOnly);
109 
114  void DrawCells(int mode, vtkCellArray *connectivity,
115  vtkIdType startCellId, vtkRenderer *renderer);
116 
117 private:
118  vtkValuePainter(const vtkValuePainter&) VTK_DELETE_FUNCTION;
119  void operator=(const vtkValuePainter&) VTK_DELETE_FUNCTION;
120 
121  class vtkInternals;
122  vtkInternals *Internals;
123 };
124 
125 #endif
represents an object (geometry & properties) in a rendered scene
Definition: vtkActor.h:52
object to represent cell connectivity
Definition: vtkCellArray.h:51
a simple class to control print indentation
Definition: vtkIndent.h:40
Key for integer values in vtkInformation.
Key for string values in vtkInformation.
Store vtkAlgorithm input/output information.
abstract specification for renderers
Definition: vtkRenderer.h:64
A standard implementation of vtkPolyDataPainter.
painter that renders arrays encoded into pixel colors.
void SetInputComponentToProcess(int comp)
Set the component (0..numcomponents-1) of the specified array to be drawn.
static vtkInformationIntegerKey * ARRAY_ID()
static vtkInformationDoubleVectorKey * SCALAR_RANGE()
virtual void ProcessInformation(vtkInformation *)
overridden to look for informationkeys that specify what array to draw
void SetInputArrayToProcess(int fieldAssociation, int fieldAttributeType)
static vtkValuePainter * New()
void SetInputArrayToProcess(int fieldAssociation, const char *name)
Set the array to be drawn.
static void ColorToValue(unsigned char *color, double min, double scale, double &value)
virtual void RenderInternal(vtkRenderer *renderer, vtkActor *actor, unsigned long typeflags, bool forceCompileOnly)
overridden to draw the chosen array value directly as color
static vtkInformationStringKey * ARRAY_NAME()
void DrawCells(int mode, vtkCellArray *connectivity, vtkIdType startCellId, vtkRenderer *renderer)
overridden implement drawlines, points, strips
static vtkInformationIntegerKey * ARRAY_COMPONENT()
static vtkInformationIntegerKey * SCALAR_MODE()
Optionally passed down from RenderPass pipeline to controls what data array to draw.
void PrintSelf(ostream &os, vtkIndent indent)
Methods invoked by print to print information about the object including superclasses.
void SetScalarRange(double min, double max)
Use the provided scalar range instead of the range of the input data array.
static void ValueToColor(double value, double min, double scale, unsigned char *color)
Internal convenience method to convert a value to a color TODO: make this templated and programmable.
@ mode
Definition: vtkX3D.h:247
@ value
Definition: vtkX3D.h:220
@ scale
Definition: vtkX3D.h:229
@ color
Definition: vtkX3D.h:221
@ name
Definition: vtkX3D.h:219
int vtkIdType
Definition: vtkType.h:287
#define max(a, b)