VTK
dox/Rendering/Core/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 "vtkRenderingCoreModule.h" // For export macro
00043 #include "vtkMapper2D.h"
00044 
00045 class vtkCoordinate;
00046 class vtkPolyData;
00047 class vtkScalarsToColors;
00048 class vtkUnsignedCharArray;
00049 
00050 class VTKRENDERINGCORE_EXPORT vtkPolyDataMapper2D : public vtkMapper2D
00051 {
00052 public:
00053   vtkTypeMacro(vtkPolyDataMapper2D,vtkMapper2D);
00054   static vtkPolyDataMapper2D *New();
00055   void PrintSelf(ostream& os, vtkIndent indent);
00056 
00058 
00059   void SetInputData(vtkPolyData *in);
00060   vtkPolyData *GetInput();
00062 
00064 
00065   void SetLookupTable(vtkScalarsToColors *lut);
00066   vtkScalarsToColors *GetLookupTable();
00068 
00071   virtual void CreateDefaultLookupTable();
00072 
00074 
00076   vtkSetMacro(ScalarVisibility, int);
00077   vtkGetMacro(ScalarVisibility, int);
00078   vtkBooleanMacro(ScalarVisibility, int);
00080 
00082 
00089   vtkSetMacro(ColorMode, int);
00090   vtkGetMacro(ColorMode, int);
00091   void SetColorModeToDefault();
00092   void SetColorModeToMapScalars();
00094 
00096   const char *GetColorModeAsString();
00097 
00099 
00105   vtkSetMacro(UseLookupTableScalarRange, int);
00106   vtkGetMacro(UseLookupTableScalarRange, int);
00107   vtkBooleanMacro(UseLookupTableScalarRange, int);
00109 
00111 
00114   vtkSetVector2Macro(ScalarRange, double);
00115   vtkGetVectorMacro(ScalarRange, double, 2);
00117 
00119 
00129   vtkSetMacro(ScalarMode, int);
00130   vtkGetMacro(ScalarMode, int);
00131   void SetScalarModeToDefault()
00132     { this->SetScalarMode(VTK_SCALAR_MODE_DEFAULT); }
00133   void SetScalarModeToUsePointData()
00134     { this->SetScalarMode(VTK_SCALAR_MODE_USE_POINT_DATA); }
00135   void SetScalarModeToUseCellData()
00136     { this->SetScalarMode(VTK_SCALAR_MODE_USE_CELL_DATA); }
00137   void SetScalarModeToUsePointFieldData()
00138     { this->SetScalarMode(VTK_SCALAR_MODE_USE_POINT_FIELD_DATA); }
00139   void SetScalarModeToUseCellFieldData()
00140     { this->SetScalarMode(VTK_SCALAR_MODE_USE_CELL_FIELD_DATA); }
00142 
00144 
00145   void ColorByArrayComponent(int arrayNum, int component);
00146   void ColorByArrayComponent(char* arrayName, int component);
00148 
00150 
00151   char* GetArrayName() { return this->ArrayName; }
00152   int GetArrayId() { return this->ArrayId; }
00153   int GetArrayAccessMode() { return this->ArrayAccessMode; }
00154   int GetArrayComponent() { return this->ArrayComponent; }
00156 
00159   virtual unsigned long GetMTime();
00160 
00162 
00166   virtual void SetTransformCoordinate(vtkCoordinate*);
00167   vtkGetObjectMacro(TransformCoordinate, vtkCoordinate);
00169 
00171 
00174   vtkGetMacro(TransformCoordinateUseDouble, bool);
00175   vtkSetMacro(TransformCoordinateUseDouble, bool);
00176   vtkBooleanMacro(TransformCoordinateUseDouble, bool);
00178 
00184   vtkUnsignedCharArray *MapScalars(double alpha);
00185 
00187   void ShallowCopy(vtkAbstractMapper *m);
00188 
00189 protected:
00190   vtkPolyDataMapper2D();
00191   ~vtkPolyDataMapper2D();
00192 
00193   virtual int FillInputPortInformation(int, vtkInformation*);
00194 
00195   vtkUnsignedCharArray *Colors;
00196 
00197   vtkScalarsToColors *LookupTable;
00198   int ScalarVisibility;
00199   vtkTimeStamp BuildTime;
00200   double ScalarRange[2];
00201   int UseLookupTableScalarRange;
00202   int ColorMode;
00203   int ScalarMode;
00204 
00205   vtkCoordinate *TransformCoordinate;
00206   bool TransformCoordinateUseDouble;
00207 
00208   // for coloring by a component of a field data array
00209   int ArrayId;
00210   char ArrayName[256];
00211   int ArrayComponent;
00212   int ArrayAccessMode;
00213 private:
00214   vtkPolyDataMapper2D(const vtkPolyDataMapper2D&);  // Not implemented.
00215   void operator=(const vtkPolyDataMapper2D&);  // Not implemented.
00216 };
00217 
00218 
00219 #endif
00220