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

#include <tabulardatalayer.h>

Inheritance diagram for TabularDataLayer:
Collaboration diagram for TabularDataLayer:

Signals

void dataLoaded ()
 
- 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

 TabularDataLayer (const QString &name="Untitled Table", OpenSWMMVisWorkspace *parent=nullptr)
 
 ~TabularDataLayer () override
 
QString sourcePath () const
 
QString sourceDescription () const override
 Human-readable source of this layer: a file path, a service URL, or a description for in-memory / derived layers.
 
QStringList columnHeaders () const
 
QVector< QVariantMap > rows () const
 
int rowCount () const
 
QVariantMap row (int idx) const
 
bool loadDelimited (const QString &path, QChar delimiter, QString *errorOut=nullptr)
 
bool loadFromFile (const QString &path, QString *errorOut=nullptr)
 
void render (QPainter *painter, const MapExtent &extent, const QSize &imageSize, const SpatialReferenceSystem *srs) override
 
void populateScene (QGraphicsScene *scene, const MapExtent &canvasExtent, const SpatialReferenceSystem *canvasSRS) override
 
- 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 QVector< QPair< QString, QString > > extendedMetadata () const
 Ordered key→value pairs of TYPE-SPECIFIC metadata, rendered by the Metadata tab below the common block the dialog builds itself.
 
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 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.
 
virtual void depopulateScene (QGraphicsScene *scene)
 Removes all QGraphicsItems belonging to this layer from the scene.
 
virtual void refreshScene (QGraphicsScene *scene, const MapExtent &canvasExtent, const SpatialReferenceSystem *canvasSRS)
 Smart scene refresh — updates existing items instead of destroying and recreating.
 
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.
 
virtual std::vector< std::unique_ptr< openswmmvis::ui::ILayerStyleSubject > > styleSubjects ()
 Slice U-2 — return the styleable subjects for the unified LayerStyleDialog.
 
void setLayerZValue (double z)
 Called by the canvas to set this layer's z-value band.
 
virtual void onCanvasCRSChanged (const SpatialReferenceSystem *newCanvasSRS)
 Called when the user changes the canvas CRS so layers can pre-compute any CRS-dependent transform caches.
 
virtual OpenSWMM::Render::IFeatureRendererrenderer () const
 
virtual void setRenderer (std::unique_ptr< OpenSWMM::Render::IFeatureRenderer >)
 
virtual OpenSWMM::Render::RuleListruleList ()
 
virtual const OpenSWMM::Render::RuleListruleList () const
 
const OpenSWMM::Render::TemporalSpectemporalSpec () const
 
void setTemporalSpec (const OpenSWMM::Render::TemporalSpec &spec)
 
const OpenSWMM::Render::LabelConfiglabelConfig () const
 
virtual void setLabelConfig (const OpenSWMM::Render::LabelConfig &cfg)
 
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
 

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 Member Functions inherited from OpenSWMMVisLayer
bool addChild (OpenSWMMVisLayer *child)
 
bool removeChild (OpenSWMMVisLayer *child)
 
void setLayerType (OpenSWMMVisLayerType type)
 
- Protected Attributes inherited from OpenSWMMVisLayer
QByteArray m_authHeader
 "Basic <base64>" or empty
 
BasemapHttpHeaders m_httpHeaders
 arbitrary headers (incl. "referer")
 
- Properties inherited from OpenSWMMVisLayer
QString Name
 
bool Visible
 
double Opacity
 
QString LayerId
 
OpenSWMMVisLayerType LayerType
 
QVector< OpenSWMMVisLayer * > Children
 
QString CRS
 

Constructor & Destructor Documentation

◆ TabularDataLayer()

TabularDataLayer::TabularDataLayer ( const QString &  name = "Untitled Table",
OpenSWMMVisWorkspace parent = nullptr 
)
explicit
Here is the call graph for this function:

◆ ~TabularDataLayer()

TabularDataLayer::~TabularDataLayer ( )
overridedefault

Member Function Documentation

◆ columnHeaders()

QStringList TabularDataLayer::columnHeaders ( ) const
inline

Column names in insertion order (== first-row headers).

◆ dataLoaded

void TabularDataLayer::dataLoaded ( )
signal

Emitted after a successful loadFromFile / loadDelimited. Consumers (Attribute Table panel) refresh their views.

Here is the caller graph for this function:

◆ loadDelimited()

bool TabularDataLayer::loadDelimited ( const QString &  path,
QChar  delimiter,
QString *  errorOut = nullptr 
)

Load CSV — RFC-4180-ish. First row is treated as headers. Comma-separated; double-quote escaping supported. TSV is the same path with a tab delimiter. Returns true on success; on failure sets *errorOut if non-null and leaves the layer's previous contents intact.

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

◆ loadFromFile()

bool TabularDataLayer::loadFromFile ( const QString &  path,
QString *  errorOut = nullptr 
)

Convenience: pick the delimiter from the file extension (.csv,; .tsv\t). XLSX falls through to a not-yet-implemented stub (queued for QXlsx integration).

Here is the call graph for this function:

◆ populateScene()

void TabularDataLayer::populateScene ( QGraphicsScene *  scene,
const MapExtent canvasExtent,
const SpatialReferenceSystem canvasSRS 
)
inlineoverridevirtual

Non-spatial — no scene items. The pure-virtual base needs an implementation; we just don't add anything to the scene.

Implements OpenSWMMVisLayer.

◆ render()

void TabularDataLayer::render ( QPainter *  painter,
const MapExtent extent,
const QSize &  imageSize,
const SpatialReferenceSystem srs 
)
inlineoverridevirtual

Non-spatial layer — paint is a no-op.

Reimplemented from OpenSWMMVisLayer.

Here is the call graph for this function:

◆ row()

QVariantMap TabularDataLayer::row ( int  idx) const

Read access to one row by index. Returns an empty map if out of range.

Here is the caller graph for this function:

◆ rowCount()

int TabularDataLayer::rowCount ( ) const
inline

Total row count.

◆ rows()

QVector< QVariantMap > TabularDataLayer::rows ( ) const
inline

Snapshot of all rows. Each row is a {header → value} map.

Here is the caller graph for this function:

◆ sourceDescription()

QString TabularDataLayer::sourceDescription ( ) const
inlineoverridevirtual

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.

Here is the call graph for this function:

◆ sourcePath()

QString TabularDataLayer::sourcePath ( ) const

Source file path the data was loaded from (empty if rows were set programmatically). Returned as an absolute path so the Properties window shows the full on-disk location.

Here is the caller graph for this function:

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