|
KiCad PCB EDA Suite
|
Static (immutable) packed R-tree built via Hilbert-curve bulk loading. More...
#include <packed_rtree.h>
Classes | |
| class | Builder |
| Builder for constructing a PACKED_RTREE from a set of items. More... | |
| class | Iterator |
| Iterator for sequential access to all stored data items. More... | |
Public Member Functions | |
| PACKED_RTREE ()=default | |
| PACKED_RTREE (PACKED_RTREE &&aOther) noexcept | |
| PACKED_RTREE & | operator= (PACKED_RTREE &&aOther) noexcept |
| PACKED_RTREE (const PACKED_RTREE &)=delete | |
| PACKED_RTREE & | operator= (const PACKED_RTREE &)=delete |
| template<class VISITOR> | |
| int | Search (const ELEMTYPE aMin[NUMDIMS], const ELEMTYPE aMax[NUMDIMS], VISITOR &aVisitor) const |
| Search for all items whose bounding boxes overlap the query rectangle. | |
| Iterator | begin () const |
| Iterator | end () const |
| size_t | size () const |
| bool | empty () const |
| size_t | MemoryUsage () const |
| Return approximate memory usage in bytes. | |
Private Member Functions | |
| template<class VISITOR> | |
| bool | searchNode (int aLevel, size_t aNodeIdx, const ELEMTYPE aMin[NUMDIMS], const ELEMTYPE aMax[NUMDIMS], VISITOR &aVisitor, int &aFound) const |
| bool | childOverlaps (size_t aNodeIdx, int aSlot, const ELEMTYPE aMin[NUMDIMS], const ELEMTYPE aMax[NUMDIMS]) const |
Private Attributes | |
| std::vector< ELEMTYPE > | m_bounds [NUMDIMS *2] |
| std::vector< int > | m_counts |
| std::vector< DATATYPE > | m_data |
| std::vector< size_t > | m_levelOffsets |
| size_t | m_size = 0 |
Static (immutable) packed R-tree built via Hilbert-curve bulk loading.
Provides optimal query performance for build-once-query-many workloads such as DRC spatial indexing. The tree is constructed in O(N log N) time via Hilbert curve sorting and stored in a single contiguous buffer with bottom-up level ordering.
Node bounding boxes use Structure-of-Arrays layout with fanout=FANOUT for cache-efficient scanning during queries.
Thread-safe for concurrent reads after construction.
| DATATYPE | Type of data stored (e.g. pointer to item) |
| ELEMTYPE | Coordinate element type (typically int) |
| NUMDIMS | Number of dimensions (2 or 3) |
| FANOUT | Maximum children per node (default 16 for SIMD alignment) |
Definition at line 61 of file packed_rtree.h.
|
default |
|
inlinenoexcept |
Definition at line 67 of file packed_rtree.h.
|
delete |
|
inline |
Definition at line 149 of file packed_rtree.h.
Referenced by BOOST_AUTO_TEST_CASE().
|
inlineprivate |
Definition at line 513 of file packed_rtree.h.
Referenced by KIRTREE::PACKED_RTREE< CREEPAGE_TRACK_ENTRY *, int, 2 >::searchNode().
|
inline |
Definition at line 153 of file packed_rtree.h.
Referenced by BOOST_AUTO_TEST_CASE().
|
inline |
Definition at line 150 of file packed_rtree.h.
Referenced by BOOST_AUTO_TEST_CASE().
|
inline |
Return approximate memory usage in bytes.
Definition at line 158 of file packed_rtree.h.
Referenced by BOOST_AUTO_TEST_CASE().
|
delete |
|
inlinenoexcept |
Definition at line 77 of file packed_rtree.h.
|
inline |
Search for all items whose bounding boxes overlap the query rectangle.
| aMin | Minimum corner of query rectangle |
| aMax | Maximum corner of query rectangle |
| aVisitor | Callback invoked for each matching item. Return false to stop early. |
Definition at line 106 of file packed_rtree.h.
Referenced by BOOST_AUTO_TEST_CASE(), BOOST_AUTO_TEST_CASE(), BOOST_AUTO_TEST_CASE(), BOOST_AUTO_TEST_CASE(), and DRC_RTREE::DRC_LAYER::DRC_LAYER().
|
inlineprivate |
Definition at line 410 of file packed_rtree.h.
Referenced by KIRTREE::PACKED_RTREE< CREEPAGE_TRACK_ENTRY *, int, 2 >::Search(), and KIRTREE::PACKED_RTREE< CREEPAGE_TRACK_ENTRY *, int, 2 >::searchNode().
|
inline |
Definition at line 152 of file packed_rtree.h.
Referenced by BOOST_AUTO_TEST_CASE(), and BOOST_AUTO_TEST_CASE().
|
private |
Definition at line 528 of file packed_rtree.h.
Referenced by KIRTREE::PACKED_RTREE< DATATYPE, ELEMTYPE, NUMDIMS, FANOUT >::Builder::Build().
|
private |
Definition at line 531 of file packed_rtree.h.
Referenced by KIRTREE::PACKED_RTREE< DATATYPE, ELEMTYPE, NUMDIMS, FANOUT >::Builder::Build().
|
private |
Definition at line 534 of file packed_rtree.h.
Referenced by KIRTREE::PACKED_RTREE< DATATYPE, ELEMTYPE, NUMDIMS, FANOUT >::Builder::Build().
|
private |
Definition at line 537 of file packed_rtree.h.
Referenced by KIRTREE::PACKED_RTREE< DATATYPE, ELEMTYPE, NUMDIMS, FANOUT >::Builder::Build().
|
private |
Definition at line 540 of file packed_rtree.h.
Referenced by KIRTREE::PACKED_RTREE< DATATYPE, ELEMTYPE, NUMDIMS, FANOUT >::Builder::Build().