VTK
dox/Rendering/Core/vtkMapArrayValues.h
Go to the documentation of this file.
00001 /*=========================================================================
00002 
00003   Program:   Visualization Toolkit
00004   Module:    vtkMapArrayValues.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 __vtkMapArrayValues_h
00039 #define __vtkMapArrayValues_h
00040 
00041 #include "vtkRenderingCoreModule.h" // For export macro
00042 #include "vtkPassInputTypeAlgorithm.h"
00043 
00044 class vtkMapType;
00045 class vtkVariant;
00046 
00047 class VTKRENDERINGCORE_EXPORT vtkMapArrayValues : public vtkPassInputTypeAlgorithm
00048 {
00049 public:
00050   vtkTypeMacro(vtkMapArrayValues,vtkPassInputTypeAlgorithm);
00051   void PrintSelf(ostream& os, vtkIndent indent);
00052 
00053   static vtkMapArrayValues *New();
00054 
00056 
00058   vtkSetMacro(FieldType, int);
00059   vtkGetMacro(FieldType, int);
00061 
00063 
00066   vtkSetMacro(PassArray, int);
00067   vtkGetMacro(PassArray, int);
00068   vtkBooleanMacro(PassArray, int);
00070 
00072 
00075   vtkSetMacro(FillValue, double);
00076   vtkGetMacro(FillValue, double);
00078 
00080 
00082   vtkSetStringMacro(InputArrayName);
00083   vtkGetStringMacro(InputArrayName);
00085 
00087 
00088   vtkSetStringMacro(OutputArrayName);
00089   vtkGetStringMacro(OutputArrayName);
00091 
00093 
00095   vtkGetMacro(OutputArrayType, int);
00096   vtkSetMacro(OutputArrayType, int);
00098 
00100 
00103   void AddToMap(vtkVariant from, vtkVariant to);
00104   void AddToMap(int from, int to);
00105   void AddToMap(int from, char *to);
00106   void AddToMap(char *from, int to);
00107   void AddToMap(char *from, char *to);
00109 
00111   void ClearMap();
00112 
00114   int GetMapSize();
00115 
00116 //BTX
00117   // Always keep NUM_ATTRIBUTE_LOCS as the last entry
00118   enum FieldType
00119   {
00120     POINT_DATA=0,
00121     CELL_DATA=1,
00122     VERTEX_DATA=2,
00123     EDGE_DATA=3,
00124     ROW_DATA=4,
00125     NUM_ATTRIBUTE_LOCS
00126   };
00127 //ETX
00128 
00129 protected:
00130 
00131   vtkMapArrayValues();
00132   virtual ~vtkMapArrayValues();
00133 
00134   int RequestData(vtkInformation *, vtkInformationVector **, vtkInformationVector *);
00135   int FillInputPortInformation(int, vtkInformation *);
00136 
00137   char* InputArrayName;
00138   char* OutputArrayName;
00139   int OutputArrayType;
00140   int FieldType;
00141   int MapType;
00142   int PassArray;
00143   double FillValue;
00144 
00145   // PIMPL idiom to hide map implementation.
00146   vtkMapType *Map;
00147 
00148 private:
00149   vtkMapArrayValues(const vtkMapArrayValues&);  // Not implemented.
00150   void operator=(const vtkMapArrayValues&);  // Not implemented.
00151 };
00152 
00153 #endif