From e74f90ca3ce8c75e84d48b66a8a4e594c415b541 Mon Sep 17 00:00:00 2001 From: "Johan B. C. Engelen" Date: Fri, 9 Nov 2007 23:15:51 +0000 Subject: Remove geom.cpp and geom.h. Now use 2geom/geom.cpp and 2geom.h. Add conversion functions between Geom::Point and NR::Point (bzr r4050) --- src/libnr/nr-point.h | 11 +++++++++++ 1 file changed, 11 insertions(+) (limited to 'src/libnr') diff --git a/src/libnr/nr-point.h b/src/libnr/nr-point.h index f67a66800..60c5586b0 100644 --- a/src/libnr/nr-point.h +++ b/src/libnr/nr-point.h @@ -16,6 +16,8 @@ //#include "round.h" #include "decimal-round.h" +#include <2geom/point.h> + /// A NRPoint consists of x and y coodinates. /// \todo /// This class appears to be obsoleted out in favour of NR::Point. @@ -49,6 +51,11 @@ public: } } + inline Point(Geom::Point const &p) { + _pt[X] = p[Geom::X]; + _pt[Y] = p[Geom::Y]; + } + inline Point &operator=(Point const &p) { for (unsigned i = 0; i < 2; ++i) { _pt[i] = p._pt[i]; @@ -132,6 +139,10 @@ public: friend inline std::ostream &operator<< (std::ostream &out_file, const NR::Point &in_pnt); + inline Geom::Point to_2geom() const { + return Geom::Point(_pt[X], _pt[Y]); + } + private: Coord _pt[2]; }; -- cgit v1.2.3