VTK  9.4.20250509
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
136#ifndef vtkPolyDataMapper2D_h
137#define vtkPolyDataMapper2D_h
138
139#include "vtkMapper2D.h"
140#include "vtkRenderingCoreModule.h" // For export macro
141#include "vtkWrappingHints.h" // For VTK_MARSHALAUTO
142
143VTK_ABI_NAMESPACE_BEGIN
144class vtkCoordinate;
145class vtkPolyData;
148
149class VTKRENDERINGCORE_EXPORT VTK_MARSHALAUTO vtkPolyDataMapper2D : public vtkMapper2D
150{
151public:
154 void PrintSelf(ostream& os, vtkIndent indent) override;
155
157
163
165
171
177
179
182 vtkSetMacro(ScalarVisibility, vtkTypeBool);
183 vtkGetMacro(ScalarVisibility, vtkTypeBool);
184 vtkBooleanMacro(ScalarVisibility, vtkTypeBool);
186
188
201 vtkSetMacro(ColorMode, int);
202 vtkGetMacro(ColorMode, int);
207
211 const char* GetColorModeAsString();
212
214
222 vtkSetMacro(UseLookupTableScalarRange, vtkTypeBool);
223 vtkGetMacro(UseLookupTableScalarRange, vtkTypeBool);
224 vtkBooleanMacro(UseLookupTableScalarRange, vtkTypeBool);
226
228
233 vtkSetVector2Macro(ScalarRange, double);
234 vtkGetVectorMacro(ScalarRange, double, 2);
236
238
250 vtkSetMacro(ScalarMode, int);
251 vtkGetMacro(ScalarMode, int);
252 void SetScalarModeToDefault() { this->SetScalarMode(VTK_SCALAR_MODE_DEFAULT); }
256 {
257 this->SetScalarMode(VTK_SCALAR_MODE_USE_POINT_FIELD_DATA);
258 }
260 {
261 this->SetScalarMode(VTK_SCALAR_MODE_USE_CELL_FIELD_DATA);
262 }
264
266
269 void ColorByArrayComponent(int arrayNum, int component);
270 void ColorByArrayComponent(const char* arrayName, int component);
272
276 vtkGetStringMacro(ArrayName);
277 vtkSetStringMacro(ArrayName);
278 vtkGetMacro(ArrayId, int);
279 vtkSetMacro(ArrayId, int);
280 vtkGetMacro(ArrayAccessMode, int);
281 vtkSetMacro(ArrayAccessMode, int);
282 vtkGetMacro(ArrayComponent, int);
283 vtkSetMacro(ArrayComponent, int);
284
290
292
299 vtkGetObjectMacro(TransformCoordinate, vtkCoordinate);
301
303
307 vtkGetMacro(TransformCoordinateUseDouble, bool);
308 vtkSetMacro(TransformCoordinateUseDouble, bool);
309 vtkBooleanMacro(TransformCoordinateUseDouble, bool);
311
320
325
326protected:
329
331
333
337 double ScalarRange[2];
341
344
345 // for coloring by a component of a field data array
347 char* ArrayName = nullptr;
350
351private:
353 void operator=(const vtkPolyDataMapper2D&) = delete;
354};
355
356VTK_ABI_NAMESPACE_END
357#endif
abstract class specifies interface to map data
perform coordinate transformation, and represent position, in a variety of vtk coordinate systems
a simple class to control print indentation
Definition vtkIndent.h:108
Store vtkAlgorithm input/output information.
abstract class specifies interface for objects which render 2D actors
Definition vtkMapper2D.h:26
draw vtkPolyData onto the image plane
vtkPolyData * GetInput()
Set the input to the mapper.
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.
static vtkPolyDataMapper2D * New()
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.
const char * GetColorModeAsString()
Return the method of coloring scalar 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.
vtkTypeBool UseLookupTableScalarRange
~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.
vtkScalarsToColors * GetLookupTable()
Specify a lookup table for the mapper to use.
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
Superclass for mapping scalar values to colors.
record modification and/or execution time
dynamic, self-adjusting array of unsigned char
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:287
#define VTK_MARSHALAUTO