From f61fc22a2f4a646e4c96b8155e2dee1f2981037c Mon Sep 17 00:00:00 2001 From: "Johan B. C. Engelen" Date: Sun, 19 Feb 2012 12:14:03 +0100 Subject: move helper/recthull.h to 2geom/rect-hull.h (bzr r10996) --- src/helper/CMakeLists.txt | 1 - src/helper/Makefile_insert | 1 - src/helper/recthull.h | 59 ---------------------------------------------- 3 files changed, 61 deletions(-) delete mode 100644 src/helper/recthull.h (limited to 'src/helper') diff --git a/src/helper/CMakeLists.txt b/src/helper/CMakeLists.txt index b59cf03ba..dbb361c72 100644 --- a/src/helper/CMakeLists.txt +++ b/src/helper/CMakeLists.txt @@ -35,7 +35,6 @@ set(helper_SRC gnome-utils.h pixbuf-ops.h png-write.h - recthull.h stlport.h stock-items.h unit-menu.h diff --git a/src/helper/Makefile_insert b/src/helper/Makefile_insert index 7110c2025..0efb5d6ce 100644 --- a/src/helper/Makefile_insert +++ b/src/helper/Makefile_insert @@ -15,7 +15,6 @@ ink_common_sources += \ helper/helper-forward.h \ helper/png-write.cpp \ helper/png-write.h \ - helper/recthull.h \ helper/sp-marshal.cpp \ helper/sp-marshal.h \ helper/unit-menu.cpp \ diff --git a/src/helper/recthull.h b/src/helper/recthull.h deleted file mode 100644 index d82450ce8..000000000 --- a/src/helper/recthull.h +++ /dev/null @@ -1,59 +0,0 @@ -#ifndef SEEN_GEOM_RECT_HULL_H -#define SEEN_GEOM_RECT_HULL_H - -/* ex:set et ts=4 sw=4: */ - -/* - * A class representing the convex hull of a set of points. - * - * Copyright 2004 MenTaLguY - * - * This code is licensed under the GNU GPL; see COPYING for more information. - */ - -#include <2geom/rect.h> - -namespace Geom { - -class RectHull { -public: - RectHull() : _bounds() {} - explicit RectHull(Point const &p) : _bounds(Rect(p, p)) {} - - boost::optional midpoint() const { - if (_bounds) { - return _bounds->midpoint(); - } else { - return boost::optional(); - } - } - - void add(Point const &p) { - if (_bounds) { - _bounds->expandTo(p); - } else { - _bounds = Rect(p, p); - } - } - void add(Rect const &r) { - // Note that this is a hack. when convexhull actually works - // you will need to add all four points. - _bounds.unionWith(r); - } - void add(RectHull const &h) { - if (h._bounds) { - add(*h._bounds); - } - } - - OptRect const &bounds() const { - return _bounds; - } - -private: - OptRect _bounds; -}; - -} /* namespace Geom */ - -#endif -- cgit v1.2.3