Glade Reference
A pointlist class represents a list (actually an array) of points.
Creates a pointlist.
Creates a pointlist from the points specified by the array pts with size num. If compress is true, the points will be sorted counterclockwise and colinear points removed.
Creates a pointlist from the points specified by the arrays xpts and ypts with size num. If compress is true, the points will be sorted counterclockwise and colinear points removed.
Returns true if the two pointlists are equal.
Returns true if the two pointlists are not equal.
Returns true if one pointlist is less than another. 'Less' is the case is any vertex X or Y coordinate is less than the other vertex.
pl.setPtlist(Point *pts, int num, bool compress = True)
Sets a pointlist from the points specified by the array pts with size num. If compress is true, the points will be sorted counterclockwise and colinear points removed.
pl.setPtlist(int *xpts, int *ypts, int num, bool compress = True)
Sets a pointlist from the points specified by the arrays xpts and ypts with size num. If compress is true, the points will be sorted counterclockwise and colinear points removed.
pl.setPtlist(Rect box)
Sets a pointlist with the 4 vertices of a rectangle (LL, LR, UR, UL).
Point *pts = pl.points()
Get the raw pointlist as an array of Points.
pl.append(Point p)
Append the pointlist with Point p.
pl.append(pointlist pl)
Append the pointlist with pointlist pl.
Point p = pl.at(int idx)
Get the Point p given by the index idx.
int num = pl.numPts()
Get the number of points in the pointlist.
double a = pl.area()
Gets the area of the pointlist. This assumes the pointlist is closed, i.e. there is an edge between the last and first vertex.
int p = pl.perimeter()
Gets the perimeter of the pointlist. This assumes the pointlist is closed, i.e. there is an edge between the last and first vertex.
pl.transform(dbTransform trans)
Transform all points in the pointlist by trans.
pl.scale(double factor, int grid)
Scales all points in a pointlist by factor, snapping them to a grid grid (in database units)
pl.compressPoints(bool ortho, bool xfirst)
Compresses all points in a pointlist by removing all colionear points and ordering them counterclockwise. If ortho is true, points are assumed to be manhattan and are stored in a more compressed format.
bool b = pl.isSelfIntersecting(bool isClosed = true)
Returns true if the pointlist is self intersecting.
bool pl.overlaps(pointlist other, touching = false)
Returns true if one pointlist overlaps another. If touching is true, returns true if the pointlists touch.
bool pl.contains(Point p, bool touching = true)
Returns true if the pointlist contains Point p. If touching is true, returns true if Point p touches an edge of the pointlist.
bool pl.contains(Rect r, bool touching = true)
Returns true if the pointlist contains Rect r. If touching is true, returns true if a vertex of Rect r touches an edge of the pointlist.
bool pl.isOrthogonal(bool isClosed = true)
Returns true if the pointlist is orthogonal i.e. manhattan.
Copyright © Peardrop Design 2016.