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:
48  static vtkPolyDataMapper2D* New();
49  void PrintSelf(ostream& os, vtkIndent indent) override;
50 
52 
55  void SetInputData(vtkPolyData* in);
56  vtkPolyData* GetInput();
58 
60 
63  void SetLookupTable(vtkScalarsToColors* lut);
64  vtkScalarsToColors* GetLookupTable();
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);
98  void SetColorModeToDefault();
99  void SetColorModeToMapScalars();
100  void SetColorModeToDirectScalars();
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 
189  virtual void SetTransformCoordinate(vtkCoordinate*);
190  vtkGetObjectMacro(TransformCoordinate, vtkCoordinate);
192 
194 
198  vtkGetMacro(TransformCoordinateUseDouble, bool);
199  vtkSetMacro(TransformCoordinateUseDouble, bool);
200  vtkBooleanMacro(TransformCoordinateUseDouble, bool);
202 
210  vtkUnsignedCharArray* MapScalars(double alpha);
211 
215  void ShallowCopy(vtkAbstractMapper* m) override;
216 
217 protected:
219  ~vtkPolyDataMapper2D() override;
220 
221  int FillInputPortInformation(int, vtkInformation*) override;
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
const char * GetArrayName()
Get the array name or number and component to color by.
#define VTK_SCALAR_MODE_USE_CELL_FIELD_DATA
Store vtkAlgorithm input/output information.
vtkTypeUInt32 vtkMTimeType
Definition: vtkType.h:293
vtkMTimeType GetMTime() override
Override Modifiedtime as we have added Clipping planes.
record modification and/or execution time
Definition: vtkTimeStamp.h:32
concrete dataset represents vertices, lines, polygons, and triangle strips
Definition: vtkPolyData.h:84
void SetScalarModeToUseCellFieldData()
Control how the filter works with scalar point data and cell attribute data.
int vtkTypeBool
Definition: vtkABI.h:69
Superclass for mapping scalar values to colors.
void SetScalarModeToUseCellData()
Control how the filter works with scalar point data and cell attribute data.
#define VTK_SCALAR_MODE_USE_POINT_DATA
vtkScalarsToColors * LookupTable
a simple class to control print indentation
Definition: vtkIndent.h:33
#define VTK_SCALAR_MODE_USE_POINT_FIELD_DATA
virtual void ShallowCopy(vtkAbstractMapper *m)
Make a shallow copy of this mapper.
virtual int FillInputPortInformation(int port, vtkInformation *info)
Fill the input port information objects for this algorithm.
vtkCoordinate * TransformCoordinate
perform coordinate transformation, and represent position, in a variety of vtk coordinate systems ...
Definition: vtkCoordinate.h:76
dynamic, self-adjusting array of unsigned char
abstract class specifies interface to map data
void SetScalarModeToUsePointFieldData()
Control how the filter works with scalar point data and cell attribute data.
static vtkAlgorithm * New()
#define VTK_SCALAR_MODE_USE_CELL_DATA
void SetScalarModeToDefault()
Control how the filter works with scalar point data and cell attribute data.
void PrintSelf(ostream &os, vtkIndent indent) override
Methods invoked by print to print information about the object including superclasses.
abstract class specifies interface for objects which render 2D actors
Definition: vtkMapper2D.h:35
draw vtkPolyData onto the image plane
#define VTK_SCALAR_MODE_DEFAULT
vtkUnsignedCharArray * Colors
void SetScalarModeToUsePointData()
Control how the filter works with scalar point data and cell attribute data.
vtkTypeBool UseLookupTableScalarRange