pointList class
A pointList represents a list (actually an array) of points.
pointList::pointlist()
Creates a pointList.
pointList::pointList(Point *pts, int32_t num, bool compress = true)
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.
PointList::pointList(int32_t *xpts, int32_t *ypts, int32_t num, bool compress = true)
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.
bool pointList::operator ==
Returns true if the two pointlists are equal.
bool pointList::operator !=
Returns true if the two pointlists are not equal.
bool pointList::operator <
Returns true if one pointList is less than another. 'Less' is the case if any vertex X or Y coordinate is less than the other vertex.
pointList::setPtlist(Point *pts, int32_t 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.
pointList::setPtlist(int32_t *xpts, int32_t *ypts, int32_t 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.
pointList::setPtlist(Rect box)
Sets a pointList with the 4 vertices of a rectangle (LL, LR, UR, UL).
Point * pointList::points()
Get the raw pointList as an array of Points.
pointList::append(Point p)
Append the pointList with Point p.
pointList::append(pointList pl)
Append the pointList with pointList
Point pointList::at(in32_t idx)
Get the Point p given by the index idx.
int32_t pointList::numPts()
Get the number of points in the pointList.
Rect pointList::bBox()
Get the bounding box of the pointList.
float64_t pointList::area()
Gets the area of the pointList. This assumes the pointListis closed, i.e. there is an edge between the last and first vertex.
int32_t pointList::perimeter()
Gets the perimeter of the pointList.This assumes the pointListis closed, i.e. there is an edge between the last and first vertex.
pointList::transform(transform trans)
Transform all points in the pointListby trans.
pointList::scale(float64_t factor, int32_t grid)
Scales all points in a pointList by factor, snapping them to a grid grid (in database units)
pointList::compressPoints(bool ortho, bool xfirst)
Compresses all points in a pointList by removing all colinear points and ordering them counterclockwise. If ortho is true, points are assumed to be manhattan and are stored in a more compressed format. If xfirst is true, the pointList is ordered with the first point being least in X.
bool b = pointList::isSelfIntersecting(bool isClosed = true)
Returns true if the pointListis self intersecting.
bool pointList::overlaps(pointList other, touching = false)
Returns true if one pointList overlaps another. If touching is true, returns true if the pointlists touch.
bool pointList::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 pointList::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 pointList::isOrthogonal(bool isClosed = true)
Returns true if the pointList is orthogonal i.e. manhattan.