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::FeatureGeometry Class Reference

A complete feature geometry: a type plus zero or more parts. More...

#include <featuregeometry.h>

Collaboration diagram for openswmmvis::feature::FeatureGeometry:

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)
 

Detailed Description

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.

Constructor & Destructor Documentation

◆ FeatureGeometry() [1/2]

openswmmvis::feature::FeatureGeometry::FeatureGeometry ( )
default

◆ FeatureGeometry() [2/2]

openswmmvis::feature::FeatureGeometry::FeatureGeometry ( GeometryType  type)
inlineexplicit

Member Function Documentation

◆ addPart()

void openswmmvis::feature::FeatureGeometry::addPart ( const Part p)
inline
Here is the caller graph for this function:

◆ area()

double openswmmvis::feature::FeatureGeometry::area ( ) const

Sum of Part::netArea over every part.

◆ boundingRect()

QRectF openswmmvis::feature::FeatureGeometry::boundingRect ( ) const

◆ clear()

void openswmmvis::feature::FeatureGeometry::clear ( )
inline

◆ densify()

int openswmmvis::feature::FeatureGeometry::densify ( double  spacing)

Ring::densify on every ring of every part; returns the number of vertices inserted in total.

Here is the caller graph for this function:

◆ fromOGR()

FeatureGeometry openswmmvis::feature::FeatureGeometry::fromOGR ( const OGRGeometry *  g)
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.

◆ hasZ()

bool openswmmvis::feature::FeatureGeometry::hasZ ( ) const

True when EVERY non-empty ring carries a well-formed Z array.

Here is the caller graph for this function:

◆ isEmpty()

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

◆ isValid()

bool openswmmvis::feature::FeatureGeometry::isValid ( ) const
inline
Here is the call graph for this function:
Here is the caller graph for this function:

◆ length()

double openswmmvis::feature::FeatureGeometry::length ( ) const

Sum of exterior-ring 2D lengths — meaningful for line types.

◆ normalizeOrientation()

void openswmmvis::feature::FeatureGeometry::normalizeOrientation ( )
Here is the caller graph for this function:

◆ ogrTypeFor()

int openswmmvis::feature::FeatureGeometry::ogrTypeFor ( GeometryType  t,
bool  withZ 
)
static

The OGR well-known-binary type constant for t, with the 25D flag set when withZ. Used when creating the GeoPackage table.

◆ operator!=()

bool openswmmvis::feature::FeatureGeometry::operator!= ( const FeatureGeometry o) const
inline

◆ operator==()

bool openswmmvis::feature::FeatureGeometry::operator== ( const FeatureGeometry o) const

◆ partCount()

int openswmmvis::feature::FeatureGeometry::partCount ( ) const
inline

◆ parts() [1/2]

QVector< Part > & openswmmvis::feature::FeatureGeometry::parts ( )
inline

◆ parts() [2/2]

const QVector< Part > & openswmmvis::feature::FeatureGeometry::parts ( ) const
inline
Here is the caller graph for this function:

◆ setHasZ()

void openswmmvis::feature::FeatureGeometry::setHasZ ( bool  on)

Give (or drop) Z arrays on every ring to match on.

Here is the caller graph for this function:

◆ setType()

void openswmmvis::feature::FeatureGeometry::setType ( GeometryType  t)
inline
Here is the caller graph for this function:

◆ toOGR()

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.

Parameters
srsOptional; assigned to the geometry when non-null.
Returns
nullptr when this geometry is empty or of type None.
Here is the call graph for this function:
Here is the caller graph for this function:

◆ type()

GeometryType openswmmvis::feature::FeatureGeometry::type ( ) const
inline

◆ unsampledZCount()

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.

◆ validate()

bool openswmmvis::feature::FeatureGeometry::validate ( GeometryType  expected,
QString *  reason = nullptr 
) const

Structural check against expected.

Parameters
expectedThe layer's declared type.
reasonSet 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.

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

◆ vertexCount()

int openswmmvis::feature::FeatureGeometry::vertexCount ( ) const

Total vertex count across every ring of every part.

◆ zRange()

bool openswmmvis::feature::FeatureGeometry::zRange ( double minZ,
double maxZ 
) const

Min / max of the finite Z values. Returns false when there are none.


The documentation for this class was generated from the following files: