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 "vtkRenderingCoreModule.h" // For export macro
43 #include "vtkMapper2D.h"
44 
45 class vtkCoordinate;
46 class vtkPolyData;
47 class vtkScalarsToColors;
49 
51 {
52 public:
54  static vtkPolyDataMapper2D *New();
55  void PrintSelf(ostream& os, vtkIndent indent);
56 
58 
59  void SetInputData(vtkPolyData *in);
60  vtkPolyData *GetInput();
62 
64 
65  void SetLookupTable(vtkScalarsToColors *lut);
66  vtkScalarsToColors *GetLookupTable();
68 
71  virtual void CreateDefaultLookupTable();
72 
74 
76  vtkSetMacro(ScalarVisibility, int);
77  vtkGetMacro(ScalarVisibility, int);
78  vtkBooleanMacro(ScalarVisibility, int);
80 
82 
92  vtkSetMacro(ColorMode, int);
93  vtkGetMacro(ColorMode, int);
94  void SetColorModeToDefault();
95  void SetColorModeToMapScalars();
96  void SetColorModeToDirectScalars();
98 
100  const char *GetColorModeAsString();
101 
103 
109  vtkSetMacro(UseLookupTableScalarRange, int);
110  vtkGetMacro(UseLookupTableScalarRange, int);
111  vtkBooleanMacro(UseLookupTableScalarRange, int);
113 
115 
118  vtkSetVector2Macro(ScalarRange, double);
119  vtkGetVectorMacro(ScalarRange, double, 2);
121 
123 
133  vtkSetMacro(ScalarMode, int);
134  vtkGetMacro(ScalarMode, int);
136  { this->SetScalarMode(VTK_SCALAR_MODE_DEFAULT); }
138  { this->SetScalarMode(VTK_SCALAR_MODE_USE_POINT_DATA); }
140  { this->SetScalarMode(VTK_SCALAR_MODE_USE_CELL_DATA); }
142  { this->SetScalarMode(VTK_SCALAR_MODE_USE_POINT_FIELD_DATA); }
144  { this->SetScalarMode(VTK_SCALAR_MODE_USE_CELL_FIELD_DATA); }
146 
148 
149  void ColorByArrayComponent(int arrayNum, int component);
150  void ColorByArrayComponent(char* arrayName, int component);
152 
154 
155  char* GetArrayName() { return this->ArrayName; }
156  int GetArrayId() { return this->ArrayId; }
157  int GetArrayAccessMode() { return this->ArrayAccessMode; }
158  int GetArrayComponent() { return this->ArrayComponent; }
160 
163  virtual unsigned long GetMTime();
164 
166 
170  virtual void SetTransformCoordinate(vtkCoordinate*);
171  vtkGetObjectMacro(TransformCoordinate, vtkCoordinate);
173 
175 
178  vtkGetMacro(TransformCoordinateUseDouble, bool);
179  vtkSetMacro(TransformCoordinateUseDouble, bool);
180  vtkBooleanMacro(TransformCoordinateUseDouble, bool);
182 
188  vtkUnsignedCharArray *MapScalars(double alpha);
189 
192 
193 protected:
196 
197  virtual int FillInputPortInformation(int, vtkInformation*);
198 
200 
204  double ScalarRange[2];
208 
211 
212  // for coloring by a component of a field data array
213  int ArrayId;
214  char ArrayName[256];
217 private:
218  vtkPolyDataMapper2D(const vtkPolyDataMapper2D&); // Not implemented.
219  void operator=(const vtkPolyDataMapper2D&); // Not implemented.
220 };
221 
222 
223 #endif
224 
virtual unsigned long GetMTime()
#define VTK_SCALAR_MODE_USE_CELL_FIELD_DATA
Store vtkAlgorithm input/output information.
record modification and/or execution time
Definition: vtkTimeStamp.h:34
concrete dataset represents vertices, lines, polygons, and triangle strips
Definition: vtkPolyData.h:83
Superclass for mapping scalar values to colors.
#define VTK_SCALAR_MODE_USE_POINT_DATA
vtkScalarsToColors * LookupTable
a simple class to control print indentation
Definition: vtkIndent.h:38
#define VTK_SCALAR_MODE_USE_POINT_FIELD_DATA
void PrintSelf(ostream &os, vtkIndent indent)
virtual int FillInputPortInformation(int port, vtkInformation *info)
vtkCoordinate * TransformCoordinate
perform coordinate transformation, and represent position, in a variety of vtk coordinate systems ...
Definition: vtkCoordinate.h:69
dynamic, self-adjusting array of unsigned char
abstract class specifies interface to map data
#define VTKRENDERINGCORE_EXPORT
void ShallowCopy(vtkAbstractMapper *m)
static vtkAlgorithm * New()
#define VTK_SCALAR_MODE_USE_CELL_DATA
abstract class specifies interface for objects which render 2D actors
Definition: vtkMapper2D.h:34
draw vtkPolyData onto the image plane
#define VTK_SCALAR_MODE_DEFAULT
vtkUnsignedCharArray * Colors