From 418e3fc43abaa926ea116d11da2a42c5d65fc535 Mon Sep 17 00:00:00 2001 From: Artem Pavlenko Date: Mon, 21 Jan 2008 20:07:32 +0000 Subject: [PATCH] added missing extent() method --- include/mapnik/label_collision_detector.hpp | 37 ++++++++++++--------- 1 file changed, 22 insertions(+), 15 deletions(-) diff --git a/include/mapnik/label_collision_detector.hpp b/include/mapnik/label_collision_detector.hpp index 7b50c7dc4..1352f8588 100644 --- a/include/mapnik/label_collision_detector.hpp +++ b/include/mapnik/label_collision_detector.hpp @@ -133,24 +133,27 @@ namespace mapnik }; - //quad tree based label collission detector so labels dont appear within a given distance - class label_collision_detector4 : boost::noncopyable - { - struct label - { - label(Envelope const& b) : box(b) {} - label(Envelope const& b, std::wstring const& t) : box(b), text(t) {} - - Envelope box; - std::wstring text; - }; - - typedef quad_tree< label > tree_t; - tree_t tree_; + //quad tree based label collission detector so labels dont appear within a given distance + class label_collision_detector4 : boost::noncopyable + { + struct label + { + label(Envelope const& b) : box(b) {} + label(Envelope const& b, std::wstring const& t) : box(b), text(t) {} + + Envelope box; + std::wstring text; + }; + + typedef quad_tree< label > tree_t; + Envelope extent_; + tree_t tree_; + public: explicit label_collision_detector4(Envelope const& extent) - : tree_(extent) {} + : extent_(extent), + tree_(extent) {} bool has_placement(Envelope const& box) { @@ -201,6 +204,10 @@ namespace mapnik { tree_.clear(); } + Envelope const& extent() const + { + return extent_; + } }; }