VTK  9.3.20240327
vtkPolyDataMapper2D.h
Go to the documentation of this file.
1 // SPDX-FileCopyrightText: Copyright (c) Ken Martin, Will Schroeder, Bill Lorensen
2 // SPDX-License-Identifier: BSD-3-Clause
136 #ifndef vtkPolyDataMapper2D_h
137 #define vtkPolyDataMapper2D_h
138 
139 #include "vtkMapper2D.h"
140 #include "vtkRenderingCoreModule.h" // For export macro
141 
142 VTK_ABI_NAMESPACE_BEGIN
143 class vtkCoordinate;
144 class vtkPolyData;
145 class vtkScalarsToColors;
147 
148 class VTKRENDERINGCORE_EXPORT vtkPolyDataMapper2D : public vtkMapper2D
149 {
150 public:
153  void PrintSelf(ostream& os, vtkIndent indent) override;
154 
156 
162 
164 
170 
175  virtual void CreateDefaultLookupTable();
176 
178 
181  vtkSetMacro(ScalarVisibility, vtkTypeBool);
182  vtkGetMacro(ScalarVisibility, vtkTypeBool);
183  vtkBooleanMacro(ScalarVisibility, vtkTypeBool);
185 
187 
200  vtkSetMacro(ColorMode, int);
201  vtkGetMacro(ColorMode, int);
206 
210  const char* GetColorModeAsString();
211 
213 
221  vtkSetMacro(UseLookupTableScalarRange, vtkTypeBool);
222  vtkGetMacro(UseLookupTableScalarRange, vtkTypeBool);
223  vtkBooleanMacro(UseLookupTableScalarRange, vtkTypeBool);
225 
227 
232  vtkSetVector2Macro(ScalarRange, double);
233  vtkGetVectorMacro(ScalarRange, double, 2);
235 
237 
249  vtkSetMacro(ScalarMode, int);
250  vtkGetMacro(ScalarMode, int);
251  void SetScalarModeToDefault() { this->SetScalarMode(VTK_SCALAR_MODE_DEFAULT); }
255  {
256  this->SetScalarMode(VTK_SCALAR_MODE_USE_POINT_FIELD_DATA);
257  }
259  {
260  this->SetScalarMode(VTK_SCALAR_MODE_USE_CELL_FIELD_DATA);
261  }
263 
265 
268  void ColorByArrayComponent(int arrayNum, int component);
269  void ColorByArrayComponent(const char* arrayName, int component);
271 
275  const char* GetArrayName() { return this->ArrayName; }
276  int GetArrayId() { return this->ArrayId; }
277  int GetArrayAccessMode() { return this->ArrayAccessMode; }
278  int GetArrayComponent() { return this->ArrayComponent; }
279 
284  vtkMTimeType GetMTime() override;
285 
287 
294  vtkGetObjectMacro(TransformCoordinate, vtkCoordinate);
296 
298 
302  vtkGetMacro(TransformCoordinateUseDouble, bool);
303  vtkSetMacro(TransformCoordinateUseDouble, bool);
304  vtkBooleanMacro(TransformCoordinateUseDouble, bool);
306 
315 
319  void ShallowCopy(vtkAbstractMapper* m) override;
320 
321 protected:
324 
326 
328 
332  double ScalarRange[2];
336 
339 
340  // for coloring by a component of a field data array
341  int ArrayId;
342  char ArrayName[256];
345 
346 private:
347  vtkPolyDataMapper2D(const vtkPolyDataMapper2D&) = delete;
348  void operator=(const vtkPolyDataMapper2D&) = delete;
349 };
350 
351 VTK_ABI_NAMESPACE_END
352 #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:108
Store vtkAlgorithm input/output information.
abstract class specifies interface for objects which render 2D actors
Definition: vtkMapper2D.h:25
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:180
Superclass for mapping scalar values to colors.
record modification and/or execution time
Definition: vtkTimeStamp.h:44
dynamic, self-adjusting array of unsigned char
@ component
Definition: vtkX3D.h:175
@ alpha
Definition: vtkX3D.h:250
int vtkTypeBool
Definition: vtkABI.h:64
#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:270