VTK  9.0.1
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 =========================================================================*/
33 #ifndef vtkPolyDataMapper2D_h
34 #define vtkPolyDataMapper2D_h
35 
36 #include "vtkMapper2D.h"
37 #include "vtkRenderingCoreModule.h" // For export macro
38 
39 class vtkCoordinate;
40 class vtkPolyData;
41 class vtkScalarsToColors;
43 
44 class VTKRENDERINGCORE_EXPORT vtkPolyDataMapper2D : public vtkMapper2D
45 {
46 public:
49  void PrintSelf(ostream& os, vtkIndent indent) override;
50 
52 
58 
60 
66 
71  virtual void CreateDefaultLookupTable();
72 
74 
77  vtkSetMacro(ScalarVisibility, vtkTypeBool);
78  vtkGetMacro(ScalarVisibility, vtkTypeBool);
79  vtkBooleanMacro(ScalarVisibility, vtkTypeBool);
81 
83 
96  vtkSetMacro(ColorMode, int);
97  vtkGetMacro(ColorMode, int);
102 
106  const char* GetColorModeAsString();
107 
109 
117  vtkSetMacro(UseLookupTableScalarRange, vtkTypeBool);
118  vtkGetMacro(UseLookupTableScalarRange, vtkTypeBool);
119  vtkBooleanMacro(UseLookupTableScalarRange, vtkTypeBool);
121 
123 
128  vtkSetVector2Macro(ScalarRange, double);
129  vtkGetVectorMacro(ScalarRange, double, 2);
131 
133 
145  vtkSetMacro(ScalarMode, int);
146  vtkGetMacro(ScalarMode, int);
147  void SetScalarModeToDefault() { this->SetScalarMode(VTK_SCALAR_MODE_DEFAULT); }
151  {
152  this->SetScalarMode(VTK_SCALAR_MODE_USE_POINT_FIELD_DATA);
153  }
155  {
156  this->SetScalarMode(VTK_SCALAR_MODE_USE_CELL_FIELD_DATA);
157  }
159 
161 
164  void ColorByArrayComponent(int arrayNum, int component);
165  void ColorByArrayComponent(const char* arrayName, int component);
167 
171  const char* GetArrayName() { return this->ArrayName; }
172  int GetArrayId() { return this->ArrayId; }
173  int GetArrayAccessMode() { return this->ArrayAccessMode; }
174  int GetArrayComponent() { return this->ArrayComponent; }
175 
180  vtkMTimeType GetMTime() override;
181 
183 
190  vtkGetObjectMacro(TransformCoordinate, vtkCoordinate);
192 
194 
198  vtkGetMacro(TransformCoordinateUseDouble, bool);
199  vtkSetMacro(TransformCoordinateUseDouble, bool);
200  vtkBooleanMacro(TransformCoordinateUseDouble, bool);
202 
211 
215  void ShallowCopy(vtkAbstractMapper* m) override;
216 
217 protected:
220 
222 
224 
228  double ScalarRange[2];
232 
235 
236  // for coloring by a component of a field data array
237  int ArrayId;
238  char ArrayName[256];
241 
242 private:
243  vtkPolyDataMapper2D(const vtkPolyDataMapper2D&) = delete;
244  void operator=(const vtkPolyDataMapper2D&) = delete;
245 };
246 
247 #endif
abstract class specifies interface to map data
perform coordinate transformation, and represent position, in a variety of vtk coordinate systems
Definition: vtkCoordinate.h:77
a simple class to control print indentation
Definition: vtkIndent.h:34
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
vtkScalarsToColors * LookupTable
void SetInputData(vtkPolyData *in)
Set the input to the mapper.
vtkPolyData * GetInput()
void SetLookupTable(vtkScalarsToColors *lut)
Specify a lookup table for the mapper to use.
void ColorByArrayComponent(const char *arrayName, int component)
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()
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()
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 SetColorModeToDefault()
vtkCoordinate * TransformCoordinate
void SetColorModeToMapScalars()
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:85
Superclass for mapping scalar values to colors.
record modification and/or execution time
Definition: vtkTimeStamp.h:33
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:293