|
KiCad PCB EDA Suite
|
#include <shape_index.h>
Classes | |
| class | Iterator |
Public Member Functions | |
| SHAPE_INDEX (int aLayer) | |
| ~SHAPE_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 | 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 () |
| Create an iterator for the current index object. | |
Private Attributes | |
| RTree< T, int, 2, double > * | m_tree |
| int | m_shapeLayer |
Definition at line 113 of file shape_index.h.
|
explicit |
Definition at line 293 of file shape_index.h.
References m_shapeLayer, and m_tree.
Referenced by SHAPE_INDEX< T >::Iterator::Iterator().
| SHAPE_INDEX< T >::~SHAPE_INDEX | ( | ) |
Definition at line 300 of file shape_index.h.
References m_tree.
Accept a visitor for every SHAPE object contained in this INDEX.
| aVisitor | is the visitor object to be run. |
Definition at line 238 of file shape_index.h.
| void SHAPE_INDEX< T >::Add | ( | T | aShape | ) |
Add a SHAPE to the index.
| aShape | is the new SHAPE. |
Definition at line 315 of file shape_index.h.
References boundingBox(), BOX2< Vec >::GetBottom(), BOX2< Vec >::GetRight(), BOX2< Vec >::GetX(), BOX2< Vec >::GetY(), m_shapeLayer, m_tree, and T.
| void SHAPE_INDEX< T >::Add | ( | T | aShape, |
| const BOX2I & | aBbox ) |
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 306 of file shape_index.h.
References BOX2< Vec >::GetBottom(), BOX2< Vec >::GetRight(), BOX2< Vec >::GetX(), BOX2< Vec >::GetY(), m_tree, and T.
| SHAPE_INDEX< T >::Iterator SHAPE_INDEX< T >::Begin | ( | ) |
Create an iterator for the current index object.
Definition at line 363 of file shape_index.h.
Referenced by SHAPE_INDEX< ITEM * >::Accept(), and Reindex().
|
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 265 of file shape_index.h.
| void SHAPE_INDEX< T >::Reindex | ( | ) |
Rebuild the index.
This should be used if the geometry of the objects contained by the index has changed.
Definition at line 341 of file shape_index.h.
References Begin(), boundingBox(), BOX2< Vec >::GetBottom(), BOX2< Vec >::GetRight(), BOX2< Vec >::GetX(), BOX2< Vec >::GetY(), SHAPE_INDEX< T >::Iterator::IsNull(), m_shapeLayer, m_tree, and T.
| void SHAPE_INDEX< T >::Remove | ( | T | aShape | ) |
Remove a SHAPE from the index.
| aShape | is the SHAPE to remove. |
Definition at line 325 of file shape_index.h.
References boundingBox(), BOX2< Vec >::GetBottom(), BOX2< Vec >::GetRight(), BOX2< Vec >::GetX(), BOX2< Vec >::GetY(), m_shapeLayer, m_tree, and T.
| void SHAPE_INDEX< T >::RemoveAll | ( | ) |
Remove all the contents of the index.
Definition at line 335 of file shape_index.h.
References m_tree.
|
private |
Definition at line 285 of file shape_index.h.
Referenced by Add(), Reindex(), Remove(), and SHAPE_INDEX().
|
private |
Definition at line 284 of file shape_index.h.
Referenced by Add(), Add(), SHAPE_INDEX< T >::Iterator::Iterator(), Reindex(), Remove(), RemoveAll(), SHAPE_INDEX(), and ~SHAPE_INDEX().