Glade Reference


Segment

A segment is an edge with two points. It is derived from a dbObj so it can be selectable; it also refers to a dbObj. Segments are used when selecting an edge of e.g. a rectangle or polygon.

seg = segment(Point p0, Point p1)

Creates a segment with coordinates p0 and p1.

 

seg = segment(int x1, int y1, int x2, int y2)

Creates a segment with the specified xy coordinates.

 

double seg.DistanceToPoint(Point p)

Get the distance from a point p to this segment.

 

Point seg.NearestPoint(Point p)

Get the nearest point on a segment to another point.

 

db_Type seg.objType()

Returns the objects type - SEGMENT.

 

seg.SetObj(dbObj *obj)

Sets the dbObj associated with this segment.

 

dbObj * seg.GetObj()

Gets the dbObj associated with this segment.

 

bool seg.isXSeg()

Returns 1 if this segment is horizontal, else 0.

 

bool seg.isYSeg()

Returns 1 if this segment is vertical, else 0.

 

bool seg.isManhattan()

Returns 1 if this segment is manhattan, else 0.

 

Rect seg.bBox()

Returns a fake bounding box 10 dbu larger than the segment itself.

 

bool seg.segInRect(Rect r)

Returns 1 if the segment is contained in Rect r.

 

seg.transform(dbTransform trans)

Transforms this segment according to trans.

 

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

Moves this segment by delta.  If opt is True then the database is re-optimised for the new segment 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.

 

Point seg.p0

The first point of the segment.

 

Point seg.p1

The last point of the segment.

 

Contents|Index

Copyright © Peardrop Design 2016.