25#ifndef EESCHEMA_SCH_RTREE_H_
26#define EESCHEMA_SCH_RTREE_H_
56 const int type = int( aItem->
Type() );
57 const int mmin[3] = { type, bbox.
GetX(), bbox.
GetY() };
60 m_tree.Insert( mmin, mmax, aItem );
76 const int type = int( aItem->
Type() );
77 const int mmin[3] = { type, bbox.
GetX(), bbox.
GetY() };
82 if( !
m_tree.Remove( mmin, mmax, aItem ) )
115 const int type = int( aItem->
Type() );
116 const int mmin[3] = { type, bbox.
GetX(), bbox.
GetY() };
121 [&found, &aItem](
const SCH_ITEM* aSearchItem )
123 if( aSearchItem == aItem )
132 m_tree.Search( mmin, mmax, search );
134 if( !found && aRobust )
140 const int mmin2[3] = { type, INT_MIN, INT_MIN };
141 const int mmax2[3] = { type, INT_MAX, INT_MAX };
143 m_tree.Search( mmin2, mmax2, search );
265 typename ee_rtree::Iterator
begin()
const
273 typename ee_rtree::Iterator
end()
const
constexpr BOX2< Vec > & Inflate(coord_type dx, coord_type dy)
Inflates the rectangle horizontally by dx and vertically by dy.
constexpr coord_type GetY() const
constexpr coord_type GetX() const
constexpr coord_type GetRight() const
constexpr coord_type GetBottom() const
virtual const BOX2I GetBoundingBox() const
Return the orthogonal bounding box of this object for display purposes.
KICAD_T Type() const
Returns the type of object.
EE_TYPE Overlapping(KICAD_T aType, const BOX2I &aRect) const
size_t size() const
Return the number of items in the tree.
EE_TYPE Overlapping(const BOX2I &aRect) const
bool remove(SCH_ITEM *aItem)
Remove an item from the tree.
ee_rtree::Iterator begin() const
Return a read/write iterator that points to the first.
void insert(SCH_ITEM *aItem)
Insert an item into the tree.
bool contains(const SCH_ITEM *aItem, bool aRobust=false) const
Determine if a given item exists in the tree.
KIRTREE::DYNAMIC_RTREE< SCH_ITEM *, int, 3 > ee_rtree
EE_TYPE Overlapping(const VECTOR2I &aPoint, int aAccuracy=0) const
ee_rtree::Iterator end() const
Return a read/write iterator that points to one past the last element in the EE_RTREE.
EE_TYPE Overlapping(KICAD_T aType, const VECTOR2I &aPoint, int aAccuracy=0) const
EE_TYPE OfType(KICAD_T aType) const
void clear()
Remove all items from the RTree.
Dynamic R*-tree with SoA node layout and stored insertion bounding boxes.
SearchRange Overlapping(const ELEMTYPE aMin[NUMDIMS], const ELEMTYPE aMax[NUMDIMS]) const
Return a lazy range of items overlapping the query rectangle.
Base class for any item which can be embedded within the SCHEMATIC container class,...
virtual int GetPenWidth() const
The EE_TYPE struct provides a type-specific auto-range iterator to the RTree.
ee_rtree::SearchRange m_range
EE_TYPE(const ee_rtree &aTree, KICAD_T aType, const BOX2I &aRect)
typename ee_rtree::SearchIterator SearchIter
EE_TYPE(const ee_rtree &aTree, KICAD_T aType)
constexpr KICAD_T BaseType(const KICAD_T aType)
Return the underlying type of the given type.
KICAD_T
The set of class identification values stored in EDA_ITEM::m_structType.
VECTOR2< int32_t > VECTOR2I