VTK
/Users/kitware/Dashboards/MyTests/VTK_BLD_Release_docs/Utilities/Doxygen/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 
00092   vtkSetMacro(ColorMode, int);
00093   vtkGetMacro(ColorMode, int);
00094   void SetColorModeToDefault();
00095   void SetColorModeToMapScalars();
00096   void SetColorModeToDirectScalars();
00098 
00100   const char *GetColorModeAsString();
00101 
00103 
00109   vtkSetMacro(UseLookupTableScalarRange, int);
00110   vtkGetMacro(UseLookupTableScalarRange, int);
00111   vtkBooleanMacro(UseLookupTableScalarRange, int);
00113 
00115 
00118   vtkSetVector2Macro(ScalarRange, double);
00119   vtkGetVectorMacro(ScalarRange, double, 2);
00121 
00123 
00133   vtkSetMacro(ScalarMode, int);
00134   vtkGetMacro(ScalarMode, int);
00135   void SetScalarModeToDefault()
00136     { this->SetScalarMode(VTK_SCALAR_MODE_DEFAULT); }
00137   void SetScalarModeToUsePointData()
00138     { this->SetScalarMode(VTK_SCALAR_MODE_USE_POINT_DATA); }
00139   void SetScalarModeToUseCellData()
00140     { this->SetScalarMode(VTK_SCALAR_MODE_USE_CELL_DATA); }
00141   void SetScalarModeToUsePointFieldData()
00142     { this->SetScalarMode(VTK_SCALAR_MODE_USE_POINT_FIELD_DATA); }
00143   void SetScalarModeToUseCellFieldData()
00144     { this->SetScalarMode(VTK_SCALAR_MODE_USE_CELL_FIELD_DATA); }
00146 
00148 
00149   void ColorByArrayComponent(int arrayNum, int component);
00150   void ColorByArrayComponent(char* arrayName, int component);
00152 
00154 
00155   char* GetArrayName() { return this->ArrayName; }
00156   int GetArrayId() { return this->ArrayId; }
00157   int GetArrayAccessMode() { return this->ArrayAccessMode; }
00158   int GetArrayComponent() { return this->ArrayComponent; }
00160 
00163   virtual unsigned long GetMTime();
00164 
00166 
00170   virtual void SetTransformCoordinate(vtkCoordinate*);
00171   vtkGetObjectMacro(TransformCoordinate, vtkCoordinate);
00173 
00175 
00178   vtkGetMacro(TransformCoordinateUseDouble, bool);
00179   vtkSetMacro(TransformCoordinateUseDouble, bool);
00180   vtkBooleanMacro(TransformCoordinateUseDouble, bool);
00182 
00188   vtkUnsignedCharArray *MapScalars(double alpha);
00189 
00191   void ShallowCopy(vtkAbstractMapper *m);
00192 
00193 protected:
00194   vtkPolyDataMapper2D();
00195   ~vtkPolyDataMapper2D();
00196 
00197   virtual int FillInputPortInformation(int, vtkInformation*);
00198 
00199   vtkUnsignedCharArray *Colors;
00200 
00201   vtkScalarsToColors *LookupTable;
00202   int ScalarVisibility;
00203   vtkTimeStamp BuildTime;
00204   double ScalarRange[2];
00205   int UseLookupTableScalarRange;
00206   int ColorMode;
00207   int ScalarMode;
00208 
00209   vtkCoordinate *TransformCoordinate;
00210   bool TransformCoordinateUseDouble;
00211 
00212   // for coloring by a component of a field data array
00213   int ArrayId;
00214   char ArrayName[256];
00215   int ArrayComponent;
00216   int ArrayAccessMode;
00217 private:
00218   vtkPolyDataMapper2D(const vtkPolyDataMapper2D&);  // Not implemented.
00219   void operator=(const vtkPolyDataMapper2D&);  // Not implemented.
00220 };
00221 
00222 
00223 #endif
00224