00001 #ifndef MESH_FILE_IMPORTER_H
00002 #define MESH_FILE_IMPORTER_H
00003
00004 #include "IMeshReader.h"
00005
00006 #include <fstream>
00007 #include <string>
00008
00009 namespace MeshRead
00010 {
00011
00012 class MeshFileImporter :
00013 public MeshRead::IMeshReader
00014 {
00015 public:
00016 MeshFileImporter(void);
00017 MeshFileImporter(const std::string & file_name);
00018 virtual ~MeshFileImporter(void);
00019
00022 bool Init(const std::string & file_name);
00023
00026 bool Init();
00027
00030 std::string Name() const;
00031
00034 void Free();
00035
00036 bool doRead(hHybridMesh * mesh)=0;
00037
00040 int GetCoordinatesDimension() const ;
00041
00044 int GetVerticesCount() ;
00045
00049 bool GetNextVertex(double coords[]) ;
00050
00053 void GetElementCount(int element_type[]) ;
00054
00060 bool GetNextElement(Tind vertices[], Tind neighbours[], Tind faces[], Tind & element_type , Tind & father, int8_t & material, int8_t & ref) ;
00061
00068 bool GetBoundaryConditions(double ** bc, int & bcCount) ;
00069
00070 protected:
00071 int getPos();
00072 void setPos(const int newPos);
00073 std::string _file_name;
00074 std::fstream _file;
00075 int _vert_count,
00076 _vert_readed,
00077 _elem_count,
00078 _elem_readed,
00079 gridPos_,
00080 elemPos_,
00081 facePos_;
00082
00083 };
00084
00085 }
00086
00087 #endif //MESH_FILE_IMPORTER_H