QGroundControl
Ground Control Station for MAVLink Drones
Loading...
Searching...
No Matches
QGCPlanarGeometry Namespace Reference

Geometry operations on planar (local tangent plane) coordinates. More...

Functions

QList< QLineF > intersectLine (const QLineF &line, const QPolygonF &polygon)
QList< QList< QLineF > > intersectLines (const QList< QLineF > &lines, const QPolygonF &polygon)
QList< QPolygonF > offsetPolygon (const QPolygonF &polygon, double distance)
QList< QPointF > offsetPolyline (const QList< QPointF > &polyline, double distance)
QList< QPolygonF > bufferPolyline (const QList< QPointF > &polyline, double distance)
QPolygonF joinContours (const QList< QPolygonF > &contours)
 Joins contours into a single ring using zero-width bridges, for use with odd-even polygon filling.

Detailed Description

Geometry operations on planar (local tangent plane) coordinates.

Function Documentation

◆ bufferPolyline()

QList< QPolygonF > QGCPlanarGeometry::bufferPolyline ( const QList< QPointF > & polyline,
double distance )
nodiscard

Builds the planar area within distance of a polyline and returns its boundary contours, outer boundary first. Any further contours are holes, such as the interior of a closed path. Paths are closed following the same rule as offsetPolyline.

Definition at line 522 of file QGCPlanarGeometry.cc.

◆ intersectLine()

QList< QLineF > QGCPlanarGeometry::intersectLine ( const QLineF & line,
const QPolygonF & polygon )
nodiscard

Clips a directed line segment to a planar polygon using the odd-even fill rule. Polygon edges lying on the line are kept. Results are ordered from line.p1() to line.p2().

Definition at line 378 of file QGCPlanarGeometry.cc.

References intersectLines().

◆ intersectLines()

QList< QList< QLineF > > QGCPlanarGeometry::intersectLines ( const QList< QLineF > & lines,
const QPolygonF & polygon )
nodiscard

Clips directed line segments to a planar polygon. The result at each index contains the ordered fragments for the corresponding input line.

Definition at line 384 of file QGCPlanarGeometry.cc.

Referenced by intersectLine().

◆ joinContours()

QPolygonF QGCPlanarGeometry::joinContours ( const QList< QPolygonF > & contours)
nodiscard

Joins contours into a single ring using zero-width bridges, for use with odd-even polygon filling.

Definition at line 556 of file QGCPlanarGeometry.cc.

◆ offsetPolygon()

QList< QPolygonF > QGCPlanarGeometry::offsetPolygon ( const QPolygonF & polygon,
double distance )
nodiscard

Offsets a planar polygon by distance. Positive distances expand the polygon. Corners sharper than 45 degrees are squared off rather than mitered, so the result stays near the requested distance. Output winding matches the input. Multiple polygons can be returned when an inward offset separates a concave polygon.

Definition at line 399 of file QGCPlanarGeometry.cc.

Referenced by QGCMapPolygon::offset(), and offsetPolyline().

◆ offsetPolyline()

QList< QPointF > QGCPlanarGeometry::offsetPolyline ( const QList< QPointF > & polyline,
double distance )
nodiscard

Builds a directed parallel path. Positive distances offset to the left of travel. A path ending where it starts is closed, unless all its points lie on one line, and produces an explicitly closed output. The output is empty when an inward offset collapses the path or when a closed path crosses itself.

Definition at line 431 of file QGCPlanarGeometry.cc.

References offsetPolygon().

Referenced by QGCMapPolyline::offsetPolyline().