|
Horizon
|
#include <pns_index.h>
Public Types | |
| typedef std::list< ITEM * > | NET_ITEMS_LIST |
| typedef SHAPE_INDEX< ITEM * > | ITEM_SHAPE_INDEX |
| typedef std::unordered_set< ITEM * > | ITEM_SET |
Public Member Functions | |
| void | Add (ITEM *aItem) |
| Adds item to the spatial index. | |
| void | Remove (ITEM *aItem) |
| Removes an item from the spatial index. | |
| void | Replace (ITEM *aOldItem, ITEM *aNewItem) |
| Replaces one item with another. | |
| template<class Visitor > | |
| int | Query (const ITEM *aItem, int aMinDistance, Visitor &aVisitor) const |
| Searches items in the index that are in proximity of aItem. More... | |
| template<class Visitor > | |
| int | Query (const SHAPE *aShape, int aMinDistance, Visitor &aVisitor) const |
| Searches items in the index that are in proximity of aShape. More... | |
| NET_ITEMS_LIST * | GetItemsForNet (int aNet) |
| Returns list of all items in a given net. | |
| bool | Contains (ITEM *aItem) const |
| Function Contains() More... | |
| int | Size () const |
| Returns number of items stored in the index. | |
| ITEM_SET::iterator | begin () |
| ITEM_SET::iterator | end () |
Custom spatial index, holding our board items and allowing for very fast searches. Items are assigned to separate R-Tree subindices depending on their type and spanned layers, reducing overlap and improving search time.
|
inline |
Function Contains()
Returns true if item aItem exists in the index.
| int PNS::INDEX::Query | ( | const ITEM * | aItem, |
| int | aMinDistance, | ||
| Visitor & | aVisitor | ||
| ) | const |
Searches items in the index that are in proximity of aItem.
For each item, function object aVisitor is called. Only items on overlapping layers are considered.
| aItem | item to search against |
| aMinDistance | proximity distance (wrs to the item's shape) |
| aVisitor | function object called on each found item. Return false from the visitor to stop searching. |
| int PNS::INDEX::Query | ( | const SHAPE * | aShape, |
| int | aMinDistance, | ||
| Visitor & | aVisitor | ||
| ) | const |
Searches items in the index that are in proximity of aShape.
For each item, function object aVisitor is called. Treats all layers as colliding.
| aShape | shape to search against |
| aMinDistance | proximity distance (wrs to the item's shape) |
| aVisitor | function object called on each found item. Return false from the visitor to stop searching. |