SWMMVis  6.0.0-alpha.4
Qt6/C++ GIS-based graphical user interface for the SWMMVis engine (6.0.0-alpha.4)
Loading...
Searching...
No Matches
openswmmvis::feature::Ring Struct Reference

One ordered run of vertices, with optional per-vertex Z. More...

#include <featuregeometry.h>

Collaboration diagram for openswmmvis::feature::Ring:

Public Member Functions

bool isEmpty () const
 
int size () const
 
bool hasZ () const
 
double zAt (int i) const
 
void syncZLength ()
 
void clearZ ()
 
void ensureZ ()
 
QPolygonF toPolygon () const
 
QRectF boundingRect () const
 
double signedArea () const
 
double length2D () const
 
bool isSimpleRing () const
 
void normalizeCCW ()
 
bool containsPoint (const QPointF &p) const
 
void insertVertex (int index, const QPointF &p, double zVal)
 
void removeVertex (int index)
 
void moveVertex (int index, const QPointF &p)
 
int densify (double spacing)
 Insert intermediate vertices so no segment is longer than spacing map units.
 
bool operator== (const Ring &o) const
 
bool operator!= (const Ring &o) const
 

Public Attributes

QVector< QPointF > pts
 
QVector< doublez
 

Detailed Description

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".

Member Function Documentation

◆ boundingRect()

QRectF openswmmvis::feature::Ring::boundingRect ( ) const
Here is the call graph for this function:
Here is the caller graph for this function:

◆ 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).

Here is the call graph for this function:
Here is the caller graph for this function:

◆ 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.
Here is the call graph for this function:

◆ ensureZ()

void openswmmvis::feature::Ring::ensureZ ( )

Give this ring an all-NaN Z array if it has none.

Here is the call graph for this function:

◆ 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.

Here is the caller graph for this function:

◆ 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()].

Here is the caller graph for this function:

◆ isEmpty()

bool openswmmvis::feature::Ring::isEmpty ( ) const
inline
Here is the caller graph for this function:

◆ 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.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ 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.

Here is the caller graph for this function:

◆ 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.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ 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.

Here is the caller graph for this function:

◆ signedArea()

double openswmmvis::feature::Ring::signedArea ( ) const

Signed area via the shoelace formula; positive = counter-clockwise. Zero for fewer than three vertices.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ size()

int openswmmvis::feature::Ring::size ( ) const
inline
Here is the caller graph for this function:

◆ 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
Here is the caller graph for this function:

◆ 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.

Here is the call graph for this function:

Member Data Documentation

◆ pts

QVector<QPointF> openswmmvis::feature::Ring::pts

◆ z

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: