|
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) |
| Function Add() More... | |
| void | Remove (ITEM *aItem) |
| Function Remove() More... | |
| void | Replace (ITEM *aOldItem, ITEM *aNewItem) |
| Function Add() More... | |
| template<class Visitor > | |
| int | Query (const ITEM *aItem, int aMinDistance, Visitor &aVisitor) |
| Function Query() More... | |
| template<class Visitor > | |
| int | Query (const SHAPE *aShape, int aMinDistance, Visitor &aVisitor) |
| Function Query() More... | |
| void | Clear () |
| Function Clear() More... | |
| NET_ITEMS_LIST * | GetItemsForNet (int aNet) |
| Function GetItemsForNet() More... | |
| bool | Contains (ITEM *aItem) const |
| Function Contains() More... | |
| int | Size () const |
| Function Size() More... | |
| ITEM_SET::iterator | begin () |
| ITEM_SET::iterator | end () |
Class INDEX.
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.
| void PNS::INDEX::Clear | ( | ) |
Function Clear()
Removes all items from the index.
|
inline |
Function Contains()
Returns true if item aItem exists in the index.
| INDEX::NET_ITEMS_LIST * PNS::INDEX::GetItemsForNet | ( | int | aNet | ) |
Function GetItemsForNet()
Returns list of all items in a given net.
| int PNS::INDEX::Query | ( | const ITEM * | aItem, |
| int | aMinDistance, | ||
| Visitor & | aVisitor | ||
| ) |
Function Query()
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 | ||
| ) |
Function Query()
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. |
Function Add()
Replaces one item with another.
|
inline |
Function Size()
Returns number of items stored in the index.