VTK  9.3.0
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 
33 VTK_ABI_NAMESPACE_BEGIN
34 class vtkCoordinate;
35 class vtkPolyData;
36 class vtkScalarsToColors;
38 
39 class VTKRENDERINGCORE_EXPORT vtkPolyDataMapper2D : public vtkMapper2D
40 {
41 public:
44  void PrintSelf(ostream& os, vtkIndent indent) override;
45 
47 
53 
55 
61 
66  virtual void CreateDefaultLookupTable();
67 
69 
72  vtkSetMacro(ScalarVisibility, vtkTypeBool);
73  vtkGetMacro(ScalarVisibility, vtkTypeBool);
74  vtkBooleanMacro(ScalarVisibility, vtkTypeBool);
76 
78 
91  vtkSetMacro(ColorMode, int);
92  vtkGetMacro(ColorMode, int);
97 
101  const char* GetColorModeAsString();
102 
104 
112  vtkSetMacro(UseLookupTableScalarRange, vtkTypeBool);
113  vtkGetMacro(UseLookupTableScalarRange, vtkTypeBool);
114  vtkBooleanMacro(UseLookupTableScalarRange, vtkTypeBool);
116 
118 
123  vtkSetVector2Macro(ScalarRange, double);
124  vtkGetVectorMacro(ScalarRange, double, 2);
126 
128 
140  vtkSetMacro(ScalarMode, int);
141  vtkGetMacro(ScalarMode, int);
142  void SetScalarModeToDefault() { this->SetScalarMode(VTK_SCALAR_MODE_DEFAULT); }
146  {
147  this->SetScalarMode(VTK_SCALAR_MODE_USE_POINT_FIELD_DATA);
148  }
150  {
151  this->SetScalarMode(VTK_SCALAR_MODE_USE_CELL_FIELD_DATA);
152  }
154 
156 
159  void ColorByArrayComponent(int arrayNum, int component);
160  void ColorByArrayComponent(const char* arrayName, int component);
162 
166  const char* GetArrayName() { return this->ArrayName; }
167  int GetArrayId() { return this->ArrayId; }
168  int GetArrayAccessMode() { return this->ArrayAccessMode; }
169  int GetArrayComponent() { return this->ArrayComponent; }
170 
175  vtkMTimeType GetMTime() override;
176 
178 
185  vtkGetObjectMacro(TransformCoordinate, vtkCoordinate);
187 
189 
193  vtkGetMacro(TransformCoordinateUseDouble, bool);
194  vtkSetMacro(TransformCoordinateUseDouble, bool);
195  vtkBooleanMacro(TransformCoordinateUseDouble, bool);
197 
206 
210  void ShallowCopy(vtkAbstractMapper* m) override;
211 
212 protected:
215 
217 
219 
223  double ScalarRange[2];
227 
230 
231  // for coloring by a component of a field data array
232  int ArrayId;
233  char ArrayName[256];
236 
237 private:
238  vtkPolyDataMapper2D(const vtkPolyDataMapper2D&) = delete;
239  void operator=(const vtkPolyDataMapper2D&) = delete;
240 };
241 
242 VTK_ABI_NAMESPACE_END
243 #endif
abstract class specifies interface to map data
perform coordinate transformation, and represent position, in a variety of vtk coordinate systems
Definition: vtkCoordinate.h:69
a simple class to control print indentation
Definition: vtkIndent.h:29
Store vtkAlgorithm input/output information.
abstract class specifies interface for objects which render 2D actors
Definition: vtkMapper2D.h:25
draw vtkPolyData onto the image plane
vtkScalarsToColors * LookupTable
void SetInputData(vtkPolyData *in)
Set the input to the mapper.
void SetScalarModeToUsePointData()
Control how the filter works with scalar point data and cell attribute data.
void SetScalarModeToUseCellData()
Control how the filter works with scalar point data and cell attribute data.
vtkPolyData * GetInput()
Set the input to the mapper.
void SetLookupTable(vtkScalarsToColors *lut)
Specify a lookup table for the mapper to use.
void ColorByArrayComponent(const char *arrayName, int component)
Choose which component of which field data array to color by.
void SetScalarModeToDefault()
Control how the filter works with scalar point data and cell attribute data.
void ShallowCopy(vtkAbstractMapper *m) override
Make a shallow copy of this mapper.
vtkUnsignedCharArray * Colors
virtual void SetTransformCoordinate(vtkCoordinate *)
Specify a vtkCoordinate object to be used to transform the vtkPolyData point coordinates.
vtkScalarsToColors * GetLookupTable()
Specify a lookup table for the mapper to use.
static vtkPolyDataMapper2D * New()
vtkTypeBool UseLookupTableScalarRange
const char * GetArrayName()
Get the array name or number and component to color by.
~vtkPolyDataMapper2D() override
void ColorByArrayComponent(int arrayNum, int component)
Choose which component of which field data array to color by.
void SetColorModeToDirectScalars()
Control how the scalar data is mapped to colors.
void SetScalarModeToUsePointFieldData()
Control how the filter works with scalar point data and cell attribute data.
vtkMTimeType GetMTime() override
Overload standard modified time function.
const char * GetColorModeAsString()
Return the method of coloring scalar data.
virtual void CreateDefaultLookupTable()
Create default lookup table.
void SetScalarModeToUseCellFieldData()
Control how the filter works with scalar point data and cell attribute data.
void SetColorModeToDefault()
Control how the scalar data is mapped to colors.
vtkCoordinate * TransformCoordinate
void SetColorModeToMapScalars()
Control how the scalar data is mapped to colors.
int FillInputPortInformation(int, vtkInformation *) override
Fill the input port information objects for this algorithm.
void PrintSelf(ostream &os, vtkIndent indent) override
Methods invoked by print to print information about the object including superclasses.
vtkUnsignedCharArray * MapScalars(double alpha)
Map the scalars (if there are any scalars and ScalarVisibility is on) through the lookup table,...
concrete dataset represents vertices, lines, polygons, and triangle strips
Definition: vtkPolyData.h:80
Superclass for mapping scalar values to colors.
record modification and/or execution time
Definition: vtkTimeStamp.h:25
dynamic, self-adjusting array of unsigned char
@ component
Definition: vtkX3D.h:175
@ alpha
Definition: vtkX3D.h:250
int vtkTypeBool
Definition: vtkABI.h:64
#define VTK_SCALAR_MODE_DEFAULT
#define VTK_SCALAR_MODE_USE_POINT_DATA
#define VTK_SCALAR_MODE_USE_CELL_DATA
#define VTK_SCALAR_MODE_USE_CELL_FIELD_DATA
#define VTK_SCALAR_MODE_USE_POINT_FIELD_DATA
vtkTypeUInt32 vtkMTimeType
Definition: vtkType.h:270