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=========================================================================*/
142#ifndef vtkPolyDataMapper2D_h
143#define vtkPolyDataMapper2D_h
144
145#include "vtkMapper2D.h"
146#include "vtkRenderingCoreModule.h" // For export macro
147
148class vtkCoordinate;
149class vtkPolyData;
152
153class VTKRENDERINGCORE_EXPORT vtkPolyDataMapper2D : public vtkMapper2D
154{
155public:
158 void PrintSelf(ostream& os, vtkIndent indent) override;
159
161
167
169
175
181
183
186 vtkSetMacro(ScalarVisibility, vtkTypeBool);
187 vtkGetMacro(ScalarVisibility, vtkTypeBool);
188 vtkBooleanMacro(ScalarVisibility, vtkTypeBool);
190
192
205 vtkSetMacro(ColorMode, int);
206 vtkGetMacro(ColorMode, int);
211
215 const char* GetColorModeAsString();
216
218
226 vtkSetMacro(UseLookupTableScalarRange, vtkTypeBool);
227 vtkGetMacro(UseLookupTableScalarRange, vtkTypeBool);
228 vtkBooleanMacro(UseLookupTableScalarRange, vtkTypeBool);
230
232
237 vtkSetVector2Macro(ScalarRange, double);
238 vtkGetVectorMacro(ScalarRange, double, 2);
240
242
254 vtkSetMacro(ScalarMode, int);
255 vtkGetMacro(ScalarMode, int);
256 void SetScalarModeToDefault() { this->SetScalarMode(VTK_SCALAR_MODE_DEFAULT); }
260 {
261 this->SetScalarMode(VTK_SCALAR_MODE_USE_POINT_FIELD_DATA);
262 }
264 {
265 this->SetScalarMode(VTK_SCALAR_MODE_USE_CELL_FIELD_DATA);
266 }
268
270
273 void ColorByArrayComponent(int arrayNum, int component);
274 void ColorByArrayComponent(const char* arrayName, int component);
276
280 const char* GetArrayName() { return this->ArrayName; }
281 int GetArrayId() { return this->ArrayId; }
282 int GetArrayAccessMode() { return this->ArrayAccessMode; }
283 int GetArrayComponent() { return this->ArrayComponent; }
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[256];
350
351private:
353 void operator=(const vtkPolyDataMapper2D&) = delete;
354};
355
356#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:113
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:195
Superclass for mapping scalar values to colors.
record modification and/or execution time
Definition: vtkTimeStamp.h:52
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