VTK
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
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 "vtkRenderingCoreModule.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 
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();
100 
102  static vtkInformationIntegerKey* SCALAR_MATERIAL_MODE();
103 
111  virtual int GetPremultiplyColorsWithAlpha(vtkActor* actor);
112 
115  virtual vtkDataObject *GetOutput();
116 
120  virtual vtkIdType GetTextureSizeLimit();
121 
122 //BTX
123 protected:
125  virtual ~vtkScalarsToColorsPainter();
126 
128  virtual vtkDataObject* NewClone(vtkDataObject* data);
129 
131 
134  void MapScalarsToTexture(vtkDataSet* output,
135  vtkDataArray* scalars, vtkDataSet* input);
137 
139  virtual void PrepareForRendering(vtkRenderer* renderer, vtkActor* actor);
140 
142 
144  virtual void MapScalars(vtkDataSet* output,
145  double alpha, int multiply_with_alpha,
146  vtkDataSet* input);
148 
151  virtual void ProcessInformation(vtkInformation*);
152 
154  virtual void ReportReferences(vtkGarbageCollector *collector);
155 
162  int CanUseTextureMapForColoring(vtkDataObject* input);
163 
164 
166  void UpdateColorTextureMap(double alpha, int multiply_with_alpha);
167 
168  // Methods to set the ivars. These are purposefully protected.
169  // The only means of affecting these should be using the vtkInformation
170  // object.
171  vtkSetMacro(UseLookupTableScalarRange, int);
172  vtkSetVector2Macro(ScalarRange, double);
173  vtkSetMacro(ScalarMode, int);
174  vtkSetMacro(ColorMode, int);
175  vtkSetMacro(InterpolateScalarsBeforeMapping, int);
176  vtkSetMacro(ScalarVisibility, int);
177  vtkSetMacro(ScalarMaterialMode, int);
178  vtkSetMacro(ArrayAccessMode, int);
179  vtkSetMacro(ArrayComponent, int);
180  vtkSetMacro(ArrayId, int);
181  vtkSetStringMacro(ArrayName);
182 
184 
187  int ArrayId;
188  char* ArrayName;
189 
191  // Lookup table provided via the scalars. This gets preference over the one
192  // set on the mapper by the user.
199  double LastUsedAlpha; // Essential to ensure alpha changes work correctly
200  // for composite datasets.
202  double ScalarRange[2];
205 
207 
208  // This is set when MapScalars decides to use vertex colors for atleast on
209  // dataset in the current pass.
211 
212 private:
213  vtkScalarsToColorsPainter(const vtkScalarsToColorsPainter&); // Not implemented.
214  void operator=(const vtkScalarsToColorsPainter&); // Not implemented.
215 //ETX
216 };
217 
218 #endif
GLsizei GLsizei GLenum GLenum const GLvoid * data
Definition: vtkgl.h:11339
represents an object (geometry & properties) in a rendered scene
Definition: vtkActor.h:50
Store vtkAlgorithm input/output information.
GLenum GLenum GLenum input
Definition: vtkgl.h:15941
abstract class to specify dataset behavior
Definition: vtkDataSet.h:60
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:63
vtkSmartPointer< vtkImageData > ColorTextureMap
int vtkIdType
Definition: vtkType.h:268
#define vtkSetStringMacro(name)
Definition: vtkSetGet.h:94
Key for string values in vtkInformation.
#define vtkTypeMacro(thisClass, superclass)
Definition: vtkSetGet.h:619
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:53
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
#define VTKRENDERINGCORE_EXPORT
GLclampf GLclampf GLclampf alpha
Definition: vtkgl.h:11313
static vtkObject * New()
general representation of visualization data
Definition: vtkDataObject.h:64
#define vtkSetVector2Macro(name, type)
Definition: vtkSetGet.h:244
vtkSmartPointer< vtkScalarsToColors > ScalarsLookupTable
virtual void PrintSelf(ostream &os, vtkIndent indent)
#define vtkSetMacro(name, type)
Definition: vtkSetGet.h:69