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.
SHAPE_INDEX< T >::~SHAPE_INDEX |
Definition at line 300 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 238 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 315 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 306 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 363 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 265 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 341 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 325 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 335 of file shape_index.h.
|
private |
Definition at line 285 of file shape_index.h.
|
private |
Definition at line 284 of file shape_index.h.
Referenced by SHAPE_INDEX< T >::Iterator::Iterator(), and SHAPE_INDEX< T >::Query().