KiCad PCB EDA Suite
Loading...
Searching...
No Matches
CN_RTREE< T > Class Template Reference

CN_RTREE - Implements an R-tree for fast spatial indexing of connectivity items. More...

#include <connectivity_rtree.h>

Public Member Functions

 CN_RTREE ()=default
 
 ~CN_RTREE ()=default
 
 CN_RTREE (CN_RTREE &&aOther) noexcept=default
 
CN_RTREEoperator= (CN_RTREE &&aOther) noexcept=default
 
 CN_RTREE (const CN_RTREE &)=delete
 
CN_RTREEoperator= (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.
 
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

KIRTREE::DYNAMIC_RTREE< T, int, 3 > m_tree
 

Detailed Description

template<class T>
class CN_RTREE< T >

CN_RTREE - Implements an R-tree for fast spatial indexing of connectivity items.

Non-owning.

Definition at line 40 of file connectivity_rtree.h.

Constructor & Destructor Documentation

◆ CN_RTREE() [1/3]

template<class T>
CN_RTREE< T >::CN_RTREE ( )
default

◆ ~CN_RTREE()

template<class T>
CN_RTREE< T >::~CN_RTREE ( )
default

◆ CN_RTREE() [2/3]

template<class T>
CN_RTREE< T >::CN_RTREE ( CN_RTREE< T > && aOther)
defaultnoexcept

References CN_RTREE().

◆ CN_RTREE() [3/3]

template<class T>
CN_RTREE< T >::CN_RTREE ( const CN_RTREE< T > & )
delete

References CN_RTREE().

Member Function Documentation

◆ Insert()

template<class T>
void CN_RTREE< T >::Insert ( T aItem)
inline

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.

◆ operator=() [1/2]

template<class T>
CN_RTREE & CN_RTREE< T >::operator= ( CN_RTREE< T > && aOther)
defaultnoexcept

References CN_RTREE().

◆ operator=() [2/2]

template<class T>
CN_RTREE & CN_RTREE< T >::operator= ( const CN_RTREE< T > & )
delete

References CN_RTREE().

◆ Query()

template<class T>
template<class Visitor>
void CN_RTREE< T >::Query ( const BOX2I & aBounds,
int aStartLayer,
int aEndLayer,
Visitor & aVisitor ) const
inline

Function Query() Executes a function object aVisitor for each item whose bounding box intersects with aBounds.

Definition at line 99 of file connectivity_rtree.h.

References B_Cu, BOX2< Vec >::GetBottom(), BOX2< Vec >::GetRight(), BOX2< Vec >::GetX(), BOX2< Vec >::GetY(), and m_tree.

◆ Remove()

template<class T>
void CN_RTREE< T >::Remove ( T aItem)
inline

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.

◆ RemoveAll()

template<class T>
void CN_RTREE< T >::RemoveAll ( )
inline

Function RemoveAll() Removes all items from the RTree.

Definition at line 88 of file connectivity_rtree.h.

References m_tree.

Member Data Documentation

◆ m_tree

template<class T>
KIRTREE::DYNAMIC_RTREE<T, int, 3> CN_RTREE< T >::m_tree
private

Definition at line 111 of file connectivity_rtree.h.

Referenced by Insert(), Query(), Remove(), and RemoveAll().


The documentation for this class was generated from the following file: