Glade Reference


line class

The line class is derived from a shape. A line can be considered a zero width path. This class is normally created in a cellView using the dbCreateLine() function.

 

l = line

Creates a new line object.

 

Rect b = l.bBox()

Get the bounding box of this line. This is the convex hull of the points in the line.

 

l.bBox(Rect b)

Set the bounding box of this line. Not useful and will throw an exception if called.

 

db_Type t = l.objType()

Returns the object type of this line as LINE.

 

char *name = l.objName()

Returns the object name of this line as "LINE".

 

int num = l.nPoints()

Returns the number of points of the line.

 

Point * pts = l.ptlist()

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

 

Point p = l.at(index)

Returns the Point p at the index into the list of points.

 

bool l.addPoint(Point *p)

Adds a Point to the end of this line.

 

bool l.deletePoint(int index)

Deletes the vertex index of this line.

 

l.setPoint(int index, Point p)

Sets the vertex index of the line to Point p.

 

l.setPoint(int index, int x, int y)

Sets the vertex index of the line to the point given by x, y.

 

int dist = l.getNearestEdge(Point p, segment &s)

Get the distance of the nearest segment s of this line to the point p;

 

int dist = l.getNearestVertex(Point p, vertex &s)

Get the distance of the nearest vertex s of this line to the point p;

 

double area = l.area()

Get the area of this line.

 

int perim = l.perimeter()

Get the perimeter of this line.

 

int length = l.length()

Get the length of this line.

 

l.transform(dbTransform trans)

Transform this line using trans.

 

bool b = l.ptInPoly(Point p, bool includeEnds = True)

Returns True if the point p is on the line. If includeEnds is true, this includes the line start and end point.

 

bool b = l.ptInRect(Rect r)

Returns true if the line crosses (intersects) a rectangle r.

 

l.Move(cellView cv, Point delta, bool opt = True)

Move this line by distance delta.  If opt is True then the database is re-optimised for the new line 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 = l.Copy(cellView cv, Point delta, int layerNum = -1)

Copy this line to cellView cv, with offset delta. If layerNum is non negative the line will be copied to the new layer number.

 

dbObj obj = l.Flatten(cellView cv, dbTransform trans)

Flatten this line into cellView cv with transformation trans.

 

l.Stretch(Point delta, segment seg)

Stretch a segment seg of this line by delta.

 

 

 

Contents|Index

Copyright © Peardrop Design 2016.