Exemple #1
0
void Q3PointArray::makeArc(int x, int y, int w, int h, int a1, int a2)
{
    QRectF r(x, y, w, h);
    QPointF startPoint;
    qt_find_ellipse_coords(r, a1 / 16.0, a2 / 16.0, &startPoint, 0);

    QPainterPath path(startPoint);
    path.arcTo(r, a1 / 16.0, a2 / 16.0);

    if (path.isEmpty())
        *this = Q3PointArray();
    else
        *this = path.toSubpathPolygons().at(0).toPolygon();
}
QT_BEGIN_NAMESPACE

/*!
    \class Q3PointArray
    The Q3PointArray class provides an array of points.

    \compat

    Q3PointArray is a QPolygon subclass that provides functions
    to make it more source compatible with the \c QPointArray class
    in Qt 3.

    In Qt 4, we recommend that you use QPainterPath for representing
    arcs, ellipses, and Bezier curves, rather than QPolygon.
*/

/*!
    Sets the points of the array to those describing an arc of an
    ellipse with size, width \a w by height \a h, and position (\a x,
    \a y), starting from angle \a a1 and spanning by angle \a a2. The
    resulting array has sufficient resolution for pixel accuracy (see
    the overloaded function which takes an additional QMatrix
    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.
*/
#ifndef QT_NO_WMATRIX
void Q3PointArray::makeArc(int x, int y, int w, int h, int a1, int a2)
{
    QRectF r(x, y, w, h);
    QPointF startPoint;
    qt_find_ellipse_coords(r, a1 / 16.0, a2 / 16.0, &startPoint, 0);

    QPainterPath path(startPoint);
    path.arcTo(r, a1 / 16.0, a2 / 16.0);

    if (path.isEmpty())
        *this = Q3PointArray();
    else
        *this = path.toSubpathPolygons().at(0).toPolygon();
}
Exemple #3
0
void CPencilLine::setControlPoints (Q3PointArray clo, bool cl){
    polyline = Q3PointArray (clo.size ());
    polyline = clo;
}
void JunctionFlowNode::initPoints()
{
	setPoints( Q3PointArray( QRect( -4, -4, 9, 9 ) ) );
}