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 "vtkPainter.h"
31 #include "vtkSmartPointer.h" // needed for vtkSmartPointer.
32 class vtkDataArray;
33 class vtkImageData;
38 class vtkDataSet;
39 class vtkScalarsToColors;
40 
42 {
43 public:
46  void PrintSelf(ostream& os, vtkIndent indent);
47 
54  static vtkInformationIntegerKey* USE_LOOKUP_TABLE_SCALAR_RANGE();
55 
59  static vtkInformationDoubleVectorKey* SCALAR_RANGE();
60 
63  static vtkInformationIntegerKey* SCALAR_MODE();
64 
70  static vtkInformationIntegerKey* COLOR_MODE();
71 
75  static vtkInformationIntegerKey* INTERPOLATE_SCALARS_BEFORE_MAPPING();
76 
78 
79  static vtkInformationObjectBaseKey* LOOKUP_TABLE();
80  void SetLookupTable(vtkScalarsToColors *lut);
81  vtkScalarsToColors *GetLookupTable();
83 
86  virtual void CreateDefaultLookupTable();
87 
90  static vtkInformationIntegerKey* SCALAR_VISIBILITY();
91 
93 
94  static vtkInformationIntegerKey* ARRAY_ACCESS_MODE();
95  static vtkInformationIntegerKey* ARRAY_ID();
96  static vtkInformationStringKey* ARRAY_NAME();
97  static vtkInformationIntegerKey* ARRAY_COMPONENT();
99 
101  static vtkInformationIntegerKey* SCALAR_MATERIAL_MODE();
102 
110  virtual int GetPremultiplyColorsWithAlpha(vtkActor* actor);
111 
114  virtual vtkDataObject *GetOutput();
115 
119  virtual vtkIdType GetTextureSizeLimit();
120 
121 //BTX
122 protected:
124  virtual ~vtkScalarsToColorsPainter();
125 
127  virtual vtkDataObject* NewClone(vtkDataObject* data);
128 
130 
133  void MapScalarsToTexture(vtkDataSet* output,
134  vtkDataArray* scalars, vtkDataSet* input);
136 
138  virtual void PrepareForRendering(vtkRenderer* renderer, vtkActor* actor);
139 
141 
143  virtual void MapScalars(vtkDataSet* output,
144  double alpha, int multiply_with_alpha,
145  vtkDataSet* input);
147 
150  virtual void ProcessInformation(vtkInformation*);
151 
153  virtual void ReportReferences(vtkGarbageCollector *collector);
154 
161  int CanUseTextureMapForColoring(vtkDataObject* input);
162 
163 
165  void UpdateColorTextureMap(double alpha, int multiply_with_alpha);
166 
167  // Methods to set the ivars. These are purposefully protected.
168  // The only means of affecting these should be using the vtkInformation
169  // object.
170  vtkSetMacro(UseLookupTableScalarRange,int);
171  vtkSetVector2Macro(ScalarRange,double);
172  vtkSetMacro(ScalarMode, int);
173  vtkSetMacro(ColorMode, int);
174  vtkSetMacro(InterpolateScalarsBeforeMapping,int);
175  vtkSetMacro(ScalarVisibility,int);
176  vtkSetMacro(ScalarMaterialMode,int);
177  vtkSetMacro(ArrayAccessMode, int);
178  vtkSetMacro(ArrayId, int);
179  vtkSetStringMacro(ArrayName);
180  vtkSetMacro(ArrayComponent, int);
181 
183 
186  int ArrayId;
187  char* ArrayName;
188 
190  // Lookup table provided via the scalars. This gets preference over the one
191  // set on the mapper by the user.
198  double LastUsedAlpha; // Essential to ensure alpha changes work correctly
199  // for composite datasets.
201  double ScalarRange[2];
204 
206 
207  // This is set when MapScalars decides to use vertex colors for atleast on
208  // dataset in the current pass.
210 
211 private:
212  vtkScalarsToColorsPainter(const vtkScalarsToColorsPainter&); // Not implemented.
213  void operator=(const vtkScalarsToColorsPainter&); // Not implemented.
214 //ETX
215 };
216 
217 #endif
218