Host-app-agnostic controller that owns the ordered renderable set and dispatches picks back to the producing layer.
More...
#include <multimodalscene.h>
Host-app-agnostic controller that owns the ordered renderable set and dispatches picks back to the producing layer.
Responsibilities:
- Maintain an ordered registry of SceneLayer payloads keyed by id.
- Emit layersChanged whenever a layer is added, removed, or its visibility/opacity flips, so the renderer can rebuild its draw list.
- Maintain a shared timeline (current time index) that data overlays across modalities consume; emits timeSampleChanged.
- Maintain the most recent DISP3DLIB::PickResult and emit picked when a layer producer reports a hit; consumers (Pick dock, status bar, MRI ortho viewer) subscribe to that signal.
The class is non-virtual on purpose: it is a pure data/dispatch hub with no rendering logic. The renderer (BrainRenderer or a future MultimodalRenderer) reads layers via layers() and per-kind downcasts the payload pointer.
Definition at line 119 of file multimodalscene.h.
◆ BoundsFn
Initial value:
QVector3D& bbMin,
QVector3D& bbMax)>
Opaque, type-erased handle to a layer payload.
Per-kind callback that returns a layer's AABB in world coordinates. The host registers one fn per payload type it actually loads. Layers whose kind has no registered fn are silently skipped during bounds computation.
Definition at line 290 of file multimodalscene.h.
◆ MultimodalScene()
| MultimodalScene::MultimodalScene |
( |
QObject * | parent = nullptr | ) |
|
|
explicit |
◆ ~MultimodalScene()
| MultimodalScene::~MultimodalScene |
( |
| ) |
|
|
overridedefault |
◆ addLayer()
| void MultimodalScene::addLayer |
( |
SceneLayer | layer | ) |
|
Add or replace a layer.
If a layer with the same SceneLayer::id already exists, the stored layer is overwritten in place (preserving its slot in the draw order). Otherwise the new layer is appended to its kind's group.
- Parameters
-
| [in] | layer | Layer record. The caller retains ownership of the underlying payload via the shared_ptr. |
Definition at line 43 of file multimodalscene.cpp.
◆ clear()
| void MultimodalScene::clear |
( |
| ) |
|
◆ currentTimeSample()
| int MultimodalScene::currentTimeSample |
( |
| ) |
const |
- Returns
- Current shared time index (used by data overlays). -1 if no time-resolved data is loaded.
Definition at line 138 of file multimodalscene.cpp.
◆ findLayer()
| const SceneLayer * MultimodalScene::findLayer |
( |
const QString & | id | ) |
const |
- Parameters
-
- Returns
- Pointer to the layer with the given id, or nullptr. The pointer is valid only until the next mutation.
Definition at line 96 of file multimodalscene.cpp.
◆ lastPick()
| const PickResult & MultimodalScene::lastPick |
( |
| ) |
const |
◆ layers()
| QVector< SceneLayer > MultimodalScene::layers |
( |
| ) |
const |
- Returns
- All layers in current draw order (sorted by kind, then by drawOrder, then by insertion order).
Definition at line 89 of file multimodalscene.cpp.
◆ layersChanged
| void DISP3DLIB::MultimodalScene::layersChanged |
( |
| ) |
|
|
signal |
Emitted whenever the layer set or any layer flag (visibility, opacity, drawOrder) changes. The renderer should treat this as "rebuild the draw list".
◆ overlayFmax()
| float MultimodalScene::overlayFmax |
( |
| ) |
const |
◆ overlayFmid()
| float MultimodalScene::overlayFmid |
( |
| ) |
const |
◆ overlayFmin()
| float MultimodalScene::overlayFmin |
( |
| ) |
const |
◆ overlayThresholdsChanged
| void DISP3DLIB::MultimodalScene::overlayThresholdsChanged |
( |
float | fmin, |
|
|
float | fmid, |
|
|
float | fmax ) |
|
signal |
Emitted when any of the shared overlay thresholds change.
◆ picked
Emitted when a pick is reported. Pick dock, status bar, and MRI ortho viewer subscribe.
◆ registerBoundsFn()
Register an AABB extractor for a given layer kind. Replaces any previously registered fn for that kind.
- Parameters
-
| [in] | kind | Layer kind the extractor handles. |
| [in] | fn | Extractor returning false when the layer has no bounds. |
Definition at line 272 of file multimodalscene.cpp.
◆ removeLayer()
| bool MultimodalScene::removeLayer |
( |
const QString & | id | ) |
|
Remove a layer by id.
- Parameters
-
- Returns
- true if a layer was removed, false if the id was unknown.
Definition at line 63 of file multimodalscene.cpp.
◆ reportPick()
| void MultimodalScene::reportPick |
( |
const PickResult & | pick | ) |
|
Report a pick result from a layer's renderer or hit-tester. Emits picked. Used by both real ray-cast picking and synthetic picks (e.g. wizard "show this contact" navigation).
- Parameters
-
| [in] | pick | Pick result to store as the last pick and broadcast. |
Definition at line 226 of file multimodalscene.cpp.
◆ setCurrentTimeSample()
| void MultimodalScene::setCurrentTimeSample |
( |
int | sample | ) |
|
Set the current time index. Emits timeSampleChanged if it actually changes. Negative values are clamped to -1.
- Parameters
-
| [in] | sample | New time sample index, or -1 for no time-resolved data. |
Definition at line 145 of file multimodalscene.cpp.
◆ setLayerOpacity()
| void MultimodalScene::setLayerOpacity |
( |
const QString & | id, |
|
|
float | opacity ) |
Set per-layer opacity in [0, 1]. No-op if the id is unknown.
- Parameters
-
| [in] | id | Layer id. |
| [in] | opacity | Opacity, clamped to [0, 1]. |
Definition at line 122 of file multimodalscene.cpp.
◆ setLayerVisible()
| void MultimodalScene::setLayerVisible |
( |
const QString & | id, |
|
|
bool | visible ) |
Toggle visibility of a layer. No-op if the id is unknown.
- Parameters
-
| [in] | id | Layer id. |
| [in] | visible | True to show the layer, false to hide it. |
Definition at line 107 of file multimodalscene.cpp.
◆ setOverlayThresholds()
| void MultimodalScene::setOverlayThresholds |
( |
float | fmin, |
|
|
float | fmid, |
|
|
float | fmax ) |
Set the shared (fmin, fmid, fmax) overlay thresholds used by the data-driven Overlay dock and the renderables it drives. The values are clamped to fmin <= fmid <= fmax. Emits overlayThresholdsChanged if any value actually changes.
- Parameters
-
| [in] | fmin | Minimum threshold. |
| [in] | fmid | Mid threshold, raised to fmin if smaller. |
| [in] | fmax | Maximum threshold, raised to fmid if smaller. |
Definition at line 198 of file multimodalscene.cpp.
◆ setTimeCursor()
| void MultimodalScene::setTimeCursor |
( |
double | seconds | ) |
|
Set the shared time cursor in seconds. Emits timeCursorChanged if the value actually changes.
- Parameters
-
| [in] | seconds | New time cursor position in seconds. |
Definition at line 166 of file multimodalscene.cpp.
◆ timeCursor()
| double MultimodalScene::timeCursor |
( |
| ) |
const |
- Returns
- Current shared time cursor in seconds. Independent of the integer-sample timeline (currentTimeSample) — overlay widgets that drive a continuous time slider operate in seconds. Default 0.
Definition at line 159 of file multimodalscene.cpp.
◆ timeCursorChanged
| void DISP3DLIB::MultimodalScene::timeCursorChanged |
( |
double | seconds | ) |
|
|
signal |
Emitted when the shared time cursor (seconds) changes. Driven by the Overlay dock's continuous time slider; consumed by per-sample value lookup on electrodes / surface overlays.
◆ timeSampleChanged
| void DISP3DLIB::MultimodalScene::timeSampleChanged |
( |
int | sample | ) |
|
|
signal |
Emitted when the shared time index changes. Data overlays and timeline scrubbers subscribe.
◆ worldBounds()
| void MultimodalScene::worldBounds |
( |
QVector3D & | bbMin, |
|
|
QVector3D & | bbMax ) const |
Scene-wide axis-aligned bounding box union of all visible layers, computed by the supplied per-kind extractor. The scene itself does not know how to read each payload type; the host registers extractors via registerBoundsFn.
- Parameters
-
| [out] | bbMin | Minimum corner of the union box; (-1, -1, -1) if no layer contributed. |
| [out] | bbMax | Maximum corner of the union box; (1, 1, 1) if no layer contributed. |
Definition at line 234 of file multimodalscene.cpp.
The documentation for this class was generated from the following files: