summaryrefslogtreecommitdiffstats
path: root/src/libnr
diff options
context:
space:
mode:
authorJohan B. C. Engelen <jbc.engelen@swissonline.ch>2007-11-09 23:15:51 +0000
committerjohanengelen <johanengelen@users.sourceforge.net>2007-11-09 23:15:51 +0000
commite74f90ca3ce8c75e84d48b66a8a4e594c415b541 (patch)
treee306ccc400c5ed90995bd9130f3ddf0c55a17fe5 /src/libnr
parentallow for _option in radiobuttons for XML translation (diff)
downloadinkscape-e74f90ca3ce8c75e84d48b66a8a4e594c415b541.tar.gz
inkscape-e74f90ca3ce8c75e84d48b66a8a4e594c415b541.zip
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)
Diffstat (limited to 'src/libnr')
-rw-r--r--src/libnr/nr-point.h11
1 files changed, 11 insertions, 0 deletions
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];
};