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 Namespace Reference

Classes

struct  Feature
 One editable feature: identity, geometry, attributes. More...
 
class  FeatureGeometry
 A complete feature geometry: a type plus zero or more parts. More...
 
class  FeatureStore
 One open, writable OGR table inside a GeoPackage. More...
 
struct  FieldDef
 One user-defined attribute column. More...
 
struct  Part
 One part of a geometry: a polygon (exterior + holes), a line run, or a single point. More...
 
struct  Ring
 One ordered run of vertices, with optional per-vertex Z. More...
 
class  Schema
 An ordered list of FieldDef, with name lookup. More...
 

Typedefs

using FeatureId = qint64
 

Enumerations

enum class  GeometryType {
  None = 0 ,
  Point ,
  LineString ,
  Polygon ,
  MultiPoint ,
  MultiLineString ,
  MultiPolygon
}
 Geometry kinds an editable feature layer can hold. More...
 
enum class  FieldType {
  Text = 0 ,
  Integer ,
  Real ,
  Boolean
}
 The attribute types an authored schema may declare. More...
 

Functions

QString geometryTypeLabel (GeometryType t)
 Human label for t, for combo boxes and metadata rows.
 
QString geometryTypeToken (GeometryType t)
 Stable token for t, for .oswp persistence. Round-trips through geometryTypeFromToken.
 
GeometryType geometryTypeFromToken (const QString &token)
 Inverse of geometryTypeToken; GeometryType::None when unknown.
 
bool isMultiType (GeometryType t)
 True when t is one of the Multi* kinds.
 
GeometryType toMultiType (GeometryType t)
 The Multi* kind corresponding to t (identity for Multi* inputs).
 
QString fieldTypeLabel (FieldType t)
 
QString fieldTypeToken (FieldType t)
 
FieldType fieldTypeFromToken (const QString &token)
 
int ogrFieldTypeFor (FieldType t)
 
QVariant coerceToFieldType (const QVariant &v, FieldType t)
 
QString sanitizeFieldName (const QString &raw)
 Make raw safe as an OGR/GeoPackage column name: ASCII letters, digits and underscore, never starting with a digit, at most 63 characters, never one of the reserved names ("fid", "geom").
 
QString sanitizeTableName (const QString &raw)
 Make raw safe as a GeoPackage table name, on the same rules as sanitizeFieldName plus a "fl_" prefix when raw would otherwise start with a digit.
 

Variables

constexpr FeatureId kInvalidFeatureId = -1
 

Typedef Documentation

◆ FeatureId

using openswmmvis::feature::FeatureId = typedef qint64

Feature id. Mirrors OGR's GIntBig FID. -1 means "not yet stored".

Enumeration Type Documentation

◆ FieldType

The attribute types an authored schema may declare.

Deliberately small: these four cover every role template in plan ยง6 and map 1:1 onto both OGR field types and QVariant. Adding a type means touching the OGR mapping, the property adapter editor, and the table delegate together.

Enumerator
Text 
Integer 
Real 
Boolean 

◆ GeometryType

Geometry kinds an editable feature layer can hold.

A layer declares one type at creation; it decides the OGR geometry type of the GeoPackage table and therefore cannot change afterwards. The Multi* variants accept single-part geometries too (a one-part multi-polygon), so "Add part" can promote a drawing without a table migration.

Enumerator
None 
Point 
LineString 
Polygon 
MultiPoint 
MultiLineString 
MultiPolygon 

Function Documentation

◆ coerceToFieldType()

QVariant openswmmvis::feature::coerceToFieldType ( const QVariant &  v,
FieldType  t 
)

Coerce v to t, returning a default-constructed value of the right type when the conversion fails. Never returns an invalid QVariant.

Here is the caller graph for this function:

◆ fieldTypeFromToken()

FieldType openswmmvis::feature::fieldTypeFromToken ( const QString &  token)
Here is the caller graph for this function:

◆ fieldTypeLabel()

QString openswmmvis::feature::fieldTypeLabel ( FieldType  t)

◆ fieldTypeToken()

QString openswmmvis::feature::fieldTypeToken ( FieldType  t)
Here is the caller graph for this function:

◆ geometryTypeFromToken()

GeometryType openswmmvis::feature::geometryTypeFromToken ( const QString &  token)

Inverse of geometryTypeToken; GeometryType::None when unknown.

◆ geometryTypeLabel()

QString openswmmvis::feature::geometryTypeLabel ( GeometryType  t)

Human label for t, for combo boxes and metadata rows.

Here is the caller graph for this function:

◆ geometryTypeToken()

QString openswmmvis::feature::geometryTypeToken ( GeometryType  t)

Stable token for t, for .oswp persistence. Round-trips through geometryTypeFromToken.

◆ isMultiType()

bool openswmmvis::feature::isMultiType ( GeometryType  t)

True when t is one of the Multi* kinds.

Here is the caller graph for this function:

◆ ogrFieldTypeFor()

int openswmmvis::feature::ogrFieldTypeFor ( FieldType  t)

The OGRFieldType constant for t (Boolean is an integer with a subtype; see FeatureStore::createLayer, which sets OFSTBoolean).

Here is the caller graph for this function:

◆ sanitizeFieldName()

QString openswmmvis::feature::sanitizeFieldName ( const QString &  raw)

Make raw safe as an OGR/GeoPackage column name: ASCII letters, digits and underscore, never starting with a digit, at most 63 characters, never one of the reserved names ("fid", "geom").

Returns
An empty string only when raw contains no usable character.
Here is the caller graph for this function:

◆ sanitizeTableName()

QString openswmmvis::feature::sanitizeTableName ( const QString &  raw)

Make raw safe as a GeoPackage table name, on the same rules as sanitizeFieldName plus a "fl_" prefix when raw would otherwise start with a digit.

Here is the caller graph for this function:

◆ toMultiType()

GeometryType openswmmvis::feature::toMultiType ( GeometryType  t)

The Multi* kind corresponding to t (identity for Multi* inputs).

Variable Documentation

◆ kInvalidFeatureId

constexpr FeatureId openswmmvis::feature::kInvalidFeatureId = -1
inlineconstexpr