KiCad PCB EDA Suite
|
#include <shape_index.h>
Classes | |
class | Iterator |
Public Member Functions | |
SHAPE_INDEX () | |
~SHAPE_INDEX () | |
void | Add (T aShape) |
Add a SHAPE to the index. More... | |
void | Add (T aShape, const BOX2I &aBbox) |
Add a shape with alternate BBox. More... | |
void | Remove (T aShape) |
Remove a SHAPE from the index. More... | |
void | RemoveAll () |
Remove all the contents of the index. More... | |
template<class V > | |
void | Accept (V aVisitor) |
Accept a visitor for every SHAPE object contained in this INDEX. More... | |
void | Reindex () |
Rebuild the index. More... | |
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). More... | |
Iterator | Begin () |
Create an iterator for the current index object. More... | |
Private Attributes | |
RTree< T, int, 2, double > * | m_tree |
Definition at line 130 of file shape_index.h.
SHAPE_INDEX< T >::SHAPE_INDEX |
Definition at line 309 of file shape_index.h.
SHAPE_INDEX< T >::~SHAPE_INDEX |
Definition at line 315 of file shape_index.h.
Accept a visitor for every SHAPE object contained in this INDEX.
aVisitor | is the visitor object to be run. |
Definition at line 255 of file shape_index.h.
References acceptVisitor(), SHAPE_INDEX< T >::Begin(), and SHAPE_INDEX< T >::Iterator::IsNull().
void SHAPE_INDEX< T >::Add | ( | T | aShape | ) |
Add a SHAPE to the index.
aShape | is the new SHAPE. |
Definition at line 330 of file shape_index.h.
References boundingBox(), BOX2< Vec >::GetBottom(), BOX2< Vec >::GetRight(), BOX2< Vec >::GetX(), and BOX2< Vec >::GetY().
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 321 of file shape_index.h.
References BOX2< Vec >::GetBottom(), BOX2< Vec >::GetRight(), BOX2< Vec >::GetX(), and BOX2< Vec >::GetY().
SHAPE_INDEX< T >::Iterator SHAPE_INDEX< T >::Begin |
Create an iterator for the current index object.
Definition at line 378 of file shape_index.h.
Referenced by SHAPE_INDEX< T >::Accept().
|
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 282 of file shape_index.h.
References SHAPE::BBox(), BOX2< Vec >::GetBottom(), BOX2< Vec >::GetRight(), BOX2< Vec >::GetX(), BOX2< Vec >::GetY(), BOX2< Vec >::Inflate(), and SHAPE_INDEX< T >::m_tree.
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 356 of file shape_index.h.
References boundingBox(), BOX2< Vec >::GetBottom(), BOX2< Vec >::GetRight(), BOX2< Vec >::GetX(), BOX2< Vec >::GetY(), and SHAPE_INDEX< T >::Iterator::IsNull().
void SHAPE_INDEX< T >::Remove | ( | T | aShape | ) |
Remove a SHAPE from the index.
aShape | is the SHAPE to remove. |
Definition at line 340 of file shape_index.h.
References boundingBox(), BOX2< Vec >::GetBottom(), BOX2< Vec >::GetRight(), BOX2< Vec >::GetX(), and BOX2< Vec >::GetY().
void SHAPE_INDEX< T >::RemoveAll |
Remove all the contents of the index.
Definition at line 350 of file shape_index.h.
|
private |
Definition at line 301 of file shape_index.h.
Referenced by SHAPE_INDEX< T >::Iterator::Iterator(), and SHAPE_INDEX< T >::Query().