A TQPointArray is an array of TQPoint objects. In addition to the functions provided by TQMemArray, TQPointArray provides some point-specific functions.
For geometry operations use boundingRect() and translate(). There is also the TQWMatrix::map() function for more general transformations of TQPointArrays. You can also create arcs and ellipses with makeArc() and makeEllipse().
Among others, TQPointArray is used by TQPainter::drawLineSegments(), TQPainter::drawPolyline(), TQPainter::drawPolygon() and TQPainter::drawCubicBezier().
Note that because this class is a TQMemArray, copying an array and modifying the copy modifies the original as well, i.e. a shallow copy. If you need a deep copy use copy() or detach(), for example:
Constructs a point array from the rectangle \fIr\fR.
.PP
If \fIclosed\fR is FALSE, then the point array just contains the following four points in the listed order: r.topLeft(), r.topRight(), r.bottomRight() and r.bottomLeft().
.PP
If \fIclosed\fR is TRUE, then a fifth point is set to r.topLeft().
.SH "void TQPointArray::makeArc ( int x, int y, int w, int h, int a1, int a2 )"
Sets the points of the array to those describing an arc of an ellipse with size, width \fIw\fR by height \fIh\fR, and position (\fIx\fR, \fIy\fR), starting from angle \fIa1\fR and spanning by angle \fIa2\fR. The resulting array has sufficient resolution for pixel accuracy (see the overloaded function which takes an additional TQWMatrix parameter).
Angles are specified in 16ths of a degree, i.e. a full circle equals 5760 (16*360). Positive values mean counter-clockwise, whereas negative values mean the clockwise direction. Zero degrees is at the 3 o'clock position.
This is an overloaded member function, provided for convenience. It behaves essentially like the above function.
.PP
Sets the points of the array to those describing an arc of an ellipse with width \fIw\fR and height \fIh\fR and position (\fIx\fR, \fIy\fR), starting from angle \fIa1\fR, and spanning angle by \fIa2\fR, and transformed by the matrix \fIxf\fR. The resulting array has sufficient resolution for pixel accuracy.
.PP
Angles are specified in 16ths of a degree, i.e. a full circle equals 5760 (16*360). Positive values mean counter-clockwise, whereas negative values mean the clockwise direction. Zero degrees is at the 3 o'clock position.
Copies \fInPoints\fR points from the variable argument list into this point array from position \fIindex\fR, and resizes the point array if \fCindex+nPoints\fR exceeds the size of the array.
.PP
Returns TRUE if successful, or FALSE if the array could not be resized (typically due to lack of memory).
.PP
The example code creates an array with three points (4,5), (6,7) and (8,9), by expanding the array from 1 to 3 points:
This is an overloaded member function, provided for convenience. It behaves essentially like the above function.
.PP
This version of the function copies \fInPoints\fR from \fIfrom\fR into this array, starting at \fIindex\fR in this array and \fIfromIndex\fR in \fIfrom\fR. \fIfromIndex\fR is 0 by default.