VTK
vtkPolyDataMapper2D.h
Go to the documentation of this file.
1 /*=========================================================================
2 
3  Program: Visualization Toolkit
4  Module: vtkPolyDataMapper2D.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 =========================================================================*/
38 #ifndef __vtkPolyDataMapper2D_h
39 #define __vtkPolyDataMapper2D_h
40 
41 
42 #include "vtkMapper2D.h"
43 
44 class vtkCoordinate;
45 class vtkPolyData;
46 class vtkScalarsToColors;
48 
50 {
51 public:
53  static vtkPolyDataMapper2D *New();
54  void PrintSelf(ostream& os, vtkIndent indent);
55 
57 
58  void SetInput(vtkPolyData *in);
59  vtkPolyData *GetInput();
61 
63 
64  void SetLookupTable(vtkScalarsToColors *lut);
65  vtkScalarsToColors *GetLookupTable();
67 
70  virtual void CreateDefaultLookupTable();
71 
73 
75  vtkSetMacro(ScalarVisibility,int);
76  vtkGetMacro(ScalarVisibility,int);
77  vtkBooleanMacro(ScalarVisibility,int);
79 
81 
88  vtkSetMacro(ColorMode,int);
89  vtkGetMacro(ColorMode,int);
90  void SetColorModeToDefault();
91  void SetColorModeToMapScalars();
93 
95  const char *GetColorModeAsString();
96 
98 
104  vtkSetMacro(UseLookupTableScalarRange,int);
105  vtkGetMacro(UseLookupTableScalarRange,int);
106  vtkBooleanMacro(UseLookupTableScalarRange,int);
108 
110 
113  vtkSetVector2Macro(ScalarRange,double);
114  vtkGetVectorMacro(ScalarRange,double,2);
116 
118 
128  vtkSetMacro(ScalarMode,int);
129  vtkGetMacro(ScalarMode,int);
131  this->SetScalarMode(VTK_SCALAR_MODE_DEFAULT);};
133  this->SetScalarMode(VTK_SCALAR_MODE_USE_POINT_DATA);};
135  this->SetScalarMode(VTK_SCALAR_MODE_USE_CELL_DATA);};
137  this->SetScalarMode(VTK_SCALAR_MODE_USE_POINT_FIELD_DATA);};
139  this->SetScalarMode(VTK_SCALAR_MODE_USE_CELL_FIELD_DATA);};
141 
143 
144  void ColorByArrayComponent(int arrayNum, int component);
145  void ColorByArrayComponent(char* arrayName, int component);
147 
149 
150  char* GetArrayName() { return this->ArrayName; }
151  int GetArrayId() { return this->ArrayId; }
152  int GetArrayAccessMode() { return this->ArrayAccessMode; }
153  int GetArrayComponent() { return this->ArrayComponent; }
155 
158  virtual unsigned long GetMTime();
159 
161 
165  virtual void SetTransformCoordinate(vtkCoordinate*);
166  vtkGetObjectMacro(TransformCoordinate, vtkCoordinate);
168 
174  vtkUnsignedCharArray *MapScalars(double alpha);
175 
178 
179 protected:
182 
184 
188  double ScalarRange[2];
192 
194 
195  virtual int FillInputPortInformation(int, vtkInformation*);
196 
197  // for coloring by a component of a field data array
198  int ArrayId;
199  char ArrayName[256];
202 private:
203  vtkPolyDataMapper2D(const vtkPolyDataMapper2D&); // Not implemented.
204  void operator=(const vtkPolyDataMapper2D&); // Not implemented.
205 };
206 
207 
208 #endif
209