VTK
dox/Rendering/vtkPolyDataMapper2D.h
Go to the documentation of this file.
00001 /*=========================================================================
00002 
00003   Program:   Visualization Toolkit
00004   Module:    vtkPolyDataMapper2D.h
00005 
00006   Copyright (c) Ken Martin, Will Schroeder, Bill Lorensen
00007   All rights reserved.
00008   See Copyright.txt or http://www.kitware.com/Copyright.htm for details.
00009 
00010      This software is distributed WITHOUT ANY WARRANTY; without even
00011      the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
00012      PURPOSE.  See the above copyright notice for more information.
00013 
00014 =========================================================================*/
00038 #ifndef __vtkPolyDataMapper2D_h
00039 #define __vtkPolyDataMapper2D_h
00040 
00041 
00042 #include "vtkMapper2D.h"
00043 
00044 class vtkCoordinate;
00045 class vtkPolyData;
00046 class vtkScalarsToColors;
00047 class vtkUnsignedCharArray;
00048 
00049 class VTK_RENDERING_EXPORT vtkPolyDataMapper2D : public vtkMapper2D
00050 {
00051 public:
00052   vtkTypeMacro(vtkPolyDataMapper2D,vtkMapper2D);
00053   static vtkPolyDataMapper2D *New();
00054   void PrintSelf(ostream& os, vtkIndent indent);
00055   
00057 
00058   void SetInput(vtkPolyData *in);
00059   vtkPolyData *GetInput();
00061 
00063 
00064   void SetLookupTable(vtkScalarsToColors *lut);
00065   vtkScalarsToColors *GetLookupTable();
00067 
00070   virtual void CreateDefaultLookupTable();
00071 
00073 
00075   vtkSetMacro(ScalarVisibility,int);
00076   vtkGetMacro(ScalarVisibility,int);
00077   vtkBooleanMacro(ScalarVisibility,int);
00079 
00081 
00088   vtkSetMacro(ColorMode,int);
00089   vtkGetMacro(ColorMode,int);
00090   void SetColorModeToDefault();
00091   void SetColorModeToMapScalars();
00093 
00095   const char *GetColorModeAsString();
00096 
00098 
00104   vtkSetMacro(UseLookupTableScalarRange,int);
00105   vtkGetMacro(UseLookupTableScalarRange,int);
00106   vtkBooleanMacro(UseLookupTableScalarRange,int);
00108 
00110 
00113   vtkSetVector2Macro(ScalarRange,double);
00114   vtkGetVectorMacro(ScalarRange,double,2);
00116 
00118 
00128   vtkSetMacro(ScalarMode,int);
00129   vtkGetMacro(ScalarMode,int);
00130   void SetScalarModeToDefault() {
00131     this->SetScalarMode(VTK_SCALAR_MODE_DEFAULT);};
00132   void SetScalarModeToUsePointData() {
00133     this->SetScalarMode(VTK_SCALAR_MODE_USE_POINT_DATA);};
00134   void SetScalarModeToUseCellData() {
00135     this->SetScalarMode(VTK_SCALAR_MODE_USE_CELL_DATA);};
00136   void SetScalarModeToUsePointFieldData() {
00137     this->SetScalarMode(VTK_SCALAR_MODE_USE_POINT_FIELD_DATA);};
00138   void SetScalarModeToUseCellFieldData() {
00139     this->SetScalarMode(VTK_SCALAR_MODE_USE_CELL_FIELD_DATA);};
00141   
00143 
00144   void ColorByArrayComponent(int arrayNum, int component);
00145   void ColorByArrayComponent(char* arrayName, int component);
00147   
00149 
00150   char* GetArrayName() { return this->ArrayName; }
00151   int GetArrayId() { return this->ArrayId; }
00152   int GetArrayAccessMode() { return this->ArrayAccessMode; }
00153   int GetArrayComponent() { return this->ArrayComponent; }
00155 
00158   virtual unsigned long GetMTime();
00159 
00161 
00165   virtual void SetTransformCoordinate(vtkCoordinate*);
00166   vtkGetObjectMacro(TransformCoordinate, vtkCoordinate);
00168 
00170 
00173   vtkGetMacro(TransformCoordinateUseDouble,bool);
00174   vtkSetMacro(TransformCoordinateUseDouble,bool);
00175   vtkBooleanMacro(TransformCoordinateUseDouble,bool);
00177 
00183   vtkUnsignedCharArray *MapScalars(double alpha);
00184   
00186   void ShallowCopy(vtkAbstractMapper *m);
00187 
00188 protected:
00189   vtkPolyDataMapper2D();
00190   ~vtkPolyDataMapper2D();
00191 
00192   vtkUnsignedCharArray *Colors;
00193 
00194   vtkScalarsToColors *LookupTable;
00195   int ScalarVisibility;
00196   vtkTimeStamp BuildTime;
00197   double ScalarRange[2];
00198   int UseLookupTableScalarRange;
00199   int ColorMode;
00200   int ScalarMode;
00201   
00202   vtkCoordinate *TransformCoordinate;
00203   bool TransformCoordinateUseDouble;
00204 
00205   virtual int FillInputPortInformation(int, vtkInformation*);
00206 
00207   // for coloring by a component of a field data array
00208   int ArrayId;
00209   char ArrayName[256];
00210   int ArrayComponent;
00211   int ArrayAccessMode;
00212 private:
00213   vtkPolyDataMapper2D(const vtkPolyDataMapper2D&);  // Not implemented.
00214   void operator=(const vtkPolyDataMapper2D&);  // Not implemented.
00215 };
00216 
00217 
00218 #endif
00219