VTK
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 =========================================================================*/
39 #ifndef vtkPolyDataMapper2D_h
40 #define vtkPolyDataMapper2D_h
41 
42 
43 #include "vtkRenderingCoreModule.h" // For export macro
44 #include "vtkMapper2D.h"
45 
46 class vtkCoordinate;
47 class vtkPolyData;
48 class vtkScalarsToColors;
50 
51 class VTKRENDERINGCORE_EXPORT vtkPolyDataMapper2D : public vtkMapper2D
52 {
53 public:
55  static vtkPolyDataMapper2D *New();
56  void PrintSelf(ostream& os, vtkIndent indent);
57 
59 
62  void SetInputData(vtkPolyData *in);
63  vtkPolyData *GetInput();
65 
67 
70  void SetLookupTable(vtkScalarsToColors *lut);
71  vtkScalarsToColors *GetLookupTable();
73 
78  virtual void CreateDefaultLookupTable();
79 
81 
84  vtkSetMacro(ScalarVisibility, int);
85  vtkGetMacro(ScalarVisibility, int);
86  vtkBooleanMacro(ScalarVisibility, int);
88 
90 
103  vtkSetMacro(ColorMode, int);
104  vtkGetMacro(ColorMode, int);
105  void SetColorModeToDefault();
106  void SetColorModeToMapScalars();
107  void SetColorModeToDirectScalars();
109 
113  const char *GetColorModeAsString();
114 
116 
124  vtkSetMacro(UseLookupTableScalarRange, int);
125  vtkGetMacro(UseLookupTableScalarRange, int);
126  vtkBooleanMacro(UseLookupTableScalarRange, int);
128 
130 
135  vtkSetVector2Macro(ScalarRange, double);
136  vtkGetVectorMacro(ScalarRange, double, 2);
138 
140 
152  vtkSetMacro(ScalarMode, int);
153  vtkGetMacro(ScalarMode, int);
155  { this->SetScalarMode(VTK_SCALAR_MODE_DEFAULT); }
157  { this->SetScalarMode(VTK_SCALAR_MODE_USE_POINT_DATA); }
159  { this->SetScalarMode(VTK_SCALAR_MODE_USE_CELL_DATA); }
161  { this->SetScalarMode(VTK_SCALAR_MODE_USE_POINT_FIELD_DATA); }
163  { this->SetScalarMode(VTK_SCALAR_MODE_USE_CELL_FIELD_DATA); }
165 
167 
170  void ColorByArrayComponent(int arrayNum, int component);
171  void ColorByArrayComponent(char* arrayName, int component);
173 
177  char* GetArrayName() { return this->ArrayName; }
178  int GetArrayId() { return this->ArrayId; }
179  int GetArrayAccessMode() { return this->ArrayAccessMode; }
180  int GetArrayComponent() { return this->ArrayComponent; }
181 
186  virtual vtkMTimeType GetMTime();
187 
189 
195  virtual void SetTransformCoordinate(vtkCoordinate*);
196  vtkGetObjectMacro(TransformCoordinate, vtkCoordinate);
198 
200 
204  vtkGetMacro(TransformCoordinateUseDouble, bool);
205  vtkSetMacro(TransformCoordinateUseDouble, bool);
206  vtkBooleanMacro(TransformCoordinateUseDouble, bool);
208 
216  vtkUnsignedCharArray *MapScalars(double alpha);
217 
222 
223 protected:
226 
227  virtual int FillInputPortInformation(int, vtkInformation*);
228 
230 
234  double ScalarRange[2];
238 
241 
242  // for coloring by a component of a field data array
243  int ArrayId;
244  char ArrayName[256];
247 private:
248  vtkPolyDataMapper2D(const vtkPolyDataMapper2D&) VTK_DELETE_FUNCTION;
249  void operator=(const vtkPolyDataMapper2D&) VTK_DELETE_FUNCTION;
250 };
251 
252 
253 #endif
VTK_SCALAR_MODE_DEFAULT
#define VTK_SCALAR_MODE_DEFAULT
Definition: vtkAbstractMapper.h:37
VTK_SCALAR_MODE_USE_CELL_FIELD_DATA
#define VTK_SCALAR_MODE_USE_CELL_FIELD_DATA
Definition: vtkAbstractMapper.h:41
VTK_SCALAR_MODE_USE_POINT_DATA
#define VTK_SCALAR_MODE_USE_POINT_DATA
Definition: vtkAbstractMapper.h:38
vtkPolyDataMapper2D::UseLookupTableScalarRange
int UseLookupTableScalarRange
Definition: vtkPolyDataMapper2D.h:235
vtkPolyDataMapper2D
draw vtkPolyData onto the image plane
Definition: vtkPolyDataMapper2D.h:51
vtkX3D::alpha
@ alpha
Definition: vtkX3D.h:250
vtkX3D::component
@ component
Definition: vtkX3D.h:175
VTK_SCALAR_MODE_USE_POINT_FIELD_DATA
#define VTK_SCALAR_MODE_USE_POINT_FIELD_DATA
Definition: vtkAbstractMapper.h:40
vtkPolyDataMapper2D::GetArrayAccessMode
int GetArrayAccessMode()
Definition: vtkPolyDataMapper2D.h:179
vtkPolyDataMapper2D::ScalarVisibility
int ScalarVisibility
Definition: vtkPolyDataMapper2D.h:232
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:35
vtkPolyDataMapper2D::SetScalarModeToUsePointFieldData
void SetScalarModeToUsePointFieldData()
Definition: vtkPolyDataMapper2D.h:160
vtkUnsignedCharArray
dynamic, self-adjusting array of unsigned char
Definition: vtkUnsignedCharArray.h:41
vtkAbstractMapper::GetMTime
virtual vtkMTimeType GetMTime()
Override Modifiedtime as we have added Clipping planes.
vtkPolyDataMapper2D::GetArrayId
int GetArrayId()
Definition: vtkPolyDataMapper2D.h:178
vtkPolyDataMapper2D::SetScalarModeToUsePointData
void SetScalarModeToUsePointData()
Definition: vtkPolyDataMapper2D.h:156
vtkPolyDataMapper2D::LookupTable
vtkScalarsToColors * LookupTable
Definition: vtkPolyDataMapper2D.h:231
vtkPolyDataMapper2D::SetScalarModeToUseCellFieldData
void SetScalarModeToUseCellFieldData()
Definition: vtkPolyDataMapper2D.h:162
vtkMTimeType
vtkTypeUInt64 vtkMTimeType
Definition: vtkType.h:248
vtkPolyDataMapper2D::ArrayId
int ArrayId
Definition: vtkPolyDataMapper2D.h:243
vtkPolyDataMapper2D::GetArrayName
char * GetArrayName()
Get the array name or number and component to color by.
Definition: vtkPolyDataMapper2D.h:177
VTK_SCALAR_MODE_USE_CELL_DATA
#define VTK_SCALAR_MODE_USE_CELL_DATA
Definition: vtkAbstractMapper.h:39
vtkPolyDataMapper2D::TransformCoordinateUseDouble
bool TransformCoordinateUseDouble
Definition: vtkPolyDataMapper2D.h:240
vtkIndent
a simple class to control print indentation
Definition: vtkIndent.h:39
vtkMapper2D.h
vtkCoordinate
perform coordinate transformation, and represent position, in a variety of vtk coordinate systems
Definition: vtkCoordinate.h:70
vtkPolyDataMapper2D::ScalarMode
int ScalarMode
Definition: vtkPolyDataMapper2D.h:237
vtkScalarsToColors
Superclass for mapping scalar values to colors.
Definition: vtkScalarsToColors.h:66
vtkMapper2D
abstract class specifies interface for objects which render 2D actors
Definition: vtkMapper2D.h:35
vtkPolyDataMapper2D::ArrayComponent
int ArrayComponent
Definition: vtkPolyDataMapper2D.h:245
vtkMapper2D::PrintSelf
void PrintSelf(ostream &os, vtkIndent indent)
Methods invoked by print to print information about the object including superclasses.
vtkBooleanMacro
vtkBooleanMacro(IgnoreDriverBugs, bool)
Updates the extensions string.
vtkInformation
Store vtkAlgorithm input/output information.
Definition: vtkInformation.h:86
vtkPolyDataMapper2D::TransformCoordinate
vtkCoordinate * TransformCoordinate
Definition: vtkPolyDataMapper2D.h:239
vtkSetMacro
vtkSetMacro(IgnoreDriverBugs, bool)
Updates the extensions string.
vtkAlgorithm::New
static vtkAlgorithm * New()
vtkPolyDataMapper2D::BuildTime
vtkTimeStamp BuildTime
Definition: vtkPolyDataMapper2D.h:233
vtkPolyDataMapper2D::ColorMode
int ColorMode
Definition: vtkPolyDataMapper2D.h:236
vtkPolyData
concrete dataset represents vertices, lines, polygons, and triangle strips
Definition: vtkPolyData.h:85
vtkPolyDataMapper2D::SetScalarModeToDefault
void SetScalarModeToDefault()
Definition: vtkPolyDataMapper2D.h:154
vtkPolyDataMapper2D::GetArrayComponent
int GetArrayComponent()
Definition: vtkPolyDataMapper2D.h:180
vtkPolyDataMapper2D::ArrayAccessMode
int ArrayAccessMode
Definition: vtkPolyDataMapper2D.h:246
vtkPolyDataMapper2D::SetScalarModeToUseCellData
void SetScalarModeToUseCellData()
Definition: vtkPolyDataMapper2D.h:158
vtkPolyDataMapper2D::Colors
vtkUnsignedCharArray * Colors
Definition: vtkPolyDataMapper2D.h:229
vtkAbstractMapper::ShallowCopy
void ShallowCopy(vtkAbstractMapper *m)
Make a shallow copy of this mapper.
vtkAbstractMapper
abstract class specifies interface to map data
Definition: vtkAbstractMapper.h:55