00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011 #ifndef IMeshReader_h__
00012 #define IMeshReader_h__
00013
00014 #include <string>
00015 #include "../Common.h"
00016
00017 class hHybridMesh;
00018
00019 namespace MeshRead{
00020
00021 class IMeshReader
00022 {
00023 public:
00024
00025 IMeshReader() : readSequence(0) {};
00026 virtual ~IMeshReader(){ delete [] readSequence; };
00027
00028 virtual bool doRead(hHybridMesh * mesh)=0;
00029
00030
00031 static const char V_COUNT = 'v', VERTICES = 'V',
00032 E_COUNT = 'e', EDGES = 'E',
00033 F_COUNT ='f', FACES ='F',
00034 EL_COUNT = 'l', ELEMENTS = 'L',
00035 AUX='a', END = 0;
00036
00039 char* readSequence;
00040
00043 virtual bool Init() = 0;
00044 virtual bool Init(const std::string & name) = 0;
00045 virtual std::string Name() const = 0;
00048 virtual void Free() = 0;
00049
00052 virtual int GetCoordinatesDimension() const;
00053
00056 virtual int GetVerticesCount() ;
00057
00061 virtual bool GetNextVertex(double coords[]) ;
00062
00066 virtual void GetElementCount(int type_count[]);
00067
00073 virtual bool GetNextElement(Tind vertices[], Tind neighbours[], Tind faces[], Tind & element_type , Tind & father, int8_t & material, int8_t & ref) ;
00074
00081 virtual bool GetBoundaryConditions(double ** bc, int & bcCount) ;
00082
00085 virtual int GetEdgesCount()
00086 {
00087 return 0;
00088 }
00089
00093 virtual bool GetNextEdge(Tind vertices[],Tind & edge_type)
00094 {
00095 throw("You shouldn't use this function!");
00096 return false;
00097 }
00098
00099 virtual void GetFacesCount(int face_type[])
00100 {
00101 }
00102
00103 virtual bool GetNextFace(Tind edges[],Tind & face_type, int8_t & bc, Tind neigh[])
00104 {
00105 return false;
00106 }
00107
00108 };
00109
00110 }
00111 #endif // IMeshReader_h__