25#ifndef EESCHEMA_SCH_RTREE_H_ 
   26#define EESCHEMA_SCH_RTREE_H_ 
   33#include <geometry/rtree.h> 
   42    using ee_rtree = RTree<SCH_ITEM*, int, 3, double>;
 
   66        const int type    = int( aItem->
Type() );
 
   67        const int mmin[3] = { type, bbox.
GetX(), bbox.
GetY() };
 
   70        m_tree->Insert( mmin, mmax, aItem );
 
 
   87        const int type    = int( aItem->
Type() );
 
   88        const int mmin[3] = { type, bbox.
GetX(), bbox.
GetY() };
 
   93        if( 
m_tree->Remove( mmin, mmax, aItem ) )
 
   98            const int mmin2[3] = { INT_MIN, INT_MIN, INT_MIN };
 
   99            const int mmax2[3] = { INT_MAX, INT_MAX, INT_MAX };
 
  101            if( 
m_tree->Remove( mmin2, mmax2, aItem ) )
 
 
  135        const int type    = int( aItem->
Type() );
 
  136        const int mmin[3] = { type, bbox.
GetX(), bbox.
GetY() };
 
  141                [&found, &aItem]( 
const SCH_ITEM* aSearchItem )
 
  143                    if( aSearchItem == aItem )
 
  152        m_tree->Search( mmin, mmax, search );
 
  154        if( !found && aRobust )
 
  160            const int mmin2[3] = { type, INT_MIN, INT_MIN };
 
  161            const int mmax2[3] = { type, INT_MAX, INT_MAX };
 
  163            m_tree->Search( mmin2, mmax2, search );
 
 
  201                m_rect = { { INT_MIN, INT_MIN, INT_MIN }, { INT_MAX, INT_MAX, INT_MAX } };
 
  203                m_rect = { { type, INT_MIN, INT_MIN }, { type, INT_MAX, INT_MAX } };
 
 
 
 
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.
 
typename ee_rtree::Iterator iterator
 
RTree< SCH_ITEM *, int, 3, double > ee_rtree
 
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.
 
void insert(SCH_ITEM *aItem)
Insert an item into the tree.
 
const iterator end() const
 
bool contains(const SCH_ITEM *aItem, bool aRobust=false) const
Determine if a given item exists in the tree.
 
iterator end()
Return a read/write iterator that points to one past the last element in the EE_RTREE.
 
EE_TYPE Overlapping(const VECTOR2I &aPoint, int aAccuracy=0) const
 
iterator begin()
Return a read/write iterator that points to the first.
 
EE_TYPE Overlapping(KICAD_T aType, const VECTOR2I &aPoint, int aAccuracy=0) const
 
const iterator begin() const
 
EE_TYPE OfType(KICAD_T aType) const
 
void clear()
Remove all items from the RTree.
 
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_TYPE(ee_rtree *aTree, KICAD_T aType)
 
EE_TYPE(ee_rtree *aTree, KICAD_T aType, const BOX2I &aRect)
 
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