![]() |
SWMMVis
6.0.0-alpha.4
Qt6/C++ GIS-based graphical user interface for the SWMMVis engine (6.0.0-alpha.4)
|
#include "layers/gisvectorlayer.h"#include "feature/featuregeometry.h"#include "feature/featurestore.h"#include "feature/featuretypes.h"#include <QJsonObject>#include <QString>#include <QVector>#include <memory>Go to the source code of this file.
Classes | |
| struct | ZPolicy |
| How a layer's vertex Z values are obtained (PLAN §4.1). More... | |
| class | FeatureLayer |
| An editable, GeoPackage-backed vector layer. More... | |
Enumerations | |
| enum class | FeatureLayerRole { General = 0 , DomainBoundary , Breakline , Region , ParameterZone , SwmmDelineation , BoundaryCondition } |
| What a feature layer is FOR. More... | |
Functions | |
| QString | featureLayerRoleLabel (FeatureLayerRole r) |
| QString | featureLayerRoleToken (FeatureLayerRole r) |
| FeatureLayerRole | featureLayerRoleFromToken (const QString &token) |
| openswmmvis::feature::Schema | featureLayerRoleTemplate (FeatureLayerRole r) |
The fields a newly created layer of role r starts with. | |
| openswmmvis::feature::GeometryType | featureLayerRoleGeometry (FeatureLayerRole r) |
| The geometry type a role implies, for the New-layer dialog's default. GeometryType::None when the role does not imply one. | |
An EDITABLE vector layer: user-drawn points, lines and polygons (with holes and multiple parts) carrying a user-defined attribute schema, stored in the project GeoPackage (workplans/MESH_DIALOG_TABS_AND_FEATURE_LAYERS_PLAN_2026-09-07.md §3, D1/D2).
Everything about DISPLAYING an OGR table is already solved by the base: populateScene renders polygons with interior rings (gisvectorlayer.cpp:885), tags every scene item with its FID (:779-788), reprojects to the canvas CRS, and supplies identify, selection sync, symbology, labels, rules and the style-dialog subject. FeatureLayer adds only what is genuinely new — a write path, an authored schema, a Z policy and a role — and inherits the rest.
The base is opened GDAL_OF_UPDATE (via GISVectorLayer::setOpenFlags) and the layer's FeatureStore is ATTACHED to that same GDALDataset / OGRLayer rather than opening its own. Two SQLite handles on one GeoPackage would be legal but would need cache-coherency care after every write; one handle needs none.
GUI thread only, like every other layer. Mesh generation and attribute assignment continue to re-open the .gpkg READ-ONLY by path on their workers (meshgenerationdialog.h:89-92, meshattributeassigndialog.h:44-47); that is safe because every write here is flushed immediately and no long-lived SQL transaction is held open.
|
strong |
What a feature layer is FOR.
A role is a schema template plus a label — never a behaviour switch. The layer stays a plain OGR table whatever its role, so every existing consumer that accepts "a vector layer" keeps working unchanged (PLAN §6). The role only drives: the fields pre-filled by the New Feature Layer dialog, the glyph shown beside the layer in the mesh dialog's combos, and which "Use as …" shortcuts are offered.
| FeatureLayerRole featureLayerRoleFromToken | ( | const QString & | token | ) |
| openswmmvis::feature::GeometryType featureLayerRoleGeometry | ( | FeatureLayerRole | r | ) |
The geometry type a role implies, for the New-layer dialog's default. GeometryType::None when the role does not imply one.
| QString featureLayerRoleLabel | ( | FeatureLayerRole | r | ) |
| openswmmvis::feature::Schema featureLayerRoleTemplate | ( | FeatureLayerRole | r | ) |
The fields a newly created layer of role r starts with.
| QString featureLayerRoleToken | ( | FeatureLayerRole | r | ) |