KiCad PCB EDA Suite
Loading...
Searching...
No Matches
KIGFX::VIEW_RTREE Class Reference

Implement an non-owning R-tree for fast spatial indexing of VIEW items. More...

#include <view_rtree.h>

Inheritance diagram for KIGFX::VIEW_RTREE:

Public Member Functions

void Insert (VIEW_ITEM *aItem, const BOX2I &bbox)
 Insert an item into the tree.
 
void Remove (VIEW_ITEM *aItem, const BOX2I *aBbox)
 Remove an item from the tree.
 
template<class Visitor >
void Query (const BOX2I &aBounds, Visitor &aVisitor) const
 Execute a function object aVisitor for each item whose bounding box intersects with aBounds.
 

Detailed Description

Implement an non-owning R-tree for fast spatial indexing of VIEW items.

Definition at line 41 of file view_rtree.h.

Member Function Documentation

◆ Insert()

void KIGFX::VIEW_RTREE::Insert ( VIEW_ITEM aItem,
const BOX2I bbox 
)
inline

Insert an item into the tree.

Item's bounding box is taken via its ViewBBox() method.

Definition at line 49 of file view_rtree.h.

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

◆ Query()

template<class Visitor >
void KIGFX::VIEW_RTREE::Query ( const BOX2I aBounds,
Visitor &  aVisitor 
) const
inline

Execute a function object aVisitor for each item whose bounding box intersects with aBounds.

Definition at line 86 of file view_rtree.h.

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

◆ Remove()

void KIGFX::VIEW_RTREE::Remove ( VIEW_ITEM aItem,
const BOX2I aBbox 
)
inline

Remove an item from the tree.

Removal is done by comparing pointers, attempting to remove a copy of the item will fail.

Definition at line 62 of file view_rtree.h.

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


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