VTK  9.0.20200922
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
VTK_SCALAR_MODE_DEFAULT
#define VTK_SCALAR_MODE_DEFAULT
Definition: vtkAbstractMapper.h:34
VTK_SCALAR_MODE_USE_CELL_FIELD_DATA
#define VTK_SCALAR_MODE_USE_CELL_FIELD_DATA
Definition: vtkAbstractMapper.h:38
VTK_SCALAR_MODE_USE_POINT_DATA
#define VTK_SCALAR_MODE_USE_POINT_DATA
Definition: vtkAbstractMapper.h:35
vtkMapper2D::PrintSelf
void PrintSelf(ostream &os, vtkIndent indent) override
Methods invoked by print to print information about the object including superclasses.
vtkPolyDataMapper2D
draw vtkPolyData onto the image plane
Definition: vtkPolyDataMapper2D.h:44
vtkX3D::alpha
Definition: vtkX3D.h:256
vtkX3D::component
Definition: vtkX3D.h:181
VTK_SCALAR_MODE_USE_POINT_FIELD_DATA
#define VTK_SCALAR_MODE_USE_POINT_FIELD_DATA
Definition: vtkAbstractMapper.h:37
vtkPolyDataMapper2D::GetArrayAccessMode
int GetArrayAccessMode()
Definition: vtkPolyDataMapper2D.h:173
vtkAlgorithm::FillInputPortInformation
virtual int FillInputPortInformation(int port, vtkInformation *info)
Fill the input port information objects for this algorithm.
vtkTimeStamp
record modification and/or execution time
Definition: vtkTimeStamp.h:32
vtkPolyDataMapper2D::SetScalarModeToUsePointFieldData
void SetScalarModeToUsePointFieldData()
Definition: vtkPolyDataMapper2D.h:150
vtkAbstractMapper::GetMTime
vtkMTimeType GetMTime() override
Override Modifiedtime as we have added Clipping planes.
vtkUnsignedCharArray
dynamic, self-adjusting array of unsigned char
Definition: vtkUnsignedCharArray.h:35
vtkPolyDataMapper2D::GetArrayId
int GetArrayId()
Definition: vtkPolyDataMapper2D.h:172
vtkPolyDataMapper2D::SetScalarModeToUsePointData
void SetScalarModeToUsePointData()
Definition: vtkPolyDataMapper2D.h:148
vtkPolyDataMapper2D::LookupTable
vtkScalarsToColors * LookupTable
Definition: vtkPolyDataMapper2D.h:225
vtkPolyDataMapper2D::SetScalarModeToUseCellFieldData
void SetScalarModeToUseCellFieldData()
Definition: vtkPolyDataMapper2D.h:154
vtkPolyDataMapper2D::ArrayId
int ArrayId
Definition: vtkPolyDataMapper2D.h:237
VTK_SCALAR_MODE_USE_CELL_DATA
#define VTK_SCALAR_MODE_USE_CELL_DATA
Definition: vtkAbstractMapper.h:36
vtkPolyDataMapper2D::GetArrayName
const char * GetArrayName()
Get the array name or number and component to color by.
Definition: vtkPolyDataMapper2D.h:171
vtkPolyDataMapper2D::TransformCoordinateUseDouble
bool TransformCoordinateUseDouble
Definition: vtkPolyDataMapper2D.h:234
vtkIndent
a simple class to control print indentation
Definition: vtkIndent.h:33
vtkMapper2D.h
vtkCoordinate
perform coordinate transformation, and represent position, in a variety of vtk coordinate systems
Definition: vtkCoordinate.h:76
vtkPolyDataMapper2D::ScalarVisibility
vtkTypeBool ScalarVisibility
Definition: vtkPolyDataMapper2D.h:226
vtkPolyDataMapper2D::UseLookupTableScalarRange
vtkTypeBool UseLookupTableScalarRange
Definition: vtkPolyDataMapper2D.h:229
vtkAbstractMapper::ShallowCopy
virtual void ShallowCopy(vtkAbstractMapper *m)
Make a shallow copy of this mapper.
vtkPolyDataMapper2D::ScalarMode
int ScalarMode
Definition: vtkPolyDataMapper2D.h:231
vtkScalarsToColors
Superclass for mapping scalar values to colors.
Definition: vtkScalarsToColors.h:59
vtkMapper2D
abstract class specifies interface for objects which render 2D actors
Definition: vtkMapper2D.h:35
vtkPolyDataMapper2D::ArrayComponent
int ArrayComponent
Definition: vtkPolyDataMapper2D.h:239
vtkInformation
Store vtkAlgorithm input/output information.
Definition: vtkInformation.h:73
vtkPolyDataMapper2D::TransformCoordinate
vtkCoordinate * TransformCoordinate
Definition: vtkPolyDataMapper2D.h:233
vtkAlgorithm::New
static vtkAlgorithm * New()
vtkPolyDataMapper2D::BuildTime
vtkTimeStamp BuildTime
Definition: vtkPolyDataMapper2D.h:227
vtkPolyDataMapper2D::ColorMode
int ColorMode
Definition: vtkPolyDataMapper2D.h:230
vtkPolyData
concrete dataset represents vertices, lines, polygons, and triangle strips
Definition: vtkPolyData.h:85
vtkPolyDataMapper2D::SetScalarModeToDefault
void SetScalarModeToDefault()
Definition: vtkPolyDataMapper2D.h:147
vtkPolyDataMapper2D::GetArrayComponent
int GetArrayComponent()
Definition: vtkPolyDataMapper2D.h:174
vtkPolyDataMapper2D::ArrayAccessMode
int ArrayAccessMode
Definition: vtkPolyDataMapper2D.h:240
vtkPolyDataMapper2D::SetScalarModeToUseCellData
void SetScalarModeToUseCellData()
Definition: vtkPolyDataMapper2D.h:149
vtkPolyDataMapper2D::Colors
vtkUnsignedCharArray * Colors
Definition: vtkPolyDataMapper2D.h:223
vtkTypeBool
int vtkTypeBool
Definition: vtkABI.h:69
vtkAbstractMapper
abstract class specifies interface to map data
Definition: vtkAbstractMapper.h:52
vtkMTimeType
vtkTypeUInt32 vtkMTimeType
Definition: vtkType.h:285