Qt:Документация 4.3.2/qpolygonf

Материал из Wiki.crossplatform.ru

Перейти к: навигация, поиск
40px Внимание: Актуальная версия перевода документации находится здесь

__NOTOC__

Image:qt-logo.png

Главная · Все классы · Основные классы · Классы по группам · Модули · Функции

Image:trolltech-logo.png

Содержание

[править] QPolygonF Class Reference
[модуль QtGui ]

The QPolygonF class provides a vector of points using floating point precision. Далее...

 #include <QPolygonF>

Inherits QVector<QPointF>.

Примечание: все функции в этом классе реентерабельны.

[править] Открытые функции

  • 62 public functions inherited from QVector

[править] Связанные не-члены

  • QDataStream & operator<< ( QDataStream & stream, const QPolygonF & polygon )
  • QDataStream & operator>> ( QDataStream & stream, QPolygonF & polygon )

[править] Дополнительные унаследованные члены

  • 2 static public members inherited from QVector

[править] Подробное описание

The QPolygonF class provides a vector of points using floating point precision.

A QPolygonF is a QVector< QPointF>. The easiest way to add points to a QPolygonF is to use its streaming operator, as illustrated below:

         QPolygonF polygon;
         polygon << QPointF(10.4, 20.5) << QPointF(20.2, 30.2);

In addition to the functions provided by QVector, QPolygonF provides the boundingRect() and translate() functions for geometry operations. Use the QMatrix::map() function for more general transformations of QPolygonFs.

QPolygonF also provides the isClosed() function to determine whether a polygon's start and end points are the same, and the toPolygon() function returning an integer precision copy of this polygon.

The QPolygonF class is implicitly shared.

See also QVector, QPolygon, and QLineF.


[править] Описание функций-членов

[править]
QPolygonF::QPolygonF ()

Constructs a polygon with no points.

See also QVector::isEmpty().

[править]
QPolygonF::QPolygonF ( int size )

Constructs a polygon of the given size. Creates an empty polygon if size == 0.

See also QVector::isEmpty().

[править]
QPolygonF::QPolygonF ( const QPolygonF & polygon )

Constructs a copy of the given polygon.

[править]
QPolygonF::QPolygonF ( const QVector< QPointF> & points )

Constructs a polygon containing the specified points.

[править]
QPolygonF::QPolygonF ( const QRectF & rectangle )

Constructs a closed polygon from the specified rectangle.

The polygon contains the four vertices of the rectangle in clockwise order starting and ending with the top-left vertex.

See also isClosed().

[править]
QPolygonF::QPolygonF ( const QPolygon & polygon )

Constructs a float based polygon from the specified integer based polygon.

See also toPolygon().

[править]
QPolygonF::~QPolygonF ()

Destroys the polygon.

[править]
QRectF QPolygonF::boundingRect () const

Returns the bounding rectangle of the polygon, or QRectF(0,0,0,0) if the polygon is empty.

See also QVector::isEmpty().

[править]
bool QPolygonF::containsPoint ( const QPointF & point, Qt::FillRule fillRule ) const

Returns true if the given point is inside the polygon according to the specified fillRule; otherwise returns false.

Эта функция была введена в Qt 4.3.

[править]
QPolygonF QPolygonF::intersected ( const QPolygonF & r ) const

Returns a polygon which is the intersection of this polygon and r.

Эта функция была введена в Qt 4.3.

[править]
bool QPolygonF::isClosed () const

Returns true if the polygon is closed; otherwise returns false.

A polygon is said to be closed if its start point and end point are equal.

See also QVector::first() and QVector::last().

[править]
QPolygonF QPolygonF::subtracted ( const QPolygonF & r ) const

Returns a polygon which is r subtracted from this polygon.

Эта функция была введена в Qt 4.3.

[править]
QPolygon QPolygonF::toPolygon () const

Creates and returns a QPolygon by converting each QPointF to a QPoint.

See also QPointF::toPoint().

[править]
void QPolygonF::translate ( const QPointF & offset )

Translate all points in the polygon by the given offset.

[править]
void QPolygonF::translate ( qreal dx, qreal dy )

Эта перегруженная функция предоставлена для удобства.

Translates all points in the polygon by (dx, dy).

[править]
QPolygonF QPolygonF::united ( const QPolygonF & r ) const

Returns a polygon which is the union of this polygon and r.

Эта функция была введена в Qt 4.3.

See also intersected() and subtracted().


[править] Связанные не-члены

[править]
QDataStream & operator<< ( QDataStream & stream, const QPolygonF & polygon )

Эта перегруженная функция предоставлена для удобства.

Writes the given polygon to the given stream, and returns a reference to the stream.

Смотрите также Формат операторов QDataStream.

[править]
QDataStream & operator>> ( QDataStream & stream, QPolygonF & polygon )

Эта перегруженная функция предоставлена для удобства.

Reads a polygon from the given stream into the given polygon, and returns a reference to the stream.

Смотрите также Формат операторов QDataStream.



Copyright © 2007 Trolltech Trademarks
Qt 4.3.2