|
KiCad PCB EDA Suite
|
#include <shape_index.h>
Classes | |
| class | Iterator |
Public Types | |
| using | TREE_TYPE = KIRTREE::COW_RTREE<T, int, 2> |
Public Member Functions | |
| SHAPE_INDEX (int aLayer) | |
| ~SHAPE_INDEX ()=default | |
| SHAPE_INDEX (SHAPE_INDEX &&aOther) noexcept=default | |
| SHAPE_INDEX & | operator= (SHAPE_INDEX &&aOther) noexcept=default |
| SHAPE_INDEX (const SHAPE_INDEX &)=delete | |
| SHAPE_INDEX & | operator= (const SHAPE_INDEX &)=delete |
| SHAPE_INDEX | Clone () const |
| Create a CoW clone that shares tree structure with this index. | |
| void | Add (T aShape) |
| Add a SHAPE to the index. | |
| void | Add (T aShape, const BOX2I &aBbox) |
| Add a shape with alternate BBox. | |
| void | Remove (T aShape) |
| Remove a SHAPE from the index. | |
| void | RemoveAll () |
| Remove all the contents of the index. | |
| template<class V> | |
| void | Accept (V aVisitor) |
| Accept a visitor for every SHAPE object contained in this INDEX. | |
| void | BulkLoad (std::vector< std::pair< T, BOX2I > > &aItems) |
| Build from a batch of items using Hilbert-curve bulk loading. | |
| void | Reindex () |
| Rebuild the index. | |
| template<class V> | |
| int | Query (const SHAPE *aShape, int aMinDistance, V &aVisitor) const |
| Run a callback on every SHAPE object contained in the bounding box of (shape). | |
| Iterator | Begin () const |
| Create an iterator for the current index object. | |
| TREE_TYPE::Iterator | begin () const |
| TREE_TYPE::Iterator | end () const |
| size_t | Size () const |
Private Attributes | |
| TREE_TYPE | m_tree |
| int | m_shapeLayer |
Definition at line 113 of file shape_index.h.
| using SHAPE_INDEX< T >::TREE_TYPE = KIRTREE::COW_RTREE<T, int, 2> |
Definition at line 116 of file shape_index.h.
|
inlineexplicit |
Definition at line 189 of file shape_index.h.
|
default |
|
defaultnoexcept |
|
delete |
Accept a visitor for every SHAPE object contained in this INDEX.
| aVisitor | is the visitor object to be run. |
Definition at line 268 of file shape_index.h.
|
inline |
Add a SHAPE to the index.
| aShape | is the new SHAPE. |
Definition at line 217 of file shape_index.h.
Referenced by SHAPE_INDEX< ITEM * >::Reindex().
|
inline |
Add a shape with alternate BBox.
| aShape | Shape (Item) to add. |
| aBbox | alternate bounding box. This should be a subset of the item's bbox |
Definition at line 232 of file shape_index.h.
|
inline |
Create an iterator for the current index object.
Definition at line 341 of file shape_index.h.
|
inline |
Definition at line 347 of file shape_index.h.
Referenced by SHAPE_INDEX< T >::Iterator::Iterator().
|
inline |
Build from a batch of items using Hilbert-curve bulk loading.
Replaces all existing content. O(n log n).
Definition at line 278 of file shape_index.h.
|
inline |
Create a CoW clone that shares tree structure with this index.
O(1) – only increments the root node's refcount.
Definition at line 205 of file shape_index.h.
|
inline |
Definition at line 348 of file shape_index.h.
Referenced by SHAPE_INDEX< T >::Iterator::Iterator().
|
delete |
|
defaultnoexcept |
|
inline |
Run a callback on every SHAPE object contained in the bounding box of (shape).
| aShape | is the shape to search against. |
| aMinDistance | is the distance threshold. |
| aVisitor | is the object to be invoked on every object contained in the search area. |
Definition at line 325 of file shape_index.h.
|
inline |
Rebuild the index.
This should be used if the geometry of the objects contained by the index has changed.
Definition at line 303 of file shape_index.h.
|
inline |
Remove a SHAPE from the index.
| aShape | is the SHAPE to remove. |
Definition at line 245 of file shape_index.h.
|
inline |
Remove all the contents of the index.
Definition at line 257 of file shape_index.h.
|
inline |
Definition at line 350 of file shape_index.h.
|
private |
Definition at line 354 of file shape_index.h.
|
private |
Definition at line 353 of file shape_index.h.
Referenced by SHAPE_INDEX< ITEM * >::Clone().