20#ifndef PCBNEW_CONNECTIVITY_RTREE_H_
21#define PCBNEW_CONNECTIVITY_RTREE_H_
59 const BOX2I& bbox = aItem->BBox();
61 const int mmin[3] = { aItem->StartLayer(), bbox.
GetX(), bbox.
GetY() };
64 m_tree.Insert( mmin, mmax, aItem );
74 const BOX2I& bbox = aItem->BBox();
76 const int mmin[3] = { aItem->StartLayer(), bbox.
GetX(), bbox.
GetY() };
81 m_tree.Remove( mmin, mmax, aItem );
99 void BulkLoad( std::vector<BULK_ENTRY>& aEntries )
101 m_tree.BulkLoad( aEntries );
109 template <
class Visitor>
110 void Query(
const BOX2I& aBounds,
int aStartLayer,
int aEndLayer, Visitor& aVisitor )
const
113 const int mmin[3] = { aStartLayer, aBounds.
GetX(), aBounds.
GetY() };
116 m_tree.Search( mmin, mmax, aVisitor );
constexpr coord_type GetY() const
constexpr coord_type GetX() const
constexpr coord_type GetRight() const
constexpr coord_type GetBottom() const
void Insert(T aItem)
Function Insert() Inserts an item into the tree.
CN_RTREE(CN_RTREE &&aOther) noexcept=default
CN_RTREE & operator=(const CN_RTREE &)=delete
CN_RTREE & operator=(CN_RTREE &&aOther) noexcept=default
typename TREE::BULK_ENTRY BULK_ENTRY
void RemoveAll()
Function RemoveAll() Removes all items from the RTree.
void Remove(T aItem)
Function Remove() Removes an item from the tree.
KIRTREE::DYNAMIC_RTREE< T, int, 3 > TREE
Entry type accepted by BulkLoad().
void BulkLoad(std::vector< BULK_ENTRY > &aEntries)
Function BulkLoad() Replaces the tree contents with aEntries, packed bottom-up.
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...
CN_RTREE(const CN_RTREE &)=delete
Dynamic R*-tree with SoA node layout and stored insertion bounding boxes.