Glade Reference


dbObj class

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.

 

db_Type dbObj::objType()

Get the type of the object.

 

const char * dbObj::objName()

Get the print name of the object, e.g. "POLYGON".

 

bool .dbObj::isInst()

Returns true if the object is an inst or an array.

 

bool dbObj::isShape()

Returns true if the object is a shape.

 

bool dbObj::isViaInst()

Returns true if the object is a viaInst.

 

bool dbObj::isSeg()

Returns true if the object is a segment of some shape.

 

bool val = obj.isVertex()

Returns true if the object is a vertex of some shape.

 

dbObj::setGroup(group *grp)

Sets the object's group

 

group * dbObj::group()

If the object is a member of a group, this returns the group, else returns null.

 

dbObj::dbAddProp(const char *propName, const char *propVal)

dbObj::dbAddProp(const char *propName, int propVal)

dbObj::dbAddProp(const char *propName, double propVal)

dbObj::dbAddProp(const char *propName, bool propVal)

dbObj::dbAddProp(const char *propName, db_Orient propVal)

Add a property to a dbObject of the given type. If the property given by propName already exists, its value is updated to propVal.

 

dbObj::dbReplaceProp(const char *propName, const char *propVal)

dbObj::dbReplaceProp(const char *propName, int propVal)

dbObj::dbReplaceProp(const char *propName, double propVal)

dbObj::dbReplaceProp(const char *propName, bool propVal)

dbObj::dbReplaceProp(const char *propName, db_Orient propVal)

Replace an existing property with one with a new value of a given type.

 

const char * dbObj::dbGetStringProp(const char *name)

int32_t dbObj::dbGetIntProp(const char *name)

float64_t dbObj::dbGetFloatProp(const char *name)

bool dbObj::dbGetBoolProp(const char *name)

db_Orient dbObj::dbGetOrientProp(const char *name)

Get a property of a specified type by name.

 

propType dbObj::dbFindPropType(const char *name)

Finds the type of a named property. propType is an enum with names stringType, integerType, floatType, booleanType, orientType.

 

obj.getPropList()

Gets the object's property list as a Python list of prop objects. A prop object is a helper class with the following accessor methods:

char * prop::name()

Returns the name of the property.

prop::setName(char *name)

Sets the name of the property.

propType prop::type()

Returns the type of the property. This can be stringType, booleanType, integerType, floatType, listType or unknownType.

prop::setType(propType type)

Sets the type of the property.

union prop::data()

Returns the property value.

  • value.s is the string data
  • value.i the integer data
  • value,f the float data
  • value.b the boolean data
  • prop::setData(value)

    Sets the property value. The function is overloaded for the common propType types.

     

    bool dbObj::dbDeleteProp(char *name)

    Delete a property by name. Returns true if successful.

     

    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 functions that convert a dbObj to a derived class e.g. rectangle.

    arc * dbObj::toArc()

    array * dbObj::toArray()

    cell * dbObj::toCell()

    cellView * dbObj::toCellView()

    ellipse * dbObj::toEllipse()

    group * dbObj::toGroup()

    HSeg * dbObj::toHSeg()

    inst * dbObj::toInst()

    label * dbObj::toLabel()

    line* dbObj::toLine()

    path * dbObj::toPath()

    polygon * dbObj::toPolygon()

    rectangle * dbObj::toRectangle()

    segment * dbObj::toSegment()

    shape s = dbObj::toShape()

    viaInst * dbObj::toViaInst()

    view * dbObj::toView()

    vertex * dbObj::.toVertex()

    VSeg * dbObj::toVSeg()>

     

    Getting bounding box coordinates. Note that you can only get the bounding box coordinates of shapes, insts or viaInsts.

    int32_t dbObj::left();

    int32_t dbObj::bottom();

    int32_t dbObj::right();

    int32_t dbObj::top();font>

    Gets the specified bounding box coordinate.

     

     

    Contents|Index

    Copyright © Peardrop Design 2024.