32#include <geometry/rtree.h>
52 const int mmin[2] = { bbox.
GetX(), bbox.
GetY() };
55 VIEW_RTREE_BASE::Insert( mmin, mmax, aItem );
68 const int mmin[2] = { INT_MIN, INT_MIN };
69 const int mmax[2] = { INT_MAX, INT_MAX };
71 VIEW_RTREE_BASE::Remove( mmin, mmax, aItem );
78 template <
class Visitor>
79 void Query(
const BOX2I& aBounds, Visitor& aVisitor )
const
81 int mmin[2] = { aBounds.
GetX(), aBounds.
GetY() };
91 if( aBounds == max_box )
93 mmin[0] = mmin[1] = INT_MIN;
94 mmax[0] = mmax[1] = INT_MAX;
97 VIEW_RTREE_BASE::Search( mmin, mmax, aVisitor );
coord_type GetRight() const
coord_type GetBottom() const
An abstract base class for deriving all objects that can be added to a VIEW.
virtual const BOX2I ViewBBox() const =0
Return the bounding box of the item covering all its layers.
Implement an non-owning R-tree for fast spatial indexing of VIEW items.
void Insert(VIEW_ITEM *aItem)
Insert an item into the tree.
void Remove(VIEW_ITEM *aItem)
Remove an item from the tree.
void Query(const BOX2I &aBounds, Visitor &aVisitor) const
Execute a function object aVisitor for each item whose bounding box intersects with aBounds.
The Cairo implementation of the graphics abstraction layer.
RTree< VIEW_ITEM *, int, 2, double > VIEW_RTREE_BASE