pub struct PolygonF<'a> { /* private fields */ }
Expand description
Notice these docs are heavy WIP and not very relevent yet
A QPolygonF is a QVector
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 QLineF
Licence
The documentation is an adoption of the original Qt Documentation and provided herein is licensed under the terms of the GNU Free Documentation License version 1.3 as published by the Free Software Foundation.
Implementations
sourceimpl<'a> PolygonF<'a>
impl<'a> PolygonF<'a>
pub fn new() -> PolygonF<'a>
sourcepub fn swap<P: PolygonFTrait<'a>>(&self, other: &P) -> &Self
pub fn swap<P: PolygonFTrait<'a>>(&self, other: &P) -> &Self
Swaps polygon other with this polygon. This operation is very fast and never fails.
sourcepub fn to_polygon(&self) -> Polygon<'_>
pub fn to_polygon(&self) -> Polygon<'_>
Creates and returns a QPolygon by converting each QPointF to a QPoint.
See also: QPointF::toPoint()
sourcepub fn is_closed(&self) -> bool
pub fn is_closed(&self) -> bool
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() QVector::last()
sourcepub fn bounding_rect(&self) -> RectF<'_>
pub fn bounding_rect(&self) -> RectF<'_>
Returns the bounding rectangle of the polygon, or QRectF(0,0,0,0) if the polygon is empty.
See also: QVector::isEmpty()
sourcepub fn contains_point<P: PointFTrait<'a>>(
&self,
pt: &P,
fill_rule: FillRule
) -> bool
pub fn contains_point<P: PointFTrait<'a>>(
&self,
pt: &P,
fill_rule: FillRule
) -> bool
Returns true
if the given point is inside the polygon according to
the specified fillRule; otherwise returns false.
sourcepub fn united<P: PolygonFTrait<'a>>(&self, r: &P) -> PolygonF<'_>
pub fn united<P: PolygonFTrait<'a>>(&self, r: &P) -> PolygonF<'_>
Returns a polygon which is the union of this polygon and r.
Set operations on polygons will treat the polygons as areas. Non-closed polygons will be treated as implicitly closed.
See also: intersected() subtracted()
sourcepub fn intersected<P: PolygonFTrait<'a>>(&self, r: &P) -> PolygonF<'_>
pub fn intersected<P: PolygonFTrait<'a>>(&self, r: &P) -> PolygonF<'_>
Returns a polygon which is the intersection of this polygon and r.
Set operations on polygons will treat the polygons as areas. Non-closed polygons will be treated as implicitly closed.
See also: intersects()
sourcepub fn intersects<P: PolygonFTrait<'a>>(&self, r: &P) -> bool
pub fn intersects<P: PolygonFTrait<'a>>(&self, r: &P) -> bool
Returns true
if the current polygon intersects at any point the given polygon p.
Also returns true
if the current polygon contains or is contained by any part of p.
Set operations on polygons will treat the polygons as areas. Non-closed polygons will be treated as implicitly closed.
See also: intersected()