24#ifndef PCBNEW_CONNECTIVITY_RTREE_H_
25#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 );
98 template <
class Visitor>
99 void Query(
const BOX2I& aBounds,
int aStartLayer,
int aEndLayer, Visitor& aVisitor )
const
101 int start_layer = aStartLayer ==
B_Cu ? INT_MAX : aStartLayer;
102 int end_layer = aEndLayer ==
B_Cu ? INT_MAX : aEndLayer;
104 const int mmin[3] = { start_layer, aBounds.
GetX(), aBounds.
GetY() };
107 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
KIRTREE::DYNAMIC_RTREE< T, int, 3 > m_tree
void RemoveAll()
Function RemoveAll() Removes all items from the RTree.
void Remove(T aItem)
Function Remove() Removes an item from the tree.
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.