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
vtkValuePainter::SCALAR_RANGE
static vtkInformationDoubleVectorKey * SCALAR_RANGE()
vtkInformationStringKey
Key for string values in vtkInformation.
Definition: vtkInformationStringKey.h:37
vtkValuePainter::SetInputComponentToProcess
void SetInputComponentToProcess(int comp)
Set the component (0..numcomponents-1) of the specified array to be drawn.
vtkX3D::scale
@ scale
Definition: vtkX3D.h:229
vtkX3D::value
@ value
Definition: vtkX3D.h:220
vtkIdType
int vtkIdType
Definition: vtkType.h:287
vtkValuePainter::ARRAY_NAME
static vtkInformationStringKey * ARRAY_NAME()
vtkValuePainter::ARRAY_COMPONENT
static vtkInformationIntegerKey * ARRAY_COMPONENT()
vtkValuePainter::vtkValuePainter
vtkValuePainter()
vtkValuePainter::ARRAY_ID
static vtkInformationIntegerKey * ARRAY_ID()
vtkValuePainter::SetInputArrayToProcess
void SetInputArrayToProcess(int fieldAssociation, const char *name)
Set the array to be drawn.
max
#define max(a, b)
Definition: vtkX3DExporterFIWriterHelper.h:31
vtkX3D::color
@ color
Definition: vtkX3D.h:221
vtkValuePainter::New
static vtkValuePainter * New()
vtkValuePainter::RenderInternal
virtual void RenderInternal(vtkRenderer *renderer, vtkActor *actor, unsigned long typeflags, bool forceCompileOnly)
overridden to draw the chosen array value directly as color
vtkValuePainter::~vtkValuePainter
~vtkValuePainter()
vtkInformationIntegerKey
Key for integer values in vtkInformation.
Definition: vtkInformationIntegerKey.h:35
vtkActor
represents an object (geometry & properties) in a rendered scene
Definition: vtkActor.h:52
vtkValuePainter::SetScalarRange
void SetScalarRange(double min, double max)
Use the provided scalar range instead of the range of the input data array.
vtkIndent
a simple class to control print indentation
Definition: vtkIndent.h:40
vtkCellArray
object to represent cell connectivity
Definition: vtkCellArray.h:51
vtkValuePainter
painter that renders arrays encoded into pixel colors.
Definition: vtkValuePainter.h:43
vtkX3D::name
@ name
Definition: vtkX3D.h:219
vtkInformation
Store vtkAlgorithm input/output information.
Definition: vtkInformation.h:87
vtkValuePainter::ColorToValue
static void ColorToValue(unsigned char *color, double min, double scale, double &value)
vtkValuePainter::DrawCells
void DrawCells(int mode, vtkCellArray *connectivity, vtkIdType startCellId, vtkRenderer *renderer)
overridden implement drawlines, points, strips
vtkInformationDoubleVectorKey
Key for double vector values.
Definition: vtkInformationDoubleVectorKey.h:35
vtkRenderer
abstract specification for renderers
Definition: vtkRenderer.h:64
vtkValuePainter::SCALAR_MODE
static vtkInformationIntegerKey * SCALAR_MODE()
Optionally passed down from RenderPass pipeline to controls what data array to draw.
vtkX3D::mode
@ mode
Definition: vtkX3D.h:247
vtkStandardPolyDataPainter
A standard implementation of vtkPolyDataPainter.
Definition: vtkStandardPolyDataPainter.h:53
vtkValuePainter::ValueToColor
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.
vtkValuePainter::PrintSelf
void PrintSelf(ostream &os, vtkIndent indent)
Methods invoked by print to print information about the object including superclasses.
vtkValuePainter::ProcessInformation
virtual void ProcessInformation(vtkInformation *)
overridden to look for informationkeys that specify what array to draw
vtkValuePainter::SetInputArrayToProcess
void SetInputArrayToProcess(int fieldAssociation, int fieldAttributeType)
vtkStandardPolyDataPainter.h