Glade Reference
The dbObj class is the base class of Glade database objects (it is derived from a lower level memory allocation class which caches objects, but the user need not be concerned about that). A dbObj is never created directly. Most access to dbObjs is at the derived class level.
Get the type of the object.
Get the print name of the object, e.g. "POLYGON".
Returns True if the object is an inst or an array.
Returns True if the object is a shape.
Returns True if the object is a viaInst.
Retuens True is the object is a segment of some shape.
Returns True if the object is a vertex of some shape.
Add a property to a dbObject of the given type. If the property given by propName already exists, its value is updated to propVal .
Replace an existing property with one with a new value of a given type.
Get a property of a specified type by name.
Delete a property by name.
Casting a dbObj to a derived class
In Python, there is no means of casting a base class to a derived class. So for example if you use the cellView::dbGetOverlaps() function to get a list of objects, these are returned as dbObj class. So to facilitate conversion, there are a set of global functions that convert a dbObj to a derived class e.g. rectangle.
arc *toArc()
array *toArray()
cell *toCell()
cellView *toCellView()
ellipse *toEllipse()
HSeg *toHSeg()
inst *toInst()
label *toLabel()
line *toLine()
path *toPath()
polygon *toPolygon()
rectangle *toRectangle()
segment *toSegment()
shape *toShape()
square *toSquare()
view *toView()
vertex *toVertex()
viaInst *toViaInst()
VSeg *toVSeg()
Getting bounding box coords
Note that these will only work to get the bounding box coordinates of shapes or instances.
int x = r.left();
int y = r.bottom();
int x = r.right();
int y = r.top();
Gets the specified bounding box coordinate.
Copyright © Peardrop Design 2016.