VTK
/Users/kitware/Dashboards/MyTests/VTK_BLD_Release_docs/Utilities/Doxygen/dox/IO/AMR/vtkAMREnzoReader.h
Go to the documentation of this file.
00001 /*=========================================================================
00002 
00003  Program:   Visualization Toolkit
00004  Module:    vtkAMREnzoReader.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  =========================================================================*/
00025 #ifndef VTKAMRENZOREADER_H_
00026 #define VTKAMRENZOREADER_H_
00027 
00028 #include "vtkIOAMRModule.h" // For export macro
00029 #include "vtkAMRBaseReader.h"
00030 
00031 #include <map>     // For STL map
00032 #include <string>  // For std::string
00033 
00034 class vtkOverlappingAMR;
00035 class vtkEnzoReaderInternal;
00036 
00037 class VTKIOAMR_EXPORT vtkAMREnzoReader : public vtkAMRBaseReader
00038 {
00039 public:
00040   static vtkAMREnzoReader* New();
00041   vtkTypeMacro(vtkAMREnzoReader,vtkAMRBaseReader);
00042   void PrintSelf(ostream &os, vtkIndent indent );
00043 
00045 
00046   vtkSetMacro( ConvertToCGS, int );
00047   vtkGetMacro( ConvertToCGS, int );
00048   vtkBooleanMacro( ConvertToCGS, int );
00050 
00052   int GetNumberOfBlocks();
00053 
00055   int GetNumberOfLevels();
00056 
00058   void SetFileName( const char* fileName );
00059 
00060 protected:
00061   vtkAMREnzoReader();
00062   ~vtkAMREnzoReader();
00063 
00066   void ParseConversionFactors();
00067 
00070   int GetIndexFromArrayName( std::string arrayName );
00071 
00074   void ParseLabel(const std::string labelString,int &idx,std::string &label);
00075 
00078   void ParseCFactor(const std::string labelString, int &idx, double &factor );
00079 
00083   double GetConversionFactor( const std::string name );
00084 
00086   void ReadMetaData();
00087 
00089   int GetBlockLevel( const int blockIdx );
00090 
00091   void ComputeStats(vtkEnzoReaderInternal* internal, std::vector<int>& blocksPerLevel, double min[3]);
00092 
00094   int FillMetaData( );
00095 
00097   vtkUniformGrid* GetAMRGrid( const int blockIdx );
00098 
00100 
00101   void GetAMRGridData(
00102       const int blockIdx, vtkUniformGrid *block, const char *field);
00104 
00106   void SetUpDataArraySelections();
00107 
00108   int ConvertToCGS;
00109   bool IsReady;
00110 
00111 private:
00112   vtkAMREnzoReader( const vtkAMREnzoReader& ); // Not Implemented
00113   void operator=(const vtkAMREnzoReader& ); // Not Implemented
00114 
00115   vtkEnzoReaderInternal *Internal;
00116 
00117   std::map< std::string, int > label2idx;
00118   std::map< int, double >    conversionFactors;
00119 };
00120 
00121 #endif /* VTKAMRENZOREADER_H_ */