24#ifndef PCBNEW_CONNECTIVITY_RTREE_H_
25#define PCBNEW_CONNECTIVITY_RTREE_H_
30#include <geometry/rtree.h>
45 this->
m_tree =
new RTree<T, int, 3, double>();
59 const BOX2I& bbox = aItem->BBox();
62 const int mmin[3] = { layers.
Start(), bbox.
GetX(), bbox.
GetY() };
65 m_tree->Insert( mmin, mmax, aItem );
77 const BOX2I& bbox = aItem->BBox();
79 const int mmin[3] = { layers.
Start(), bbox.
GetX(), bbox.
GetY() };
84 if(
m_tree->Remove( mmin, mmax, aItem ) )
89 const int mmin2[3] = { INT_MIN, INT_MIN, INT_MIN };
90 const int mmax2[3] = { INT_MAX, INT_MAX, INT_MAX };
91 m_tree->Remove( mmin2, mmax2, aItem );
109 template <
class Visitor>
112 const int mmin[3] = { aRange.
Start(), aBounds.
GetX(), aBounds.
GetY() };
115 m_tree->Search( mmin, mmax, aVisitor );
coord_type GetRight() const
coord_type GetBottom() const
CN_RTREE - Implements an R-tree for fast spatial indexing of connectivity items.
void Insert(T aItem)
Function Insert() Inserts an item into the tree.
void Query(const BOX2I &aBounds, const LAYER_RANGE &aRange, Visitor &aVisitor) const
Function Query() Executes a function object aVisitor for each item whose bounding box intersects with...
void RemoveAll()
Function RemoveAll() Removes all items from the RTree.
void Remove(T aItem)
Function Remove() Removes an item from the tree.
RTree< T, int, 3, double > * m_tree
Represent a contiguous set of PCB layers.