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
GISVectorLayer Class Reference

A map layer backed by a GDAL/OGR vector dataset. More...

#include <gisvectorlayer.h>

Inheritance diagram for GISVectorLayer:
Collaboration diagram for GISVectorLayer:

Classes

struct  OgrSublayerInfo
 Lightweight description of one OGR layer inside a datasource, produced by enumerateSublayers() without fully loading it. More...
 
struct  OpenResult
 

Signals

void filePathChanged (const QString &path)
 
void layerNameChanged (const QString &name)
 
void featureCountChanged (int count)
 
void filterExpressionChanged (const QString &expr)
 
void symbolChanged (const GISVectorSymbol &symbol)
 
void selectionChanged (const QSet< long long > &selectedIds)
 
void rendererChanged ()
 Emitted when setRenderer() swaps the renderer pointer.
 
void openFinished (bool ok)
 Emitted on the GUI thread when openAsync() completes.
 
void crsAssumed (const QString &filePath)
 Emitted once when this layer's file declares no CRS and its coordinates are therefore assumed to already be in the canvas CRS.
 
- Signals inherited from OpenSWMMVisLayer
void nameChanged (const QString &newName)
 
void layerTypeChanged (OpenSWMMVisLayerType newType)
 
void visibilityChanged (bool visible)
 
void opacityChanged (double opacity)
 
void srsChanged (SpatialReferenceSystem *newSRS)
 
void extentChanged (const MapExtent &newExtent)
 
void childrenChanged ()
 
void repaintRequested ()
 
void temporalSpecChanged (const OpenSWMM::Render::TemporalSpec &spec)
 
void maskSpecChanged (const OpenSWMM::Render::MaskSpec &spec)
 
void auxStorageSpecChanged (const OpenSWMM::Render::AuxiliaryStorageSpec &spec)
 
void joinsChanged (const QVector< OpenSWMM::Render::JoinSpec > &joins)
 
void diagramSpecChanged (const OpenSWMM::Render::DiagramSpec &spec)
 
void labelConfigChanged ()
 

Public Member Functions

 GISVectorLayer (const QString &filePath, const QString &layerName={}, OpenSWMMVisWorkspace *parent=nullptr)
 
 ~GISVectorLayer () override
 
void openAsync (const QString &filePath, const QString &layerName={})
 Asynchronously open filePath / layerName. GDALOpenEx + GetExtent (which forces a scan on some drivers) run on a worker thread; the layer is populated on the GUI thread and openFinished(bool) fires on completion. Construct with an empty path first; the synchronous openDataset path (tests / project restore) is unchanged.
 
QString filePath () const
 Returns the file path to the OGR dataset.
 
QString ogrLayerName () const
 Returns the OGR sub-layer name opened within the dataset.
 
class OGRLayer * ogrLayer () const
 Read-only OGRLayer handle for callers that need to walk features directly (e.g. mesh-generator constraint pulls). Returns nullptr if the dataset is not open.
 
void appendScenePolygonsTo (QPainterPath &out) const
 Slice Z.14-paint — append every polygon ring this layer currently exposes (post-attribute-filter) to out in canvas-scene coords (Y-flipped, same space the canvas QGraphicsItems paint into).
 
int featureCount () const
 Returns the number of features currently visible (after filtering).
 
QStringList fieldNames () const
 Returns the list of field (attribute column) names.
 
QString sourceDescription () const override
 Human-readable source of this layer: a file path, a service URL, or a description for in-memory / derived layers.
 
QVector< QPair< QString, QString > > extendedMetadata () const override
 Ordered key→value pairs of TYPE-SPECIFIC metadata, rendered by the Metadata tab below the common block the dialog builds itself.
 
QVector< OpenSWMM::Render::AttributeFieldavailableAttributes (OpenSWMMVis::SwmmCategory cat) const override
 
QString filterExpression () const
 Returns the current OGR attribute filter expression.
 
void setFilterExpression (const QString &expr)
 Sets an OGR SQL WHERE-clause filter on the features.
 
GISVectorSymbol symbol () const
 
void setSymbol (const GISVectorSymbol &symbol)
 
void setLabelConfig (const OpenSWMM::Render::LabelConfig &cfg) override
 Slice X.18 — full label configuration.
 
QStringList ogrFieldNames () const
 Names of the OGR fields available for label expressions. Empty when no dataset has been opened yet. Used by the Labels tab to populate the field combobox.
 
std::vector< std::unique_ptr< openswmmvis::ui::ILayerStyleSubject > > styleSubjects () override
 
OpenSWMM::Render::IFeatureRendererrenderer () const
 The IFeatureRenderer that will drive this layer's paint pass.
 
void setRenderer (std::unique_ptr< OpenSWMM::Render::IFeatureRenderer > r)
 Replaces the current renderer.
 
OpenSWMM::Render::RuleListruleList () override
 
const OpenSWMM::Render::RuleListruleList () const override
 
QSet< long long > selectedFeatureIds () const
 Returns the set of currently selected feature IDs.
 
void setSelectedFeatureIds (const QSet< long long > &ids)
 Selects the features with the given IDs (replacing any prior selection).
 
void clearSelection ()
 Clears all selected features.
 
QSet< long long > featureIdsInRect (const MapExtent &rectCanvasCrs) const
 SVBC round B — fids of every feature whose GEOMETRY intersects rectCanvasCrs (OGR bbox prefilter, then precise Intersects). The rect arrives in canvas CRS and is inverse-transformed when the layer is reprojected. Any pre-existing spatial filter is saved and restored (clone dance).
 
QVector< QPointF > selectedFeatureAnchors () const
 Scene-space centres of the selected features' items — beacon anchors for MapCanvas::flashSelection.
 
QList< QVariantMap > identifyAt (double mapX, double mapY, const SpatialReferenceSystem *canvasSRS, double tolerance=1e-6) const
 Returns attributes of features that intersect the given map point.
 
QList< QVariantMap > identifyAt (double mapX, double mapY, double tolerance=1e-6) const
 Convenience overload — no CRS needed (uses current layer CRS).
 
void populateScene (QGraphicsScene *scene, const MapExtent &canvasExtent, const SpatialReferenceSystem *canvasSRS) override
 Creates / updates QGraphicsItems representing this layer in the scene.
 
void depopulateScene (QGraphicsScene *scene) override
 Removes all QGraphicsItems belonging to this layer from the scene.
 
void refreshScene (QGraphicsScene *scene, const MapExtent &canvasExtent, const SpatialReferenceSystem *canvasSRS) override
 Smart scene refresh — updates existing items instead of destroying and recreating.
 
void onCanvasCRSChanged (const SpatialReferenceSystem *newCanvasSRS) override
 Called when the user changes the canvas CRS so layers can pre-compute any CRS-dependent transform caches.
 
- Public Member Functions inherited from OpenSWMMVisLayer
 OpenSWMMVisLayer (OpenSWMMVisWorkspace *parent)
 
 OpenSWMMVisLayer (const QString &name="Unlabeled Layer", OpenSWMMVisWorkspace *parent=nullptr)
 
virtual ~OpenSWMMVisLayer ()
 
QString layerId () const
 Returns the layer's immutable unique identifier (UUID).
 
QString name () const
 Returns the user-visible name of this layer.
 
void setName (const QString &name)
 Sets the user-visible name.
 
OpenSWMMVisLayerType layerType () const
 Returns the layer type discriminator.
 
bool isVisible () const
 Returns true when this layer should be drawn.
 
void setVisible (bool visible)
 Shows or hides this layer.
 
double opacity () const
 Returns the layer opacity in the range [0.0, 1.0]. 0.0 = fully transparent; 1.0 = fully opaque.
 
void setOpacity (double opacity)
 Sets the layer opacity. Values are clamped to [0.0, 1.0].
 
SpatialReferenceSystemsrs () const
 Returns the spatial reference system for this layer, or nullptr if the layer has no known CRS.
 
void setSRS (SpatialReferenceSystem *srs, bool ownsSRS=false)
 Sets (or replaces) the CRS for this layer.
 
QString crsDescription () const
 Returns a human-readable summary of this layer's CRS for display in the Properties window.
 
MapExtent extent () const
 Returns the layer extent in the layer's own CRS.
 
void setExtent (const MapExtent &extent)
 Sets the layer spatial extent (in the layer's CRS).
 
virtual bool isRasterLayer () const
 Returns true for layers that render into a raster buffer (WMS, WMTS, GISRaster) rather than populating QGraphicsItems.
 
virtual bool isBasemapLayer () const
 Returns true for world-spanning basemap layers (XYZ tile providers, WMS/WMTS services covering the whole world) that should NOT be included when computing the data-driven full extent.
 
virtual void render (QPainter *painter, const MapExtent &extent, const QSize &imageSize, const SpatialReferenceSystem *srs)
 Renders this layer's content directly into painter.
 
virtual void fetchCache (const MapExtent &extent, const QSize &viewportSize, const SpatialReferenceSystem *srs)
 Triggers any asynchronous (or synchronous) tile/data fetch needed to populate this layer's internal cache for the given view state.
 
void setViewportSize (int w, int h)
 Called by MapCanvas before refreshScene so layers can request the correct pixel dimensions for tile/image requests.
 
int viewportWidth () const
 
int viewportHeight () const
 
QVector< OpenSWMMVisLayer * > children () const
 Returns the ordered list of child layers.
 
double layerZValue () const
 Returns the z-value base assigned to this layer by the canvas. Items within the layer should use z-values relative to this.
 
void setLayerZValue (double z)
 Called by the canvas to set this layer's z-value band.
 
const OpenSWMM::Render::TemporalSpectemporalSpec () const
 
void setTemporalSpec (const OpenSWMM::Render::TemporalSpec &spec)
 
const OpenSWMM::Render::LabelConfiglabelConfig () const
 
const OpenSWMM::Render::MaskSpecmaskSpec () const
 
void setMaskSpec (const OpenSWMM::Render::MaskSpec &spec)
 
const OpenSWMM::Render::AuxiliaryStorageSpecauxStorageSpec () const
 
void setAuxStorageSpec (const OpenSWMM::Render::AuxiliaryStorageSpec &spec)
 
const QVector< OpenSWMM::Render::JoinSpec > & joins () const
 
void setJoins (const QVector< OpenSWMM::Render::JoinSpec > &joins)
 
const OpenSWMM::Render::DiagramSpecdiagramSpec () const
 
void setDiagramSpec (const OpenSWMM::Render::DiagramSpec &spec)
 
OpenSWMMVisWorkspaceworkspace () const
 
void setBasicAuth (const QString &username, const QString &password)
 Sets HTTP Basic authentication for all subsequent network requests.
 
void setHttpHeaders (const BasemapHttpHeaders &headers)
 Sets arbitrary extra HTTP headers applied to every request.
 
BasemapHttpHeaders httpHeaders () const
 
- Public Member Functions inherited from OpenSWMM::Render::IAttributeProvider
virtual ~IAttributeProvider ()=default
 

Static Public Member Functions

static QList< OgrSublayerInfoenumerateSublayers (const QString &filePath, QString *errorOut=nullptr)
 Enumerate the layers in a vector datasource without fully loading any of them. Opens read-only, reads each OGR layer's name / geometry / feature-count / CRS, then closes.
 

Protected Member Functions

void setOpenFlags (unsigned flags)
 GDALOpenEx flags used by openDataset and openAsync.
 
unsigned openFlags () const
 
GDALDataset * dataset () const
 The open dataset, or nullptr. Non-owning; the layer closes it. Exposed for subclasses that must reach GDAL directly (schema changes, transaction control).
 
void markSceneDirty ()
 Force the next populateScene() to rebuild its items. Call after mutating the underlying dataset so the scene reflects the write; refreshScene() alone short-circuits on a clean dirty flag.
 
void openDataset (const QString &filePath, const QString &layerName)
 Open filePath / layerName synchronously.
 
void closeDataset ()
 Closes whatever is open, releasing the dataset.
 
- Protected Member Functions inherited from OpenSWMMVisLayer
bool addChild (OpenSWMMVisLayer *child)
 
bool removeChild (OpenSWMMVisLayer *child)
 
void setLayerType (OpenSWMMVisLayerType type)
 

Properties

QString filePath
 
QString layerName
 
int featureCount
 
QString filterExpr
 
GISVectorSymbol symbol
 
- Properties inherited from OpenSWMMVisLayer
QString Name
 
bool Visible
 
double Opacity
 
QString LayerId
 
OpenSWMMVisLayerType LayerType
 
QVector< OpenSWMMVisLayer * > Children
 
QString CRS
 

Additional Inherited Members

- Public Types inherited from OpenSWMMVisLayer
enum  OpenSWMMVisLayerType {
  SWMMDefaultLayer = 0 ,
  SWMMModelLayer = 1 ,
  SWMMResultsLayer = 2 ,
  SWMMGISLayer = 3 ,
  SWMMVectorLayer = 4 ,
  SWMMRasterLayer = 5 ,
  SWMMImageryLayer = 6 ,
  SWMMTabularDataLayer = 7 ,
  SWMMTabularyTimeSeriesLayer = 8 ,
  SWMMSubProjectLayer = 9 ,
  SWMMWMSLayer = 10 ,
  SWMMWMTSLayer = 11 ,
  SWMM2DMeshLayer = 12 ,
  SWMM2DResultsLayer = 13 ,
  SWMMAnnotationLayer = 14 ,
  SWMMFeatureLayer = 15
}
 Discriminator for the concrete layer class. More...
 
- Protected Attributes inherited from OpenSWMMVisLayer
QByteArray m_authHeader
 "Basic <base64>" or empty
 
BasemapHttpHeaders m_httpHeaders
 arbitrary headers (incl. "referer")
 

Detailed Description

A map layer backed by a GDAL/OGR vector dataset.

Loads any OGR-supported format (Shapefile, GeoPackage, GeoJSON, …), reads features, reprojects them to the canvas CRS on the fly using OGRCoordinateTransformation, and renders with a configurable symbol.

The layer also supports:

  • Per-field attribute queries (filter expression).
  • Feature selection tracking.
  • An identify operation returning attributes as QVariantMap.

Constructor & Destructor Documentation

◆ GISVectorLayer()

GISVectorLayer::GISVectorLayer ( const QString &  filePath,
const QString &  layerName = {},
OpenSWMMVisWorkspace parent = nullptr 
)
explicit
Here is the call graph for this function:

◆ ~GISVectorLayer()

GISVectorLayer::~GISVectorLayer ( )
override
Here is the call graph for this function:

Member Function Documentation

◆ appendScenePolygonsTo()

void GISVectorLayer::appendScenePolygonsTo ( QPainterPath &  out) const

Slice Z.14-paint — append every polygon ring this layer currently exposes (post-attribute-filter) to out in canvas-scene coords (Y-flipped, same space the canvas QGraphicsItems paint into).

Multi-polygons contribute each sub-polygon's exterior + holes. Non-polygon geometries are skipped silently — callers (e.g. the mask-clip resolver) treat that as an empty result and fall back to unclipped paint.

Idempotent w.r.t. the spatial-filter rectangle the canvas has set on the underlying OGRLayer; the method clears the filter, iterates every feature, then restores the prior filter so concurrent canvas painting isn't disturbed.

◆ availableAttributes()

QVector< OpenSWMM::Render::AttributeField > GISVectorLayer::availableAttributes ( OpenSWMMVis::SwmmCategory  cat) const
overridevirtual

Available themeable fields for cat. Empty list is a valid answer — means the layer doesn't surface per-feature attributes on this category (e.g. SWMMModelLayer::CatRainGages has no per- feature engine fields).

Order = preferred picker order. Callers should NOT re-sort.

Implements OpenSWMM::Render::IAttributeProvider.

◆ clearSelection()

void GISVectorLayer::clearSelection ( )

Clears all selected features.

Here is the call graph for this function:

◆ closeDataset()

void GISVectorLayer::closeDataset ( )
protected

Closes whatever is open, releasing the dataset.

Here is the caller graph for this function:

◆ crsAssumed

void GISVectorLayer::crsAssumed ( const QString &  filePath)
signal

Emitted once when this layer's file declares no CRS and its coordinates are therefore assumed to already be in the canvas CRS.

Not an error — local-coordinate data legitimately has no CRS, and this is what the layer has always done. It is surfaced so a layer that lands in the wrong place has a stated reason.

◆ dataset()

GDALDataset * GISVectorLayer::dataset ( ) const
inlineprotected

The open dataset, or nullptr. Non-owning; the layer closes it. Exposed for subclasses that must reach GDAL directly (schema changes, transaction control).

Here is the caller graph for this function:

◆ depopulateScene()

void GISVectorLayer::depopulateScene ( QGraphicsScene *  scene)
overridevirtual

Removes all QGraphicsItems belonging to this layer from the scene.

Reimplemented from OpenSWMMVisLayer.

Here is the caller graph for this function:

◆ enumerateSublayers()

QList< GISVectorLayer::OgrSublayerInfo > GISVectorLayer::enumerateSublayers ( const QString &  filePath,
QString *  errorOut = nullptr 
)
static

Enumerate the layers in a vector datasource without fully loading any of them. Opens read-only, reads each OGR layer's name / geometry / feature-count / CRS, then closes.

Parameters
filePathDatasource path (GeoPackage, File GDB, GML, …).
errorOutOptional; set to a human-readable message on failure.
Returns
One entry per layer; empty on failure or when the path is not a readable vector datasource.
Here is the call graph for this function:

◆ extendedMetadata()

QVector< QPair< QString, QString > > GISVectorLayer::extendedMetadata ( ) const
overridevirtual

Ordered key→value pairs of TYPE-SPECIFIC metadata, rendered by the Metadata tab below the common block the dialog builds itself.

Default empty. Subclasses add only what is unique to them (e.g. a mesh: vertices / cells / edges / elevation range). QVector<QPair> preserves insertion order without a new type.

Reimplemented from OpenSWMMVisLayer.

Here is the call graph for this function:

◆ featureCount()

int GISVectorLayer::featureCount ( ) const

Returns the number of features currently visible (after filtering).

◆ featureCountChanged

void GISVectorLayer::featureCountChanged ( int  count)
signal

◆ featureIdsInRect()

QSet< long long > GISVectorLayer::featureIdsInRect ( const MapExtent rectCanvasCrs) const

SVBC round B — fids of every feature whose GEOMETRY intersects rectCanvasCrs (OGR bbox prefilter, then precise Intersects). The rect arrives in canvas CRS and is inverse-transformed when the layer is reprojected. Any pre-existing spatial filter is saved and restored (clone dance).

Here is the call graph for this function:

◆ fieldNames()

QStringList GISVectorLayer::fieldNames ( ) const

Returns the list of field (attribute column) names.

Here is the caller graph for this function:

◆ filePath()

QString GISVectorLayer::filePath ( ) const

Returns the file path to the OGR dataset.

◆ filePathChanged

void GISVectorLayer::filePathChanged ( const QString &  path)
signal

◆ filterExpression()

QString GISVectorLayer::filterExpression ( ) const

Returns the current OGR attribute filter expression.

Here is the caller graph for this function:

◆ filterExpressionChanged

void GISVectorLayer::filterExpressionChanged ( const QString &  expr)
signal
Here is the caller graph for this function:

◆ identifyAt() [1/2]

QList< QVariantMap > GISVectorLayer::identifyAt ( double  mapX,
double  mapY,
const SpatialReferenceSystem canvasSRS,
double  tolerance = 1e-6 
) const

Returns attributes of features that intersect the given map point.

Parameters
mapXX coordinate in the canvas CRS.
mapYY coordinate in the canvas CRS.
canvasSRSCanvas CRS used for the point coordinates (may be nullptr).
toleranceSearch tolerance in map units.
Returns
List of QVariantMaps, one per matching feature.
Here is the caller graph for this function:

◆ identifyAt() [2/2]

QList< QVariantMap > GISVectorLayer::identifyAt ( double  mapX,
double  mapY,
double  tolerance = 1e-6 
) const

Convenience overload — no CRS needed (uses current layer CRS).

Here is the call graph for this function:

◆ layerNameChanged

void GISVectorLayer::layerNameChanged ( const QString &  name)
signal

◆ markSceneDirty()

void GISVectorLayer::markSceneDirty ( )
inlineprotected

Force the next populateScene() to rebuild its items. Call after mutating the underlying dataset so the scene reflects the write; refreshScene() alone short-circuits on a clean dirty flag.

◆ ogrFieldNames()

QStringList GISVectorLayer::ogrFieldNames ( ) const

Names of the OGR fields available for label expressions. Empty when no dataset has been opened yet. Used by the Labels tab to populate the field combobox.

◆ ogrLayer()

class OGRLayer * GISVectorLayer::ogrLayer ( ) const
inline

Read-only OGRLayer handle for callers that need to walk features directly (e.g. mesh-generator constraint pulls). Returns nullptr if the dataset is not open.

Here is the caller graph for this function:

◆ ogrLayerName()

QString GISVectorLayer::ogrLayerName ( ) const

Returns the OGR sub-layer name opened within the dataset.

Here is the caller graph for this function:

◆ onCanvasCRSChanged()

void GISVectorLayer::onCanvasCRSChanged ( const SpatialReferenceSystem newCanvasSRS)
overridevirtual

Called when the user changes the canvas CRS so layers can pre-compute any CRS-dependent transform caches.

Parameters
newCanvasSRSThe new canvas CRS.

Reimplemented from OpenSWMMVisLayer.

◆ openAsync()

void GISVectorLayer::openAsync ( const QString &  filePath,
const QString &  layerName = {} 
)

Asynchronously open filePath / layerName. GDALOpenEx + GetExtent (which forces a scan on some drivers) run on a worker thread; the layer is populated on the GUI thread and openFinished(bool) fires on completion. Construct with an empty path first; the synchronous openDataset path (tests / project restore) is unchanged.

◆ openDataset()

void GISVectorLayer::openDataset ( const QString &  filePath,
const QString &  layerName 
)
protected

Open filePath / layerName synchronously.

Protected rather than private because a subclass may produce its own dataset — WFSLayer fetches one over the network and hands GDAL the bytes — and has to open and close it itself.

Here is the caller graph for this function:

◆ openFinished

void GISVectorLayer::openFinished ( bool  ok)
signal

Emitted on the GUI thread when openAsync() completes.

Here is the caller graph for this function:

◆ openFlags()

unsigned GISVectorLayer::openFlags ( ) const
inlineprotected

◆ populateScene()

void GISVectorLayer::populateScene ( QGraphicsScene *  scene,
const MapExtent canvasExtent,
const SpatialReferenceSystem canvasSRS 
)
overridevirtual

Creates / updates QGraphicsItems representing this layer in the scene.

Derived classes override this to add their items to the scene. Items should be created in scene coordinates (= map CRS coordinates) after reprojecting from the layer's native CRS.

Called by the MapCanvas when:

  • The layer is first added.
  • The canvas CRS changes (after onCanvasCRSChanged).
  • The layer data changes (model loaded, tile fetched, etc.).
Parameters
sceneThe shared OpenSWMMVisScene to add items to.
canvasExtentVisible extent in canvas-CRS coordinates.
canvasSRSThe CRS currently used by the MapCanvas.

Implements OpenSWMMVisLayer.

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

◆ refreshScene()

void GISVectorLayer::refreshScene ( QGraphicsScene *  scene,
const MapExtent canvasExtent,
const SpatialReferenceSystem canvasSRS 
)
overridevirtual

Smart scene refresh — updates existing items instead of destroying and recreating.

Override in subclasses to provide efficient incremental updates. The default implementation calls depopulateScene() then populateScene(), which is backward-compatible but causes flicker for raster/tile layers.

Raster/WMS layers should override to keep persistent scene items and update them in-place. Vector layers should override to skip rebuilding when only the view extent has changed (items are already in scene coords).

Reimplemented from OpenSWMMVisLayer.

Here is the call graph for this function:

◆ renderer()

OpenSWMM::Render::IFeatureRenderer * GISVectorLayer::renderer ( ) const
virtual

The IFeatureRenderer that will drive this layer's paint pass.

Constructed eagerly as a default SingleSymbolRenderer so callers never have to null-check. Owned by the layer.

Reimplemented from OpenSWMMVisLayer.

Here is the call graph for this function:

◆ rendererChanged

void GISVectorLayer::rendererChanged ( )
signal

Emitted when setRenderer() swaps the renderer pointer.

Here is the caller graph for this function:

◆ ruleList() [1/2]

const OpenSWMM::Render::RuleList * GISVectorLayer::ruleList ( ) const
overridevirtual

Reimplemented from OpenSWMMVisLayer.

◆ ruleList() [2/2]

OpenSWMM::Render::RuleList * GISVectorLayer::ruleList ( )
overridevirtual

Reimplemented from OpenSWMMVisLayer.

◆ selectedFeatureAnchors()

QVector< QPointF > GISVectorLayer::selectedFeatureAnchors ( ) const

Scene-space centres of the selected features' items — beacon anchors for MapCanvas::flashSelection.

◆ selectedFeatureIds()

QSet< long long > GISVectorLayer::selectedFeatureIds ( ) const

Returns the set of currently selected feature IDs.

Here is the caller graph for this function:

◆ selectionChanged

void GISVectorLayer::selectionChanged ( const QSet< long long > &  selectedIds)
signal
Here is the caller graph for this function:

◆ setFilterExpression()

void GISVectorLayer::setFilterExpression ( const QString &  expr)

Sets an OGR SQL WHERE-clause filter on the features.

Parameters
exprOGR attribute filter, e.g. "population > 1000000". Pass an empty string to remove the filter.
Here is the call graph for this function:

◆ setLabelConfig()

void GISVectorLayer::setLabelConfig ( const OpenSWMM::Render::LabelConfig cfg)
overridevirtual

Slice X.18 — full label configuration.

   Wraps the legacy `GISVectorSymbol::showLabels` /
   `labelField` / `labelFont` / `labelColor` fields plus
   halo, placement, and scale-range so the Labels tab of
   LayerStyleDialog has somewhere coherent to write. 

Reimplemented from OpenSWMMVisLayer.

Here is the call graph for this function:

◆ setOpenFlags()

void GISVectorLayer::setOpenFlags ( unsigned  flags)
inlineprotected

GDALOpenEx flags used by openDataset and openAsync.

Read-only by default — every vector source in the application is read-only except an editable feature layer. FeatureLayer sets GDAL_OF_VECTOR | GDAL_OF_UPDATE via setOpenFlags so it can write through the same handle the paint loop reads, instead of re-opening the GeoPackage after every edit.

A subclass that changes the flags MUST construct with an empty filePath (the ctor only opens when the path is non-empty) and call openDataset itself afterwards; the base ctor runs before the subclass exists.

Here is the caller graph for this function:

◆ setRenderer()

void GISVectorLayer::setRenderer ( std::unique_ptr< OpenSWMM::Render::IFeatureRenderer r)
virtual

Replaces the current renderer.

The layer takes ownership. A null pointer is rejected (the method silently no-ops). Emits rendererChanged() when the renderer pointer actually changes.

Reimplemented from OpenSWMMVisLayer.

Here is the call graph for this function:

◆ setSelectedFeatureIds()

void GISVectorLayer::setSelectedFeatureIds ( const QSet< long long > &  ids)

Selects the features with the given IDs (replacing any prior selection).

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

◆ setSymbol()

void GISVectorLayer::setSymbol ( const GISVectorSymbol symbol)
Here is the call graph for this function:
Here is the caller graph for this function:

◆ sourceDescription()

QString GISVectorLayer::sourceDescription ( ) const
overridevirtual

Human-readable source of this layer: a file path, a service URL, or a description for in-memory / derived layers.

Default empty — the dialog shows "(none)". Concrete layers override to return their real origin (e.g. modelFilePath(), resultsFilePath(), serviceUrl(), or "(generated mesh)").

Reimplemented from OpenSWMMVisLayer.

Reimplemented in WFSLayer.

◆ styleSubjects()

std::vector< std::unique_ptr< openswmmvis::ui::ILayerStyleSubject > > GISVectorLayer::styleSubjects ( )
overridevirtual

Slice U-7 — expose the GISVectorSymbol via a QObject adapter as the single styleable subject for the unified LayerStyleDialog.

Reimplemented from OpenSWMMVisLayer.

Here is the call graph for this function:

◆ symbol()

GISVectorSymbol GISVectorLayer::symbol ( ) const

◆ symbolChanged

void GISVectorLayer::symbolChanged ( const GISVectorSymbol symbol)
signal
Here is the caller graph for this function:

Property Documentation

◆ featureCount

int GISVectorLayer::featureCount
read

◆ filePath

QString GISVectorLayer::filePath
read

◆ filterExpr

QString GISVectorLayer::filterExpr
readwrite

◆ layerName

QString GISVectorLayer::layerName
read

◆ symbol

GISVectorSymbol GISVectorLayer::symbol
readwrite

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