VTK
/Users/kitware/Dashboards/MyTests/VTK_BLD_Release_docs/Utilities/Doxygen/dox/Rendering/OpenGL/vtkValuePainter.h
Go to the documentation of this file.
00001 /*=========================================================================
00002 
00003   Program:   Visualization Toolkit
00004   Module:    vtkValuePainter.h
00005 
00006   Copyright (c) Ken Martin, Will Schroeder, Bill Lorensen
00007   All rights reserved.
00008   See Copyright.txt or http://www.kitware.com/Copyright.htm for details.
00009 
00010      This software is distributed WITHOUT ANY WARRANTY; without even
00011      the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
00012      PURPOSE.  See the above copyright notice for more information.
00013 
00014 =========================================================================*/
00030 #ifndef vtkValuePainter_h
00031 #define vtkValuePainter_h
00032 
00033 #include "vtkRenderingOpenGLModule.h" // For export macro
00034 #include "vtkStandardPolyDataPainter.h"
00035 
00036 class vtkInformationDoubleVectorKey;
00037 class vtkInformationIntegerKey;
00038 class vtkInformationStringKey;
00039 
00040 class VTKRENDERINGOPENGL_EXPORT vtkValuePainter :
00041   public vtkStandardPolyDataPainter
00042 {
00043 public:
00044   static vtkValuePainter* New();
00045   vtkTypeMacro(vtkValuePainter, vtkStandardPolyDataPainter);
00046   void PrintSelf(ostream& os, vtkIndent indent);
00047 
00049 
00053   void SetInputArrayToProcess(int fieldAssociation, const char *name);
00054   void SetInputArrayToProcess(int fieldAssociation, int fieldAttributeType);
00056 
00060   void SetInputComponentToProcess(int comp);
00061 
00064   void SetScalarRange(double min, double max);
00065 
00067 
00069   static vtkInformationIntegerKey* SCALAR_MODE();
00070   static vtkInformationDoubleVectorKey* SCALAR_RANGE();
00071   static vtkInformationIntegerKey* ARRAY_ID();
00072   static vtkInformationStringKey* ARRAY_NAME();
00073   static vtkInformationIntegerKey* ARRAY_COMPONENT();
00075 
00077 
00079   static void ValueToColor(double value, double min, double scale,
00080                            unsigned char *color);
00082 
00083   static void ColorToValue(unsigned char *color, double min, double scale,
00084                            double &value);
00085 
00086 protected:
00087   vtkValuePainter();
00088   ~vtkValuePainter();
00089 
00092   virtual void ProcessInformation(vtkInformation*);
00093 
00095 
00096   virtual void RenderInternal(vtkRenderer* renderer, vtkActor* actor,
00097     unsigned long typeflags, bool forceCompileOnly);
00099 
00101 
00102   void DrawCells(int mode, vtkCellArray *connectivity,
00103     vtkIdType startCellId, vtkRenderer *renderer);
00105 
00106 private:
00107   vtkValuePainter(const vtkValuePainter&); // Not implemented.
00108   void operator=(const vtkValuePainter&); // Not implemented.
00109 
00110   class vtkInternals;
00111   vtkInternals *Internals;
00112 };
00113 
00114 #endif