VTK  9.1.0
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=========================================================================*/
42#ifndef vtkPolyDataMapper2D_h
43#define vtkPolyDataMapper2D_h
44
45#include "vtkMapper2D.h"
46#include "vtkRenderingCoreModule.h" // For export macro
47
48class vtkCoordinate;
49class vtkPolyData;
52
53class VTKRENDERINGCORE_EXPORT vtkPolyDataMapper2D : public vtkMapper2D
54{
55public:
58 void PrintSelf(ostream& os, vtkIndent indent) override;
59
61
67
69
75
81
83
86 vtkSetMacro(ScalarVisibility, vtkTypeBool);
87 vtkGetMacro(ScalarVisibility, vtkTypeBool);
88 vtkBooleanMacro(ScalarVisibility, vtkTypeBool);
90
92
105 vtkSetMacro(ColorMode, int);
106 vtkGetMacro(ColorMode, int);
111
115 const char* GetColorModeAsString();
116
118
126 vtkSetMacro(UseLookupTableScalarRange, vtkTypeBool);
127 vtkGetMacro(UseLookupTableScalarRange, vtkTypeBool);
128 vtkBooleanMacro(UseLookupTableScalarRange, vtkTypeBool);
130
132
137 vtkSetVector2Macro(ScalarRange, double);
138 vtkGetVectorMacro(ScalarRange, double, 2);
140
142
154 vtkSetMacro(ScalarMode, int);
155 vtkGetMacro(ScalarMode, int);
156 void SetScalarModeToDefault() { this->SetScalarMode(VTK_SCALAR_MODE_DEFAULT); }
160 {
161 this->SetScalarMode(VTK_SCALAR_MODE_USE_POINT_FIELD_DATA);
162 }
164 {
165 this->SetScalarMode(VTK_SCALAR_MODE_USE_CELL_FIELD_DATA);
166 }
168
170
173 void ColorByArrayComponent(int arrayNum, int component);
174 void ColorByArrayComponent(const char* arrayName, int component);
176
180 const char* GetArrayName() { return this->ArrayName; }
181 int GetArrayId() { return this->ArrayId; }
182 int GetArrayAccessMode() { return this->ArrayAccessMode; }
183 int GetArrayComponent() { return this->ArrayComponent; }
184
190
192
199 vtkGetObjectMacro(TransformCoordinate, vtkCoordinate);
201
203
207 vtkGetMacro(TransformCoordinateUseDouble, bool);
208 vtkSetMacro(TransformCoordinateUseDouble, bool);
209 vtkBooleanMacro(TransformCoordinateUseDouble, bool);
211
220
225
226protected:
229
231
233
237 double ScalarRange[2];
241
244
245 // for coloring by a component of a field data array
247 char ArrayName[256];
250
251private:
253 void operator=(const vtkPolyDataMapper2D&) = delete;
254};
255
256#endif
abstract class specifies interface to map data
perform coordinate transformation, and represent position, in a variety of vtk coordinate systems
Definition: vtkCoordinate.h:86
a simple class to control print indentation
Definition: vtkIndent.h:43
Store vtkAlgorithm input/output information.
abstract class specifies interface for objects which render 2D actors
Definition: vtkMapper2D.h:36
draw vtkPolyData onto the image plane
vtkPolyData * GetInput()
Set the input to the mapper.
vtkScalarsToColors * LookupTable
const char * GetArrayName()
Get the array name or number and component to color by.
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
Definition: vtkPolyData.h:95
Superclass for mapping scalar values to colors.
record modification and/or execution time
Definition: vtkTimeStamp.h:42
dynamic, self-adjusting array of unsigned char
@ component
Definition: vtkX3D.h:181
@ alpha
Definition: vtkX3D.h:256
int vtkTypeBool
Definition: vtkABI.h:69
#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