VTK
dox/Infovis/vtkStringToNumeric.h
Go to the documentation of this file.
00001 /*=========================================================================
00002 
00003   Program:   Visualization Toolkit
00004   Module:    vtkStringToNumeric.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 =========================================================================*/
00015 /*-------------------------------------------------------------------------
00016   Copyright 2008 Sandia Corporation.
00017   Under the terms of Contract DE-AC04-94AL85000 with Sandia Corporation,
00018   the U.S. Government retains certain rights in this software.
00019 -------------------------------------------------------------------------*/
00034 #ifndef __vtkStringToNumeric_h
00035 #define __vtkStringToNumeric_h
00036 
00037 #include "vtkDataObjectAlgorithm.h"
00038 
00039 class VTK_INFOVIS_EXPORT vtkStringToNumeric : public vtkDataObjectAlgorithm
00040 {
00041 public:
00042   static vtkStringToNumeric* New();
00043   vtkTypeMacro(vtkStringToNumeric,vtkDataObjectAlgorithm);
00044   void PrintSelf(ostream& os, vtkIndent indent);
00045   
00047 
00048   vtkSetMacro(ConvertFieldData, bool);
00049   vtkGetMacro(ConvertFieldData, bool);
00050   vtkBooleanMacro(ConvertFieldData, bool);
00052   
00054 
00055   vtkSetMacro(ConvertPointData, bool);
00056   vtkGetMacro(ConvertPointData, bool);
00057   vtkBooleanMacro(ConvertPointData, bool);
00059   
00061 
00062   vtkSetMacro(ConvertCellData, bool);
00063   vtkGetMacro(ConvertCellData, bool);
00064   vtkBooleanMacro(ConvertCellData, bool);
00066 
00068 
00069   virtual void SetConvertVertexData(bool b)
00070     { this->SetConvertPointData(b); }
00071   virtual bool GetConvertVertexData()
00072     { return this->GetConvertPointData(); }
00073   vtkBooleanMacro(ConvertVertexData, bool);
00075 
00077 
00078   virtual void SetConvertEdgeData(bool b)
00079     { this->SetConvertCellData(b); }
00080   virtual bool GetConvertEdgeData()
00081     { return this->GetConvertCellData(); }
00082   vtkBooleanMacro(ConvertEdgeData, bool);
00084 
00086 
00087   virtual void SetConvertRowData(bool b)
00088     { this->SetConvertPointData(b); }
00089   virtual bool GetConvertRowData()
00090     { return this->GetConvertPointData(); }
00091   vtkBooleanMacro(ConvertRowData, bool);
00093 
00095 
00096   virtual int ProcessRequest(vtkInformation* request, 
00097                              vtkInformationVector** inputVector,
00098                              vtkInformationVector* outputVector);
00100 
00101 protected:
00102   vtkStringToNumeric();
00103   ~vtkStringToNumeric();
00104 
00106 
00107   virtual int RequestDataObject(vtkInformation* request,
00108                                 vtkInformationVector** inputVector,
00109                                 vtkInformationVector* outputVector);
00111   
00113   void ConvertArrays(vtkFieldData* fieldData);
00114   
00115   bool ConvertFieldData;
00116   bool ConvertPointData;
00117   bool ConvertCellData;
00118 
00122   int CountItemsToConvert(vtkFieldData *fieldData);
00123 
00124   // These keep track of our progress 
00125   int ItemsToConvert;
00126   int ItemsConverted;
00127 
00128   int RequestData(
00129     vtkInformation*, 
00130     vtkInformationVector**, 
00131     vtkInformationVector*);
00132     
00133 private:
00134   vtkStringToNumeric(const vtkStringToNumeric&); // Not implemented
00135   void operator=(const vtkStringToNumeric&);   // Not implemented
00136 };
00137 
00138 #endif
00139