contrib/gel/vtol/vtol_topology_io.h
Go to the documentation of this file.
00001 #ifndef vtol_topology_io_h
00002 #define vtol_topology_io_h
00003 //:
00004 // \file
00005 // \brief This class will write a list of topology objects into an XML document.
00006 
00007 #include <vtol/vtol_topology_object_sptr.h>
00008 #include <vcl_list.h>
00009 #include <vcl_ostream.h>
00010 #include <vcl_iostream.h>
00011 
00012 #include <vtol/vtol_vertex_2d_sptr.h>
00013 #include <vtol/vtol_zero_chain_sptr.h>
00014 #include <vtol/vtol_edge_2d_sptr.h>
00015 #include <vtol/vtol_one_chain_sptr.h>
00016 #include <vtol/vtol_face_2d_sptr.h>
00017 #include <vtol/vtol_two_chain_sptr.h>
00018 #include <vtol/vtol_block_sptr.h>
00019 
00020 //: \brief topological xml writer
00021 
00022 class vtol_topology_io
00023 {
00024  public:
00025 
00026   //: default constructor
00027   vtol_topology_io();
00028 
00029   //: default destructor
00030   ~vtol_topology_io();
00031 
00032   //: write a list of topology objects
00033   void write(vcl_list<vtol_topology_object_sptr> &topo_objects,
00034              vcl_ostream &strm=vcl_cout);
00035 
00036  private:
00037 
00038   // write out the topology objects
00039   void write_vertex_2d(vtol_vertex_2d_sptr const &v, vcl_ostream &strm=vcl_cout);
00040   void write_zero_chain(vtol_zero_chain_sptr const &zc, vcl_ostream &strm=vcl_cout);
00041   void write_edge_2d(vtol_edge_2d_sptr const &e, vcl_ostream &strm=vcl_cout);
00042   void write_one_chain(vtol_one_chain_sptr const &oc, vcl_ostream &strm=vcl_cout);
00043   void write_face_2d(vtol_face_2d_sptr const &f, vcl_ostream &strm=vcl_cout);
00044   void write_two_chain(vtol_two_chain_sptr const &tc, vcl_ostream &strm=vcl_cout);
00045   void write_block(vtol_block_sptr const &b, vcl_ostream &strm=vcl_cout);
00046 
00047   // write out the dtd
00048   void write_dtd(vcl_ostream &strm);
00049 };
00050 
00051 #endif // vtol_topology_io_h