VTK  9.2.20230603
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 =========================================================================*/
148 #ifndef vtkPolyDataMapper2D_h
149 #define vtkPolyDataMapper2D_h
150 
151 #include "vtkMapper2D.h"
152 #include "vtkRenderingCoreModule.h" // For export macro
153 
154 VTK_ABI_NAMESPACE_BEGIN
155 class vtkCoordinate;
156 class vtkPolyData;
157 class vtkScalarsToColors;
159 
160 class VTKRENDERINGCORE_EXPORT vtkPolyDataMapper2D : public vtkMapper2D
161 {
162 public:
165  void PrintSelf(ostream& os, vtkIndent indent) override;
166 
168 
174 
176 
182 
187  virtual void CreateDefaultLookupTable();
188 
190 
193  vtkSetMacro(ScalarVisibility, vtkTypeBool);
194  vtkGetMacro(ScalarVisibility, vtkTypeBool);
195  vtkBooleanMacro(ScalarVisibility, vtkTypeBool);
197 
199 
212  vtkSetMacro(ColorMode, int);
213  vtkGetMacro(ColorMode, int);
218 
222  const char* GetColorModeAsString();
223 
225 
233  vtkSetMacro(UseLookupTableScalarRange, vtkTypeBool);
234  vtkGetMacro(UseLookupTableScalarRange, vtkTypeBool);
235  vtkBooleanMacro(UseLookupTableScalarRange, vtkTypeBool);
237 
239 
244  vtkSetVector2Macro(ScalarRange, double);
245  vtkGetVectorMacro(ScalarRange, double, 2);
247 
249 
261  vtkSetMacro(ScalarMode, int);
262  vtkGetMacro(ScalarMode, int);
263  void SetScalarModeToDefault() { this->SetScalarMode(VTK_SCALAR_MODE_DEFAULT); }
267  {
268  this->SetScalarMode(VTK_SCALAR_MODE_USE_POINT_FIELD_DATA);
269  }
271  {
272  this->SetScalarMode(VTK_SCALAR_MODE_USE_CELL_FIELD_DATA);
273  }
275 
277 
280  void ColorByArrayComponent(int arrayNum, int component);
281  void ColorByArrayComponent(const char* arrayName, int component);
283 
287  const char* GetArrayName() { return this->ArrayName; }
288  int GetArrayId() { return this->ArrayId; }
289  int GetArrayAccessMode() { return this->ArrayAccessMode; }
290  int GetArrayComponent() { return this->ArrayComponent; }
291 
296  vtkMTimeType GetMTime() override;
297 
299 
306  vtkGetObjectMacro(TransformCoordinate, vtkCoordinate);
308 
310 
314  vtkGetMacro(TransformCoordinateUseDouble, bool);
315  vtkSetMacro(TransformCoordinateUseDouble, bool);
316  vtkBooleanMacro(TransformCoordinateUseDouble, bool);
318 
327 
331  void ShallowCopy(vtkAbstractMapper* m) override;
332 
333 protected:
336 
338 
340 
344  double ScalarRange[2];
348 
351 
352  // for coloring by a component of a field data array
353  int ArrayId;
354  char ArrayName[256];
357 
358 private:
359  vtkPolyDataMapper2D(const vtkPolyDataMapper2D&) = delete;
360  void operator=(const vtkPolyDataMapper2D&) = delete;
361 };
362 
363 VTK_ABI_NAMESPACE_END
364 #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:120
Store vtkAlgorithm input/output information.
abstract class specifies interface for objects which render 2D actors
Definition: vtkMapper2D.h:37
draw vtkPolyData onto the image plane
vtkScalarsToColors * LookupTable
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.
vtkPolyData * GetInput()
Set the input to the mapper.
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.
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()
Specify a lookup table for the mapper to use.
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()
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.
const char * GetColorModeAsString()
Return the method of coloring scalar data.
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:201
Superclass for mapping scalar values to colors.
record modification and/or execution time
Definition: vtkTimeStamp.h:56
dynamic, self-adjusting array of unsigned char
@ component
Definition: vtkX3D.h:187
@ alpha
Definition: vtkX3D.h:262
int vtkTypeBool
Definition: vtkABI.h:71
#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:282