v2.0.0
Loading...
Searching...
No Matches
DISP3DLIB::MultimodalScene Class Reference

Host-app-agnostic controller that owns the ordered renderable set and dispatches picks back to the producing layer. More...

#include <multimodalscene.h>

Public Types

using BoundsFn

Signals

void layersChanged ()
void timeSampleChanged (int sample)
void timeCursorChanged (double seconds)
void overlayThresholdsChanged (float fmin, float fmid, float fmax)
void picked (const DISP3DLIB::PickResult &pick)

Public Member Functions

 MultimodalScene (QObject *parent=nullptr)
 ~MultimodalScene () override
void addLayer (SceneLayer layer)
bool removeLayer (const QString &id)
void clear ()
QVector< SceneLayerlayers () const
const SceneLayerfindLayer (const QString &id) const
void setLayerVisible (const QString &id, bool visible)
void setLayerOpacity (const QString &id, float opacity)
int currentTimeSample () const
void setCurrentTimeSample (int sample)
double timeCursor () const
void setTimeCursor (double seconds)
float overlayFmin () const
float overlayFmid () const
float overlayFmax () const
void setOverlayThresholds (float fmin, float fmid, float fmax)
const PickResultlastPick () const
void reportPick (const PickResult &pick)
void worldBounds (QVector3D &bbMin, QVector3D &bbMax) const
void registerBoundsFn (SceneLayerKind kind, BoundsFn fn)

Detailed Description

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 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 114 of file multimodalscene.h.

Inheritance diagram for DISP3DLIB::MultimodalScene:
Inheritance graph

Member Typedef Documentation

◆ BoundsFn

Initial value:
std::function<bool(const SceneLayer& layer,
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 266 of file multimodalscene.h.

Constructor & Destructor Documentation

◆ MultimodalScene()

MultimodalScene::MultimodalScene ( QObject * parent = nullptr)
explicit

Definition at line 32 of file multimodalscene.cpp.

◆ ~MultimodalScene()

MultimodalScene::~MultimodalScene ( )
overridedefault

Member Function Documentation

◆ 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]layerLayer 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 ( )

Remove every layer.

Definition at line 77 of file multimodalscene.cpp.

◆ 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
[in]idLayer id.
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
Returns
Most recent pick reported via reportPick. Default- constructed (kind == None) until the first hit.

Definition at line 221 of file multimodalscene.cpp.

◆ 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
Returns
Current overlay max threshold. Default 1.

Definition at line 191 of file multimodalscene.cpp.

◆ overlayFmid()

float MultimodalScene::overlayFmid ( ) const
Returns
Current overlay mid threshold. Default 0.5.

Definition at line 184 of file multimodalscene.cpp.

◆ overlayFmin()

float MultimodalScene::overlayFmin ( ) const
Returns
Current overlay min threshold. Default 0.

Definition at line 177 of file multimodalscene.cpp.

◆ overlayThresholdsChanged

void DISP3DLIB::MultimodalScene::overlayThresholdsChanged ( float fmin,
float fmid,
float fmax )
signal

Emitted when any of the shared overlay thresholds change.

◆ picked

void DISP3DLIB::MultimodalScene::picked ( const DISP3DLIB::PickResult & pick)
signal

Emitted when a pick is reported. Pick dock, status bar, and MRI ortho viewer subscribe.

◆ registerBoundsFn()

void MultimodalScene::registerBoundsFn ( SceneLayerKind kind,
BoundsFn fn )

Register an AABB extractor for a given layer kind. Replaces any previously registered fn for that kind.

Definition at line 274 of file multimodalscene.cpp.

◆ removeLayer()

bool MultimodalScene::removeLayer ( const QString & id)

Remove a layer by id.

Parameters
[in]idLayer id supplied to addLayer.
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).

Definition at line 228 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.

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.

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.

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.

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.

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
Returns
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.

Definition at line 236 of file multimodalscene.cpp.


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