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 =========================================================================*/
33 #ifndef vtkPolyDataMapper2D_h
34 #define vtkPolyDataMapper2D_h
35 
36 
37 #include "vtkRenderingCoreModule.h" // For export macro
38 #include "vtkMapper2D.h"
39 
40 class vtkCoordinate;
41 class vtkPolyData;
42 class vtkScalarsToColors;
44 
45 class VTKRENDERINGCORE_EXPORT vtkPolyDataMapper2D : public vtkMapper2D
46 {
47 public:
49  static vtkPolyDataMapper2D *New();
50  void PrintSelf(ostream& os, vtkIndent indent) VTK_OVERRIDE;
51 
53 
56  void SetInputData(vtkPolyData *in);
57  vtkPolyData *GetInput();
59 
61 
64  void SetLookupTable(vtkScalarsToColors *lut);
65  vtkScalarsToColors *GetLookupTable();
67 
72  virtual void CreateDefaultLookupTable();
73 
75 
78  vtkSetMacro(ScalarVisibility, int);
79  vtkGetMacro(ScalarVisibility, int);
80  vtkBooleanMacro(ScalarVisibility, int);
82 
84 
97  vtkSetMacro(ColorMode, int);
98  vtkGetMacro(ColorMode, int);
99  void SetColorModeToDefault();
100  void SetColorModeToMapScalars();
101  void SetColorModeToDirectScalars();
103 
107  const char *GetColorModeAsString();
108 
110 
118  vtkSetMacro(UseLookupTableScalarRange, int);
119  vtkGetMacro(UseLookupTableScalarRange, int);
120  vtkBooleanMacro(UseLookupTableScalarRange, int);
122 
124 
129  vtkSetVector2Macro(ScalarRange, double);
130  vtkGetVectorMacro(ScalarRange, double, 2);
132 
134 
146  vtkSetMacro(ScalarMode, int);
147  vtkGetMacro(ScalarMode, int);
149  { this->SetScalarMode(VTK_SCALAR_MODE_DEFAULT); }
151  { this->SetScalarMode(VTK_SCALAR_MODE_USE_POINT_DATA); }
153  { this->SetScalarMode(VTK_SCALAR_MODE_USE_CELL_DATA); }
155  { this->SetScalarMode(VTK_SCALAR_MODE_USE_POINT_FIELD_DATA); }
157  { this->SetScalarMode(VTK_SCALAR_MODE_USE_CELL_FIELD_DATA); }
159 
161 
164  void ColorByArrayComponent(int arrayNum, int component);
165  void ColorByArrayComponent(char* arrayName, int component);
167 
171  char* GetArrayName() { return this->ArrayName; }
172  int GetArrayId() { return this->ArrayId; }
173  int GetArrayAccessMode() { return this->ArrayAccessMode; }
174  int GetArrayComponent() { return this->ArrayComponent; }
175 
180  vtkMTimeType GetMTime() VTK_OVERRIDE;
181 
183 
189  virtual void SetTransformCoordinate(vtkCoordinate*);
190  vtkGetObjectMacro(TransformCoordinate, vtkCoordinate);
192 
194 
198  vtkGetMacro(TransformCoordinateUseDouble, bool);
199  vtkSetMacro(TransformCoordinateUseDouble, bool);
200  vtkBooleanMacro(TransformCoordinateUseDouble, bool);
202 
210  vtkUnsignedCharArray *MapScalars(double alpha);
211 
216 
217 protected:
219  ~vtkPolyDataMapper2D() VTK_OVERRIDE;
220 
221  int FillInputPortInformation(int, vtkInformation*) VTK_OVERRIDE;
222 
224 
228  double ScalarRange[2];
232 
235 
236  // for coloring by a component of a field data array
237  int ArrayId;
238  char ArrayName[256];
241 private:
242  vtkPolyDataMapper2D(const vtkPolyDataMapper2D&) VTK_DELETE_FUNCTION;
243  void operator=(const vtkPolyDataMapper2D&) VTK_DELETE_FUNCTION;
244 };
245 
246 
247 #endif
#define VTK_SCALAR_MODE_USE_CELL_FIELD_DATA
Store vtkAlgorithm input/output information.
vtkTypeUInt32 vtkMTimeType
Definition: vtkType.h:300
vtkMTimeType GetMTime() override
Override Modifiedtime as we have added Clipping planes.
record modification and/or execution time
Definition: vtkTimeStamp.h:32
concrete dataset represents vertices, lines, polygons, and triangle strips
Definition: vtkPolyData.h:79
void SetScalarModeToUseCellFieldData()
Control how the filter works with scalar point data and cell attribute data.
Superclass for mapping scalar values to colors.
void SetScalarModeToUseCellData()
Control how the filter works with scalar point data and cell attribute data.
char * GetArrayName()
Get the array name or number and component to color by.
#define VTK_SCALAR_MODE_USE_POINT_DATA
vtkScalarsToColors * LookupTable
a simple class to control print indentation
Definition: vtkIndent.h:33
#define VTK_SCALAR_MODE_USE_POINT_FIELD_DATA
virtual int FillInputPortInformation(int port, vtkInformation *info)
Fill the input port information objects for this algorithm.
vtkCoordinate * TransformCoordinate
perform coordinate transformation, and represent position, in a variety of vtk coordinate systems ...
Definition: vtkCoordinate.h:72
vtkSetMacro(IgnoreDriverBugs, bool)
When set known driver bugs are ignored during driver feature detection.
dynamic, self-adjusting array of unsigned char
abstract class specifies interface to map data
void SetScalarModeToUsePointFieldData()
Control how the filter works with scalar point data and cell attribute data.
void ShallowCopy(vtkAbstractMapper *m)
Make a shallow copy of this mapper.
static vtkAlgorithm * New()
vtkBooleanMacro(IgnoreDriverBugs, bool)
When set known driver bugs are ignored during driver feature detection.
#define VTK_SCALAR_MODE_USE_CELL_DATA
void SetScalarModeToDefault()
Control how the filter works with scalar point data and cell attribute data.
void PrintSelf(ostream &os, vtkIndent indent) override
Methods invoked by print to print information about the object including superclasses.
abstract class specifies interface for objects which render 2D actors
Definition: vtkMapper2D.h:35
draw vtkPolyData onto the image plane
#define VTK_SCALAR_MODE_DEFAULT
vtkUnsignedCharArray * Colors
void SetScalarModeToUsePointData()
Control how the filter works with scalar point data and cell attribute data.