Glade Reference
A pointListclass represents a list (actually an array) of points.
Creates a pointList.
Creates a pointListfrom 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 pointListfrom 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 pointListis 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 pointListfrom 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 pointListfrom 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 pointListwith the 4 vertices of a rectangle (LL, LR, UR, UL).
Point *pts = pl.points()
Get the raw pointListas an array of Points.
pl.append(Point p)
Append the pointListwith Point p.
pl.append(pointListpl)
Append the pointListwith pointListpl.
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 pointListis 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 pointListis closed, i.e. there is an edge between the last and first vertex.
pl.transform(transform trans)
Transform all points in the pointListby trans.
pl.scale(double factor, int grid)
Scales all points in a pointListby factor, snapping them to a grid grid (in database units)
pl.compressPoints(bool ortho, bool xfirst)
Compresses all points in a pointListby 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 pointListis self intersecting.
bool pl.overlaps(pointListother, touching = false)
Returns true if one pointListoverlaps another. If touching is true, returns true if the pointlists touch.
bool pl.contains(Point p, bool touching = true)
Returns true if the pointListcontains 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 pointListcontains 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 pointListis orthogonal i.e. manhattan.
Copyright © Peardrop Design 2020.