added missing extent() method

This commit is contained in:
Artem Pavlenko 2008-01-21 20:07:32 +00:00
parent 96daa6e996
commit 418e3fc43a

View file

@ -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<double> const& b) : box(b) {}
label(Envelope<double> const& b, std::wstring const& t) : box(b), text(t) {}
Envelope<double> 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<double> const& b) : box(b) {}
label(Envelope<double> const& b, std::wstring const& t) : box(b), text(t) {}
Envelope<double> box;
std::wstring text;
};
typedef quad_tree< label > tree_t;
Envelope<double> extent_;
tree_t tree_;
public:
explicit label_collision_detector4(Envelope<double> const& extent)
: tree_(extent) {}
: extent_(extent),
tree_(extent) {}
bool has_placement(Envelope<double> const& box)
{
@ -201,6 +204,10 @@ namespace mapnik
{
tree_.clear();
}
Envelope<double> const& extent() const
{
return extent_;
}
};
}