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 =========================================================================*/
39 #ifndef vtkPolyDataMapper2D_h
40 #define vtkPolyDataMapper2D_h
41 
42 
43 #include "vtkRenderingCoreModule.h" // For export macro
44 #include "vtkMapper2D.h"
45 
46 class vtkCoordinate;
47 class vtkPolyData;
48 class vtkScalarsToColors;
50 
51 class VTKRENDERINGCORE_EXPORT vtkPolyDataMapper2D : public vtkMapper2D
52 {
53 public:
55  static vtkPolyDataMapper2D *New();
56  void PrintSelf(ostream& os, vtkIndent indent) override;
57 
59 
62  void SetInputData(vtkPolyData *in);
63  vtkPolyData *GetInput();
65 
67 
70  void SetLookupTable(vtkScalarsToColors *lut);
71  vtkScalarsToColors *GetLookupTable();
73 
78  virtual void CreateDefaultLookupTable();
79 
81 
84  vtkSetMacro(ScalarVisibility, int);
85  vtkGetMacro(ScalarVisibility, int);
86  vtkBooleanMacro(ScalarVisibility, int);
88 
90 
103  vtkSetMacro(ColorMode, int);
104  vtkGetMacro(ColorMode, int);
105  void SetColorModeToDefault();
106  void SetColorModeToMapScalars();
107  void SetColorModeToDirectScalars();
109 
113  const char *GetColorModeAsString();
114 
116 
124  vtkSetMacro(UseLookupTableScalarRange, int);
125  vtkGetMacro(UseLookupTableScalarRange, int);
126  vtkBooleanMacro(UseLookupTableScalarRange, int);
128 
130 
135  vtkSetVector2Macro(ScalarRange, double);
136  vtkGetVectorMacro(ScalarRange, double, 2);
138 
140 
152  vtkSetMacro(ScalarMode, int);
153  vtkGetMacro(ScalarMode, int);
155  { this->SetScalarMode(VTK_SCALAR_MODE_DEFAULT); }
157  { this->SetScalarMode(VTK_SCALAR_MODE_USE_POINT_DATA); }
159  { this->SetScalarMode(VTK_SCALAR_MODE_USE_CELL_DATA); }
161  { this->SetScalarMode(VTK_SCALAR_MODE_USE_POINT_FIELD_DATA); }
163  { this->SetScalarMode(VTK_SCALAR_MODE_USE_CELL_FIELD_DATA); }
165 
167 
170  void ColorByArrayComponent(int arrayNum, int component);
171  void ColorByArrayComponent(char* arrayName, int component);
173 
177  char* GetArrayName() { return this->ArrayName; }
178  int GetArrayId() { return this->ArrayId; }
179  int GetArrayAccessMode() { return this->ArrayAccessMode; }
180  int GetArrayComponent() { return this->ArrayComponent; }
181 
186  vtkMTimeType GetMTime() override;
187 
189 
195  virtual void SetTransformCoordinate(vtkCoordinate*);
196  vtkGetObjectMacro(TransformCoordinate, vtkCoordinate);
198 
200 
204  vtkGetMacro(TransformCoordinateUseDouble, bool);
205  vtkSetMacro(TransformCoordinateUseDouble, bool);
206  vtkBooleanMacro(TransformCoordinateUseDouble, bool);
208 
216  vtkUnsignedCharArray *MapScalars(double alpha);
217 
222 
223 protected:
225  ~vtkPolyDataMapper2D() override;
226 
227  int FillInputPortInformation(int, vtkInformation*) override;
228 
230 
234  double ScalarRange[2];
238 
241 
242  // for coloring by a component of a field data array
243  int ArrayId;
244  char ArrayName[256];
247 private:
248  vtkPolyDataMapper2D(const vtkPolyDataMapper2D&) = delete;
249  void operator=(const vtkPolyDataMapper2D&) = delete;
250 };
251 
252 
253 #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:35
concrete dataset represents vertices, lines, polygons, and triangle strips
Definition: vtkPolyData.h:85
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:39
#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:78
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.