00001 #ifndef _IN_FILE_IMPORTER_H_ 00002 #define _IN_FILE_IMPORTER_H_ 00003 00004 #include <string> 00005 00006 #include "MeshFileImporter.h" 00007 00008 namespace MeshRead 00009 { 00010 00011 class InFileImporter : public MeshFileImporter 00012 { 00013 public: 00014 InFileImporter(); 00015 InFileImporter(const std::string & fn); 00016 00017 virtual ~InFileImporter(); 00018 00019 void Free(); 00020 00021 bool Init(); 00022 bool Init(const std::string& fn); 00023 bool doRead(hHybridMesh * m); 00024 00025 protected: 00026 static const std::string nodesBegin; 00027 static const std::string elemsBegin; 00028 static const std::string nodesEnd; 00029 static const std::string cmBlockBegin; 00030 static const char eol = '\n'; 00031 00032 struct EBlockLine 00033 { 00034 static const int maxNodes=8; 00035 00036 00037 EBlockLine() 00038 : nNodes(0),good(false) 00039 {}; 00040 00041 00042 int nNodes,N, 00043 field[9]; 00044 uTind nodes[maxNodes]; 00045 bool good; 00046 }; 00047 00048 friend std::istream& operator>>(std::istream & ifs,InFileImporter::EBlockLine & b); 00049 00050 }; 00051 }; // namespace MeshRead 00052 00053 #endif // _IN_FILE_IMPORTER_H_