#include "data.hpp" #include #include #include #include BOOST_CLASS_EXPORT_GUID(Point, "Point") BOOST_CLASS_EXPORT_GUID(Point3D, "Point3D") Point::Point(int x, int y) : _x(x), _y(y) {} Point3D::Point3D(int x, int y, int z) : Point(x,y), _z(z) {} Line::Line(const Point &org, boost::shared_ptr dest) : _org(org) , _dest(dest) { } void Point::serialize(boost::archive::binary_iarchive & ar, const unsigned int /* file_version */){ ar & _x & _y; } void Point::serialize(boost::archive::binary_oarchive & ar, const unsigned int /* file_version */){ ar & _x & _y; } void Point3D::serialize(boost::archive::binary_iarchive & ar, const unsigned int /* file_version */){ ar & boost::serialization::base_object(*this); ar & _z; } void Point3D::serialize(boost::archive::binary_oarchive & ar, const unsigned int /* file_version */){ ar & boost::serialization::base_object(*this); ar & _z; } std::ostream& operator<<(std::ostream &out, const Point &rhs) { rhs.dump(out); return out; } std::ostream& operator<<(std::ostream &out, const Point3D &rhs) { rhs.dump(out); return out; } std::ostream& operator<<(std::ostream &out, const Line &rhs) { rhs.org().dump(out); out << "->"; rhs.dest()->dump(out); return out; } void Point::dump(std::ostream &out) const { out << '(' << x() << ',' << y() << ')'; } void Point3D::dump(std::ostream &out) const { out << '(' << x() << ',' << y() << ',' << z() << ')'; }