|
KiCad PCB EDA Suite
|
CN_RTREE - Implements an R-tree for fast spatial indexing of connectivity items. More...
#include <connectivity_rtree.h>
Public Types | |
| using | TREE = KIRTREE::DYNAMIC_RTREE<T, int, 3> |
| Entry type accepted by BulkLoad(). | |
| using | BULK_ENTRY = typename TREE::BULK_ENTRY |
Public Member Functions | |
| CN_RTREE ()=default | |
| ~CN_RTREE ()=default | |
| CN_RTREE (CN_RTREE &&aOther) noexcept=default | |
| CN_RTREE & | operator= (CN_RTREE &&aOther) noexcept=default |
| CN_RTREE (const CN_RTREE &)=delete | |
| CN_RTREE & | operator= (const CN_RTREE &)=delete |
| void | Insert (T aItem) |
| Function Insert() Inserts an item into the tree. | |
| void | Remove (T aItem) |
| Function Remove() Removes an item from the tree. | |
| void | RemoveAll () |
| Function RemoveAll() Removes all items from the RTree. | |
| void | BulkLoad (std::vector< BULK_ENTRY > &aEntries) |
| Function BulkLoad() Replaces the tree contents with aEntries, packed bottom-up. | |
| template<class Visitor> | |
| void | Query (const BOX2I &aBounds, int aStartLayer, int aEndLayer, Visitor &aVisitor) const |
| Function Query() Executes a function object aVisitor for each item whose bounding box intersects with aBounds. | |
Private Attributes | |
| TREE | m_tree |
CN_RTREE - Implements an R-tree for fast spatial indexing of connectivity items.
Non-owning.
Definition at line 36 of file connectivity_rtree.h.
Definition at line 42 of file connectivity_rtree.h.
| using CN_RTREE< T >::TREE = KIRTREE::DYNAMIC_RTREE<T, int, 3> |
Entry type accepted by BulkLoad().
Definition at line 39 of file connectivity_rtree.h.
|
default |
Referenced by CN_RTREE(), CN_RTREE(), operator=(), and operator=().
References CN_RTREE().
References CN_RTREE().
|
inline |
Function BulkLoad() Replaces the tree contents with aEntries, packed bottom-up.
Much cheaper than the same number of Insert() calls, which each pay for an R*-tree subtree choice and may cascade into forced reinsertion.
Definition at line 99 of file connectivity_rtree.h.
References m_tree.
Function Insert() Inserts an item into the tree.
Item's bounding box is taken via its BBox() method.
Definition at line 57 of file connectivity_rtree.h.
References BOX2< Vec >::GetBottom(), BOX2< Vec >::GetRight(), BOX2< Vec >::GetX(), BOX2< Vec >::GetY(), m_tree, and T.
References CN_RTREE().
References CN_RTREE().
|
inline |
Function Query() Executes a function object aVisitor for each item whose bounding box intersects with aBounds.
Definition at line 110 of file connectivity_rtree.h.
References BOX2< Vec >::GetBottom(), BOX2< Vec >::GetRight(), BOX2< Vec >::GetX(), BOX2< Vec >::GetY(), and m_tree.
Function Remove() Removes an item from the tree.
Removal is done by comparing pointers, attempting to remove a copy of the item will fail.
Definition at line 72 of file connectivity_rtree.h.
References BOX2< Vec >::GetBottom(), BOX2< Vec >::GetRight(), BOX2< Vec >::GetX(), BOX2< Vec >::GetY(), m_tree, and T.
Function RemoveAll() Removes all items from the RTree.
Definition at line 88 of file connectivity_rtree.h.
References m_tree.
Definition at line 120 of file connectivity_rtree.h.
Referenced by BulkLoad(), Insert(), Query(), Remove(), and RemoveAll().