One ordered run of vertices, with optional per-vertex Z.
More...
#include <featuregeometry.h>
One ordered run of vertices, with optional per-vertex Z.
Used for a polygon's exterior or interior ring, for a line part, and — with a single vertex — for a point part. Rings are stored OPEN: the closing vertex is implicit for polygons and is added only when converting to OGR. Storing them open keeps vertex editing unambiguous (there is exactly one handle per corner) and matches mesh::QuadRegion::ring, whose comment notes "last == first optional".
◆ boundingRect()
| QRectF openswmmvis::feature::Ring::boundingRect |
( |
| ) |
const |
◆ clearZ()
| void openswmmvis::feature::Ring::clearZ |
( |
| ) |
|
|
inline |
Drop the Z array, making this ring 2D.
◆ containsPoint()
| bool openswmmvis::feature::Ring::containsPoint |
( |
const QPointF & |
p | ) |
const |
True when p lies inside the closed ring (even-odd rule).
◆ densify()
| int openswmmvis::feature::Ring::densify |
( |
double |
spacing | ) |
|
Insert intermediate vertices so no segment is longer than spacing map units.
Used before Z sampling so a breakline drawn with three clicks follows the terrain instead of chording it (plan §4.3). New vertices get NaN Z when the ring is 3D — the caller samples afterwards. A spacing <= 0 is a no-op.
- Returns
- The number of vertices inserted.
◆ ensureZ()
| void openswmmvis::feature::Ring::ensureZ |
( |
| ) |
|
Give this ring an all-NaN Z array if it has none.
◆ hasZ()
| bool openswmmvis::feature::Ring::hasZ |
( |
| ) |
const |
|
inline |
True when a well-formed Z array is present (size matches, non-empty). A ring whose Z array is the wrong length is treated as 2D rather than read out of bounds.
◆ insertVertex()
| void openswmmvis::feature::Ring::insertVertex |
( |
int |
index, |
|
|
const QPointF & |
p, |
|
|
double |
zVal |
|
) |
| |
Insert p (with Z zVal) at index index, clamped to [0, size()].
◆ isEmpty()
| bool openswmmvis::feature::Ring::isEmpty |
( |
| ) |
const |
|
inline |
◆ isSimpleRing()
| bool openswmmvis::feature::Ring::isSimpleRing |
( |
| ) |
const |
True when the closed ring is simple (no self-intersection) and has at least three distinct vertices. Delegates to mesh::ringIsSimple.
◆ length2D()
| double openswmmvis::feature::Ring::length2D |
( |
| ) |
const |
Total length of the open polyline through pts (2D, ignores Z).
◆ moveVertex()
| void openswmmvis::feature::Ring::moveVertex |
( |
int |
index, |
|
|
const QPointF & |
p |
|
) |
| |
Move the vertex at index to p, leaving its Z untouched.
◆ normalizeCCW()
| void openswmmvis::feature::Ring::normalizeCCW |
( |
| ) |
|
Reverse the vertex order (and Z alongside it) if the ring is clockwise, so it ends counter-clockwise. Delegates to the same convention as mesh::normalizeRingCCW.
◆ operator!=()
| bool openswmmvis::feature::Ring::operator!= |
( |
const Ring & |
o | ) |
const |
|
inline |
◆ operator==()
| bool openswmmvis::feature::Ring::operator== |
( |
const Ring & |
o | ) |
const |
◆ removeVertex()
| void openswmmvis::feature::Ring::removeVertex |
( |
int |
index | ) |
|
Remove the vertex at index if in range; keeps z aligned.
◆ signedArea()
| double openswmmvis::feature::Ring::signedArea |
( |
| ) |
const |
Signed area via the shoelace formula; positive = counter-clockwise. Zero for fewer than three vertices.
◆ size()
| int openswmmvis::feature::Ring::size |
( |
| ) |
const |
|
inline |
◆ syncZLength()
| void openswmmvis::feature::Ring::syncZLength |
( |
| ) |
|
Resize z to match pts, filling new entries with NaN. No-op when the ring is 2D (empty z stays empty).
◆ toPolygon()
| QPolygonF openswmmvis::feature::Ring::toPolygon |
( |
| ) |
const |
◆ zAt()
| double openswmmvis::feature::Ring::zAt |
( |
int |
i | ) |
const |
Z at i, or NaN when this ring is 2D or i is out of range.
◆ pts
| QVector<QPointF> openswmmvis::feature::Ring::pts |
| QVector<double> openswmmvis::feature::Ring::z |
Per-vertex Z. Empty ⇒ this ring is 2D. Otherwise size() == pts.size(); individual entries may be NaN meaning "not sampled".
The documentation for this struct was generated from the following files: