diff options
| author | Johan B. C. Engelen <jbc.engelen@swissonline.ch> | 2012-02-19 11:14:03 +0000 |
|---|---|---|
| committer | Johan Engelen <goejendaagh@zonnet.nl> | 2012-02-19 11:14:03 +0000 |
| commit | f61fc22a2f4a646e4c96b8155e2dee1f2981037c (patch) | |
| tree | 1a7dc88ca57cd6f3980e82c4c978b43f9408a7d2 /src/helper | |
| parent | fix crash on non-finite stroke widths (diff) | |
| download | inkscape-f61fc22a2f4a646e4c96b8155e2dee1f2981037c.tar.gz inkscape-f61fc22a2f4a646e4c96b8155e2dee1f2981037c.zip | |
move helper/recthull.h to 2geom/rect-hull.h
(bzr r10996)
Diffstat (limited to 'src/helper')
| -rw-r--r-- | src/helper/CMakeLists.txt | 1 | ||||
| -rw-r--r-- | src/helper/Makefile_insert | 1 | ||||
| -rw-r--r-- | src/helper/recthull.h | 59 |
3 files changed, 0 insertions, 61 deletions
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 <mental@rydia.net> - * - * 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<Point> midpoint() const { - if (_bounds) { - return _bounds->midpoint(); - } else { - return boost::optional<Point>(); - } - } - - 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 |
