xmlio.hpp

00001 // This file is part of the imaging2 class library.
00002 //
00003 // University of Innsbruck, Infmath Imaging, 2009.
00004 // http://infmath.uibk.ac.at
00005 //
00006 // All rights reserved.
00007 
00008 
00009 #ifndef SHAPE_MREP_XMLIO_H
00010 #define SHAPE_MREP_XMLIO_H
00011 
00012 #include <xml/XmlReader.hpp>
00013 #include <xml/XmlWriter.hpp>
00014 
00015 #include <shape/mrep/Position2d.hpp>
00016 #include <shape/mrep/MrepAtom.hpp>
00017 #include <shape/mrep/MrepConnection.hpp>
00018 #include <shape/mrep/MrepSkeleton2d.hpp>
00019 #include <shape/mrep/MrepModel2d.hpp>
00020 #include <shape/mrep/PolygonModel2d.hpp>
00021 
00022 namespace imaging
00023 {
00027   template<>
00028   class xml_handler< Position2d >
00029   {
00030   public:
00031     static const std::string element_name;
00032 
00033     void read_object(XmlReader & in, Position2d & object) const;
00034     void write_object(const Position2d & object, XmlWriter & out) const;
00035 
00036   };
00037 
00041   template<>
00042   class xml_handler<MrepAtom>
00043   {
00044   public:
00045     static const std::string element_name;
00046 
00047     void read_object(XmlReader & in, MrepAtom & object) const;
00048     void write_object(const MrepAtom & object, XmlWriter & out) const;
00049   };
00050 
00054   template<>
00055   class xml_handler< MrepConnection<2> >
00056   {
00057   public:
00058     static const std::string element_name;
00059 
00060     void read_object(XmlReader & in, MrepConnection<2> & object) const;
00061     void write_object(const MrepConnection<2> & object, XmlWriter & out) const;
00062   };
00063 
00065   template<>
00066   class xml_handler<MrepSkeleton2d>
00067   {
00068   public:
00069     static const std::string element_name;
00070 
00071     void read_object(XmlReader & in, MrepSkeleton2d & object) const;
00072     void write_object(const MrepSkeleton2d & object, XmlWriter & out) const;
00073   };
00079   template<>
00080   class xml_handler<MrepModel2d>
00081   {
00082   public:
00083     static const std::string element_name;
00084 
00085     void read_object(XmlReader & in, MrepModel2d & object) const;
00086     void write_object(const MrepModel2d & object, XmlWriter & out) const;
00087   };
00088 
00092   template<>
00093   class xml_handler<PolygonModel2d>
00094   {
00095   public:
00096     static const std::string element_name;
00097 
00098     void read_object(XmlReader & in, PolygonModel2d & object) const;
00099     void write_object(const PolygonModel2d & object, XmlWriter & out) const;
00100   };
00101 
00102 }
00103 
00104 
00105 #endif

Generated on Tue Feb 10 10:01:29 2009 for imaging2 by  doxygen 1.5.5