VTK
vtkScalarsToColorsPainter.h
Go to the documentation of this file.
1 /*=========================================================================
2 
3  Program: Visualization Toolkit
4  Module: vtkScalarsToColorsPainter.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 =========================================================================*/
27 #ifndef vtkScalarsToColorsPainter_h
28 #define vtkScalarsToColorsPainter_h
29 
30 #include "vtkRenderingOpenGLModule.h" // For export macro
31 #include "vtkPainter.h"
32 #include "vtkSmartPointer.h" // needed for vtkSmartPointer.
33 class vtkDataArray;
34 class vtkImageData;
39 class vtkDataSet;
40 class vtkScalarsToColors;
41 
42 class VTKRENDERINGOPENGL_EXPORT vtkScalarsToColorsPainter : public vtkPainter
43 {
44 public:
47  void PrintSelf(ostream& os, vtkIndent indent);
48 
55  static vtkInformationIntegerKey* USE_LOOKUP_TABLE_SCALAR_RANGE();
56 
60  static vtkInformationDoubleVectorKey* SCALAR_RANGE();
61 
64  static vtkInformationIntegerKey* SCALAR_MODE();
65 
71  static vtkInformationIntegerKey* COLOR_MODE();
72 
76  static vtkInformationIntegerKey* INTERPOLATE_SCALARS_BEFORE_MAPPING();
77 
79 
80  static vtkInformationObjectBaseKey* LOOKUP_TABLE();
81  void SetLookupTable(vtkScalarsToColors *lut);
82  vtkScalarsToColors *GetLookupTable();
84 
87  virtual void CreateDefaultLookupTable();
88 
91  static vtkInformationIntegerKey* SCALAR_VISIBILITY();
92 
94 
95  static vtkInformationIntegerKey* ARRAY_ACCESS_MODE();
96  static vtkInformationIntegerKey* ARRAY_ID();
97  static vtkInformationStringKey* ARRAY_NAME();
98  static vtkInformationIntegerKey* ARRAY_COMPONENT();
99  static vtkInformationIntegerKey* FIELD_DATA_TUPLE_ID();
101 
103  static vtkInformationIntegerKey* SCALAR_MATERIAL_MODE();
104 
112  virtual int GetPremultiplyColorsWithAlpha(vtkActor* actor);
113 
116  virtual vtkDataObject *GetOutput();
117 
121  virtual vtkIdType GetTextureSizeLimit();
122 
123 //BTX
124 protected:
126  virtual ~vtkScalarsToColorsPainter();
127 
129  virtual vtkDataObject* NewClone(vtkDataObject* data);
130 
132 
135  void MapScalarsToTexture(vtkDataSet* output,
136  vtkDataArray* scalars, vtkDataSet* input);
138 
140  virtual void PrepareForRendering(vtkRenderer* renderer, vtkActor* actor);
141 
143 
145  virtual void MapScalars(vtkDataSet* output,
146  double alpha, int multiply_with_alpha,
147  vtkDataSet* input);
149 
152  virtual void ProcessInformation(vtkInformation*);
153 
155  virtual void ReportReferences(vtkGarbageCollector *collector);
156 
163  int CanUseTextureMapForColoring(vtkDataObject* input);
164 
165 
167  void UpdateColorTextureMap(double alpha, int multiply_with_alpha);
168 
169  // Methods to set the ivars. These are purposefully protected.
170  // The only means of affecting these should be using the vtkInformation
171  // object.
172  vtkSetMacro(UseLookupTableScalarRange, int);
173  vtkSetVector2Macro(ScalarRange, double);
174  vtkSetMacro(ScalarMode, int);
175  vtkSetMacro(ColorMode, int);
176  vtkSetMacro(InterpolateScalarsBeforeMapping, int);
177  vtkSetMacro(ScalarVisibility, int);
178  vtkSetMacro(ScalarMaterialMode, int);
179  vtkSetMacro(ArrayAccessMode, int);
180  vtkSetMacro(ArrayComponent, int);
181  vtkSetMacro(ArrayId, int);
182  vtkSetStringMacro(ArrayName);
183  vtkSetMacro(FieldDataTupleId, vtkIdType);
184 
186 
189  int ArrayId;
190  char* ArrayName;
192 
194  // Lookup table provided via the scalars. This gets preference over the one
195  // set on the mapper by the user.
202  double LastUsedAlpha; // Essential to ensure alpha changes work correctly
203  // for composite datasets.
205  double ScalarRange[2];
208 
210 
211  // This is set when MapScalars decides to use vertex colors for atleast on
212  // dataset in the current pass.
214 
215 private:
216  vtkScalarsToColorsPainter(const vtkScalarsToColorsPainter&); // Not implemented.
217  void operator=(const vtkScalarsToColorsPainter&); // Not implemented.
218 //ETX
219 };
220 
221 #endif
represents an object (geometry & properties) in a rendered scene
Definition: vtkActor.h:50
Store vtkAlgorithm input/output information.
abstract class to specify dataset behavior
Definition: vtkDataSet.h:61
virtual void ProcessInformation(vtkInformation *)
Definition: vtkPainter.h:202
virtual void ReportReferences(vtkGarbageCollector *collector)
record modification and/or execution time
Definition: vtkTimeStamp.h:34
virtual vtkDataObject * GetOutput()
Definition: vtkPainter.h:156
virtual void PrepareForRendering(vtkRenderer *, vtkActor *)
Definition: vtkPainter.h:184
abstract specification for renderers
Definition: vtkRenderer.h:62
vtkSmartPointer< vtkImageData > ColorTextureMap
int vtkIdType
Definition: vtkType.h:247
Key for string values in vtkInformation.
Detect and break reference loops.
Superclass for mapping scalar values to colors.
Key for double vector values.
a simple class to control print indentation
Definition: vtkIndent.h:38
topologically and geometrically regular array of data
Definition: vtkImageData.h:44
Key for integer values in vtkInformation.
abstract superclass for arrays of numeric data
Definition: vtkDataArray.h:54
Key for vtkObjectBase values.
painter that converts scalars to colors. It enable/disables coloring state depending on the ScalarMod...
Abstract class for drawing poly data.
Definition: vtkPainter.h:63
static vtkObject * New()
general representation of visualization data
Definition: vtkDataObject.h:64
vtkSmartPointer< vtkScalarsToColors > ScalarsLookupTable
virtual void PrintSelf(ostream &os, vtkIndent indent)