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
36 #ifndef vtkPolyDataMapper2D_h
37 #define vtkPolyDataMapper2D_h
38 
39 #include "vtkMapper2D.h"
40 #include "vtkRenderingCoreModule.h" // For export macro
41 
42 VTK_ABI_NAMESPACE_BEGIN
43 class vtkCoordinate;
44 class vtkPolyData;
45 class vtkScalarsToColors;
47 
48 class VTKRENDERINGCORE_EXPORT vtkPolyDataMapper2D : public vtkMapper2D
49 {
50 public:
53  void PrintSelf(ostream& os, vtkIndent indent) override;
54 
56 
62 
64 
70 
75  virtual void CreateDefaultLookupTable();
76 
78 
81  vtkSetMacro(ScalarVisibility, vtkTypeBool);
82  vtkGetMacro(ScalarVisibility, vtkTypeBool);
83  vtkBooleanMacro(ScalarVisibility, vtkTypeBool);
85 
87 
100  vtkSetMacro(ColorMode, int);
101  vtkGetMacro(ColorMode, int);
106 
110  const char* GetColorModeAsString();
111 
113 
121  vtkSetMacro(UseLookupTableScalarRange, vtkTypeBool);
122  vtkGetMacro(UseLookupTableScalarRange, vtkTypeBool);
123  vtkBooleanMacro(UseLookupTableScalarRange, vtkTypeBool);
125 
127 
132  vtkSetVector2Macro(ScalarRange, double);
133  vtkGetVectorMacro(ScalarRange, double, 2);
135 
137 
149  vtkSetMacro(ScalarMode, int);
150  vtkGetMacro(ScalarMode, int);
151  void SetScalarModeToDefault() { this->SetScalarMode(VTK_SCALAR_MODE_DEFAULT); }
155  {
156  this->SetScalarMode(VTK_SCALAR_MODE_USE_POINT_FIELD_DATA);
157  }
159  {
160  this->SetScalarMode(VTK_SCALAR_MODE_USE_CELL_FIELD_DATA);
161  }
163 
165 
168  void ColorByArrayComponent(int arrayNum, int component);
169  void ColorByArrayComponent(const char* arrayName, int component);
171 
175  const char* GetArrayName() { return this->ArrayName; }
176  int GetArrayId() { return this->ArrayId; }
177  int GetArrayAccessMode() { return this->ArrayAccessMode; }
178  int GetArrayComponent() { return this->ArrayComponent; }
179 
184  vtkMTimeType GetMTime() override;
185 
187 
194  vtkGetObjectMacro(TransformCoordinate, vtkCoordinate);
196 
198 
202  vtkGetMacro(TransformCoordinateUseDouble, bool);
203  vtkSetMacro(TransformCoordinateUseDouble, bool);
204  vtkBooleanMacro(TransformCoordinateUseDouble, bool);
206 
215 
219  void ShallowCopy(vtkAbstractMapper* m) override;
220 
221 protected:
224 
226 
228 
232  double ScalarRange[2];
236 
239 
240  // for coloring by a component of a field data array
241  int ArrayId;
242  char ArrayName[256];
245 
246 private:
247  vtkPolyDataMapper2D(const vtkPolyDataMapper2D&) = delete;
248  void operator=(const vtkPolyDataMapper2D&) = delete;
249 };
250 
251 VTK_ABI_NAMESPACE_END
252 #endif
abstract class specifies interface to map data
perform coordinate transformation, and represent position, in a variety of vtk coordinate systems
Definition: vtkCoordinate.h:78
a simple class to control print indentation
Definition: vtkIndent.h:38
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:89
Superclass for mapping scalar values to colors.
record modification and/or execution time
Definition: vtkTimeStamp.h:34
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