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
IViewControls.hpp
Go to the documentation of this file.
1
12#pragma once
13#include <QList>
14#include <QObject>
15#include <QString>
16#include <QUuid>
17
19#define OPENSWMM_VIEW_CONTROLS_IID "io.opensimulator.openswmm.IViewControls/1.0"
20
21namespace OpenSWMM::Sdk
22{
24enum class ViewCommandKind : quint32 {
25 RenameLayer = 1,
26 SetLayerVisible = 2,
27 SetLayerOpacity = 3,
28 MoveLayer = 4,
29 RemoveLayer = 5,
30 SetLayerFilter = 6,
32 ActivateResults = 8,
34 9,
36};
37
47 QUuid sessionId;
48 quint64 loadGeneration = 0;
50 QUuid origin;
51 QString text;
52 QString channelId;
53 bool enabled = false;
54 double number = 1.;
55 qint64 index = 0;
56 QList<qint64> featureIds;
57};
58
61{
62public:
64 virtual ~IViewControls() = default;
72 virtual bool executeViewCommand(const ViewCommand &command, QString *error = nullptr) = 0;
79 virtual QList<qint64> selectedLayerFeatures(const QUuid &sessionId, const QUuid &layerSessionId,
80 int offset = 0, int limit = 500) const = 0;
81};
82}
#define OPENSWMM_VIEW_CONTROLS_IID
Frozen discovery identity for validated SDK view commands.
Definition IViewControls.hpp:19
Frozen optional validated controller entry point for view changes.
Definition IViewControls.hpp:61
virtual bool executeViewCommand(const ViewCommand &command, QString *error=nullptr)=0
Apply one validated action through the existing native route.
virtual QList< qint64 > selectedLayerFeatures(const QUuid &sessionId, const QUuid &layerSessionId, int offset=0, int limit=500) const =0
Page through selected vector FIDs without returning native objects.
virtual ~IViewControls()=default
Destroy an implementation; consumers borrow the host-owned service.
Public header-only ABI for independently compiled native GUI extensions.
Definition ExtensionHost.hpp:24
ViewCommandKind
Supported, typed view commands without exposing private Qt slots.
Definition IViewControls.hpp:24
@ ActivateResults
Select the attached source in its 1D/2D dimension.
@ RemoveLayer
Detach through the existing native undo route.
@ SetLayerFilter
text is a validated vector attribute filter, empty clears it.
@ RenameLayer
text is the new nonempty title.
@ SetResultsVariable
text is a stable variable key; channelId selects the 2D sublayer.
@ MoveLayer
index is the absolute bottom-to-top canvas index, within its category group.
@ SetResultsTime
index is a valid published period ordinal; async display can finish later.
@ SetLayerOpacity
number is finite and in [0,1].
@ SelectLayerFeatures
featureIds replaces the vector selection; nonnegative IDs only.
@ SetLayerVisible
enabled is the desired local visibility.
std::uint64_t limit
Definition smsio.cpp:24
Owning bounded request for one native view-controller action.
Definition IViewControls.hpp:45
QUuid origin
Optional caller correlation/feedback-suppression token.
Definition IViewControls.hpp:50
qint64 index
Layer-stack or result-period ordinal according to kind.
Definition IViewControls.hpp:55
QUuid sessionId
Ready open-lifetime identity; never a persistent model UUID.
Definition IViewControls.hpp:47
quint64 loadGeneration
Exact accepted load generation from the adopted view snapshot.
Definition IViewControls.hpp:48
QUuid layerSessionId
Current runtime attachment identity from ViewSnapshot.
Definition IViewControls.hpp:49
QList< qint64 > featureIds
Replacement vector selection, capped at 5000 IDs.
Definition IViewControls.hpp:56
QString text
New title, filter or variable key according to kind.
Definition IViewControls.hpp:51
bool enabled
Desired visibility for SetLayerVisible.
Definition IViewControls.hpp:53
ViewCommandKind kind
Requested operation.
Definition IViewControls.hpp:46
QString channelId
2D semantic result-channel ID; empty for 1D.
Definition IViewControls.hpp:52
double number
Desired opacity for SetLayerOpacity.
Definition IViewControls.hpp:54
double error
Definition terrainerrorfield.cpp:42
double offset
Definition timeseriesassignment.cpp:21