Glade Reference


VSeg class

A VSeg represents a wiring segment for place&route data. It is a 2 vertex horizontal path. A VSeg is normally created by the cellView::dbCreateVSeg() function.

v.setPoints(int x1, int y1, int x2, int y2)


Sets the vertices of the VSeg

v.left()


Gets the leftmost X coordinate of a VSeg.

 

v.right()


Gets the rightmost X coordinate of a VSeg.

 

v.bottom()


Gets the lowest Y coordinate of a VSeg.

 

v.top()


Gets the highest Y coordinate of a VSeg.

 

int w = v.width()


Gets the VSeg width.

 

v.setStyle(int s)


Sets the VSeg style, i.e. the type of the path end. The style can be one of: 0 - truncate, 1 - round, 2 - extend, 4 - varextend, 8 - octagonal. Python global variables TRUNCATE, ROUND, EXTEND, VAREXTEND, OCTAGONAL are defined to these values.

 

int s = v.getStyle()


Gets the VSeg style.

 

v.setSpecial(bool val)


Sets the VSeg specialNet status

 

v.isSpecial()


Returns true is the VSeg is a specialNet.

 

v.setNet(net n)


Sets the VSeg net

 

v.getNet()


Returns the VSeg net.

 

Rect  b = v.bBox()


Get the bounding box of this VSeg.

 

dbtype_t_t t = v.objType()


Returns the object type of this VSeg as HSEG.

 

char *name = p.objName()


Returns the object name of this VSeg as "HSEG".

 

int n = v.nPoints()


Returns the number of points of the VSeg (2).

 

Point  * pts = v.ptlist()


Returns the point list of this VSeg as a C array of Points.

 

double a = v.area()


Get the area of this VSeg.

 

int p = v.perimeter()


Get the perimeter of this VSeg.

 

Point v.origin()


Returns the origin point of a VSeg

 

v.setOrigin(Point p)


Sets the origin of a VSeg.

 

int e = v.extent()


Returns the extent, i.e. the length of the VSeg.

 

v.setExtent(int e)


Sets the extent of the VSeg.

 

Point p = v.getFirstVertex()


Gets the first vertex of this VSeg

 

Point p = v.getLastVertex()


Gets the last vertex of this VSeg.

 

bool v.ptInPoly(Point  p)


Returns true if the Point  p is contained in the VSeg or on its edges.

 

v.Move(cellView  dest, Point  delta, bool opt = True)


Move this VSeg by distance delta. If opt is True then the database is re-optimised for the new VSeg position. If there are a lot of objects to move it makes sense to turn this off and instead use the cellView  update() function after moving them all.

 

dbObj  obj = v.Copy(cellView  dest, Point  delta, int layerNum = -1)


Copy this VSeg to cellView  dest, with offset delta. If layer is a positive integer the VSeg will be copied to the new layer number.

 

dbObj  obj = v.Flatten(cellView  dest, transform  trans)


Flatten this VSeg into cellView  dest with transformation trans.

 

int dist = v.getNearestEdge(Point p, segment &edge, bool centreLine=True, bool outLine=True)


Gets the nearest segment edge to the VSeg from the Point p and returns the distance. If centreline is True, the centre line of the VSeg is considered. If outLine is True, the outline edges of the VSeg are considered.

 

int dist = v.getNearestVertex(Point p, vertex &vert)


Gets the nearest vertex  vert to the VSeg from the Point p and returns the distance.

 

char *name = v.getNetName()


Returns the VSeg net name as a string.

 

bool ok = v.offGrid(int grid)


Returns true if the VSeg is offgrid.

 

 

Contents|Index

Copyright © Peardrop Design 2020.