KiCad PCB EDA Suite
|
Implement an non-owning R-tree for fast spatial indexing of VIEW items. More...
#include <view_rtree.h>
Public Member Functions | |
void | Insert (VIEW_ITEM *aItem, const BOX2I &bbox) |
Insert an item into the tree. | |
void | Remove (VIEW_ITEM *aItem, const BOX2I *aBbox) |
Remove an item from the tree. | |
template<class Visitor > | |
void | Query (const BOX2I &aBounds, Visitor &aVisitor) const |
Execute a function object aVisitor for each item whose bounding box intersects with aBounds. | |
Implement an non-owning R-tree for fast spatial indexing of VIEW items.
Definition at line 41 of file view_rtree.h.
Insert an item into the tree.
Item's bounding box is taken via its ViewBBox() method.
Definition at line 49 of file view_rtree.h.
References BOX2< Vec >::GetBottom(), BOX2< Vec >::GetRight(), BOX2< Vec >::GetX(), and BOX2< Vec >::GetY().
|
inline |
Execute a function object aVisitor for each item whose bounding box intersects with aBounds.
Definition at line 86 of file view_rtree.h.
References BOX2< Vec >::GetBottom(), BOX2< Vec >::GetRight(), BOX2< Vec >::GetX(), BOX2< Vec >::GetY(), and BOX2< Vec >::SetMaximum().
Remove an item from the tree.
Removal is done by comparing pointers, attempting to remove a copy of the item will fail.
Definition at line 62 of file view_rtree.h.
References BOX2< Vec >::GetBottom(), BOX2< Vec >::GetRight(), BOX2< Vec >::GetX(), and BOX2< Vec >::GetY().