VTK  9.7.1
vtkPolyDataMapper2D.h
Go to the documentation of this file.
1 // SPDX-FileCopyrightText: Copyright (c) Ken Martin, Will Schroeder, Bill Lorensen
2 // SPDX-License-Identifier: BSD-3-Clause
27 #ifndef vtkPolyDataMapper2D_h
28 #define vtkPolyDataMapper2D_h
29 
30 #include "vtkMapper2D.h"
31 #include "vtkRenderingCoreModule.h" // For export macro
32 #include "vtkWrappingHints.h" // For VTK_MARSHALAUTO
33 
34 VTK_ABI_NAMESPACE_BEGIN
35 class vtkCoordinate;
36 class vtkPolyData;
37 class vtkScalarsToColors;
39 
40 class VTKRENDERINGCORE_EXPORT VTK_MARSHALAUTO vtkPolyDataMapper2D : public vtkMapper2D
41 {
42 public:
44  static vtkPolyDataMapper2D* New();
45  void PrintSelf(ostream& os, vtkIndent indent) override;
46 
48 
51  void SetInputData(vtkPolyData* in);
52  vtkPolyData* GetInput();
54 
56 
59  void SetLookupTable(vtkScalarsToColors* lut);
60  vtkScalarsToColors* GetLookupTable();
62 
67  virtual void CreateDefaultLookupTable();
68 
70 
73  vtkSetMacro(ScalarVisibility, vtkTypeBool);
74  vtkGetMacro(ScalarVisibility, vtkTypeBool);
75  vtkBooleanMacro(ScalarVisibility, vtkTypeBool);
77 
79 
92  vtkSetMacro(ColorMode, int);
93  vtkGetMacro(ColorMode, int);
94  void SetColorModeToDefault();
95  void SetColorModeToMapScalars();
96  void SetColorModeToDirectScalars();
98 
102  const char* GetColorModeAsString();
103 
105 
113  vtkSetMacro(UseLookupTableScalarRange, vtkTypeBool);
114  vtkGetMacro(UseLookupTableScalarRange, vtkTypeBool);
115  vtkBooleanMacro(UseLookupTableScalarRange, vtkTypeBool);
117 
119 
124  vtkSetVector2Macro(ScalarRange, double);
125  vtkGetVectorMacro(ScalarRange, double, 2);
127 
129 
141  vtkSetMacro(ScalarMode, int);
142  vtkGetMacro(ScalarMode, int);
143  void SetScalarModeToDefault() { this->SetScalarMode(VTK_SCALAR_MODE_DEFAULT); }
147  {
148  this->SetScalarMode(VTK_SCALAR_MODE_USE_POINT_FIELD_DATA);
149  }
151  {
152  this->SetScalarMode(VTK_SCALAR_MODE_USE_CELL_FIELD_DATA);
153  }
155 
157 
160  void ColorByArrayComponent(int arrayNum, int component);
161  void ColorByArrayComponent(const char* arrayName, int component);
163 
167  vtkGetStringMacro(ArrayName);
168  vtkSetStringMacro(ArrayName);
169  vtkGetMacro(ArrayId, int);
170  vtkSetMacro(ArrayId, int);
171  vtkGetMacro(ArrayAccessMode, int);
172  vtkSetMacro(ArrayAccessMode, int);
173  vtkGetMacro(ArrayComponent, int);
174  vtkSetMacro(ArrayComponent, int);
175 
180  vtkMTimeType GetMTime() 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 
215  void ShallowCopy(vtkAbstractMapper* m) override;
216 
217 protected:
219  ~vtkPolyDataMapper2D() override;
220 
221  int FillInputPortInformation(int, vtkInformation*) 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 = nullptr;
241 
242 private:
243  vtkPolyDataMapper2D(const vtkPolyDataMapper2D&) = delete;
244  void operator=(const vtkPolyDataMapper2D&) = delete;
245 };
246 
247 VTK_ABI_NAMESPACE_END
248 #endif
#define VTK_SCALAR_MODE_USE_CELL_FIELD_DATA
Store vtkAlgorithm input/output information.
vtkTypeUInt32 vtkMTimeType
Definition: vtkType.h:318
vtkMTimeType GetMTime() override
Override Modifiedtime as we have added Clipping planes.
record modification and/or execution time
Definition: vtkTimeStamp.h:24
concrete dataset represents vertices, lines, polygons, and triangle strips
Definition: vtkPolyData.h:71
void SetScalarModeToUseCellFieldData()
Control how the filter works with scalar point data and cell attribute data.
int vtkTypeBool
Definition: vtkABI.h:64
Superclass for mapping scalar values to colors.
void SetScalarModeToUseCellData()
Control how the filter works with scalar point data and cell attribute data.
#define VTK_SCALAR_MODE_USE_POINT_DATA
vtkScalarsToColors * LookupTable
a simple class to control print indentation
Definition: vtkIndent.h:28
#define VTK_SCALAR_MODE_USE_POINT_FIELD_DATA
virtual void ShallowCopy(vtkAbstractMapper *m)
Make a shallow copy of this mapper.
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:69
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.
static vtkAlgorithm * New()
#define VTK_MARSHALAUTO
#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:25
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.
vtkTypeBool UseLookupTableScalarRange