![]() |
00001 // Copyright (C) 2002 Johan Hoffman and Anders Logg. 00002 // Licensed under the GNU GPL Version 2. 00003 00004 #ifndef __XML_MESH_H 00005 #define __XML_MESH_H 00006 00007 #include <dolfin/XMLObject.h> 00008 00009 namespace dolfin { 00010 00011 class Mesh; 00012 00013 class XMLMesh : public XMLObject { 00014 public: 00015 00016 XMLMesh(Mesh& mesh_); 00017 00018 void startElement (const xmlChar *name, const xmlChar **attrs); 00019 void endElement (const xmlChar *name); 00020 00021 void reading(std::string filename); 00022 void done(); 00023 00024 private: 00025 00026 enum ParserState { OUTSIDE, INSIDE_MESH, INSIDE_NODES, INSIDE_CELLS, DONE }; 00027 00028 void readMesh (const xmlChar *name, const xmlChar **attrs); 00029 void readNodes (const xmlChar *name, const xmlChar **attrs); 00030 void readCells (const xmlChar *name, const xmlChar **attrs); 00031 void readNode (const xmlChar *name, const xmlChar **attrs); 00032 void readTriangle (const xmlChar *name, const xmlChar **attrs); 00033 void readTetrahedron (const xmlChar *name, const xmlChar **attrs); 00034 00035 void initMesh(); 00036 00037 Mesh& mesh; 00038 int nodes; 00039 int cells; 00040 00041 bool _create_edges; 00042 00043 ParserState state; 00044 00045 }; 00046 00047 } 00048 00049 #endif
Documentation automatically generated with Doxygen on 10 Sep 2004.