![]() |
SWMMVis
6.0.0-alpha.4
Qt6/C++ GIS-based graphical user interface for the SWMMVis engine (6.0.0-alpha.4)
|
A complete feature geometry: a type plus zero or more parts. More...
#include <featuregeometry.h>
Public Member Functions | |
| FeatureGeometry ()=default | |
| FeatureGeometry (GeometryType type) | |
| GeometryType | type () const |
| void | setType (GeometryType t) |
| bool | isEmpty () const |
| bool | isValid () const |
| const QVector< Part > & | parts () const |
| QVector< Part > & | parts () |
| int | partCount () const |
| void | addPart (const Part &p) |
| void | clear () |
| int | vertexCount () const |
| bool | hasZ () const |
| int | unsampledZCount () const |
| bool | zRange (double &minZ, double &maxZ) const |
| QRectF | boundingRect () const |
| double | area () const |
| double | length () const |
| void | setHasZ (bool on) |
| int | densify (double spacing) |
| void | normalizeOrientation () |
| bool | validate (GeometryType expected, QString *reason=nullptr) const |
Structural check against expected. | |
| OGRGeometry * | toOGR (OGRSpatialReference *srs=nullptr) const |
| Build a new OGR geometry. The CALLER OWNS the result and must release it with OGRGeometryFactory::destroyGeometry. | |
| bool | operator== (const FeatureGeometry &o) const |
| bool | operator!= (const FeatureGeometry &o) const |
Static Public Member Functions | |
| static FeatureGeometry | fromOGR (const OGRGeometry *g) |
Build a FeatureGeometry from g. | |
| static int | ogrTypeFor (GeometryType t, bool withZ) |
A complete feature geometry: a type plus zero or more parts.
Single-part types (Point, LineString, Polygon) hold exactly one entry in parts; the accessors tolerate more and use the first. Multi* types hold any number.
|
default |
|
inlineexplicit |
|
inline |
| double openswmmvis::feature::FeatureGeometry::area | ( | ) | const |
Sum of Part::netArea over every part.
| QRectF openswmmvis::feature::FeatureGeometry::boundingRect | ( | ) | const |
|
inline |
| int openswmmvis::feature::FeatureGeometry::densify | ( | double | spacing | ) |
Ring::densify on every ring of every part; returns the number of vertices inserted in total.
|
static |
Build a FeatureGeometry from g.
Reads 2.5D coordinates when the source geometry carries them. Unsupported geometry classes (curves, geometry collections) yield a GeometryType::None result rather than throwing.
| bool openswmmvis::feature::FeatureGeometry::hasZ | ( | ) | const |
True when EVERY non-empty ring carries a well-formed Z array.
| bool openswmmvis::feature::FeatureGeometry::isEmpty | ( | ) | const |
|
inline |
| double openswmmvis::feature::FeatureGeometry::length | ( | ) | const |
Sum of exterior-ring 2D lengths — meaningful for line types.
| void openswmmvis::feature::FeatureGeometry::normalizeOrientation | ( | ) |
|
static |
The OGR well-known-binary type constant for t, with the 25D flag set when withZ. Used when creating the GeoPackage table.
|
inline |
| bool openswmmvis::feature::FeatureGeometry::operator== | ( | const FeatureGeometry & | o | ) | const |
|
inline |
|
inline |
|
inline |
| void openswmmvis::feature::FeatureGeometry::setHasZ | ( | bool | on | ) |
Give (or drop) Z arrays on every ring to match on.
|
inline |
| OGRGeometry * openswmmvis::feature::FeatureGeometry::toOGR | ( | OGRSpatialReference * | srs = nullptr | ) | const |
Build a new OGR geometry. The CALLER OWNS the result and must release it with OGRGeometryFactory::destroyGeometry.
| srs | Optional; assigned to the geometry when non-null. |
|
inline |
| int openswmmvis::feature::FeatureGeometry::unsampledZCount | ( | ) | const |
Count of vertices whose Z is NaN, across all 3D rings. Reported in the Features dock so an un-sampled breakline is visible rather than silent.
| bool openswmmvis::feature::FeatureGeometry::validate | ( | GeometryType | expected, |
| QString * | reason = nullptr |
||
| ) | const |
Structural check against expected.
| expected | The layer's declared type. |
| reason | Set to a user-facing message when the result is false. |
Rejects: wrong part count for a single-part type, empty rings, polygons with fewer than three vertices, self-intersecting rings, holes not contained by their exterior, and holes that overlap one another. These are the same rules QUAD_MESHING_REDESIGN_PLAN §5 states for a drawn quad region, so a polygon that passes here is admissible as a region ring.
| int openswmmvis::feature::FeatureGeometry::vertexCount | ( | ) | const |
Total vertex count across every ring of every part.
Min / max of the finite Z values. Returns false when there are none.