lpp (formerly dbLpp)
A lpp object forms a layer-purpose pair. It manages objects in a tree structure for fast spatial searching.
lpp::lpp(cellView *cv)
Constructs a lpp object with master cellView cv.
lpp::lpp(int32_t size, cellView *cv)
Constructs a lpp object with master cellView cv, with expected size of size.
lpp::layerName(const char *name)
Sets the layer name of the lpp.
const char * lpp::layerName()
Gets the lpp's layer name.
lpp::purpose(const char *name)
Sets the purpose name of the lpp.
const char * lpp::purpose()
Gets the lpp's purpose name.
lpp::layerNum(int16_t layerNum)
Sets the layer number of the lpp.
int16_t lpp::layerNum()
Gets the lpp's layer number.
int32_t lpp::numShapes()
Gets the number of shapes in this lpp.
cellView * lpp::cv()
Get the cellView for this lpp.
Rect lpp::bBox()
Get the bounding box of all shapes in this lpp.
lpp::bBox(Rect box)
Set the bounding box of the lpp.
lpp::optimiseTree()
Optimise the lpp. Must be carried out after adding objects.
lpp::updateTree(dbObj *obj)
Update the lpp for an object
int32_t size = lpp::size()
Gets the size (number of items) of the lpp
dbObjList<dbObj> * lpp::getOverlaps (Rect searchRect, int32_t filterSize=0)
Search the lpp for shapes overlapping the search rectangle searchRect. If filterSize is non-zero, only shapes with a width and height greater than filterSize are reported.Note this function creates a new list, and therefore it is better to use the following two functions:
list = lpp::getOverlaps_py (Rect searchRect, int32_t filterSize=0)
As above, but returns a Python list.
lpp::getOverlaps (dbObjList<dbObj> *list, Rect searchRect, int32_t filterSize=0)
As getOverlaps, but shapes are appended to the existing list.
Iterator
An iterator to allow traversing the objects in the lpp using Python.
iter objIterator(lpp *lp)
Initialises the dbObj iterator iter for the lpp lp. For example:
iter = objIterator(lpp)
while not iter.end() :
obj = iter.value()
type = obj.objType()
print("object type = ", type)
iter.next()
dbObj * iter.value()
Returns the current iterator value.
iter.next()
Advances the iterator to the next dbObj.
<bool iter.end()
Returns false if there are more objects, else returns true if there are no more.