TimeController
TimeController
Owns global visualization time state without Qt dependencies.
#include <TimeController.hpp>
Public Types
| Name | |
|---|---|
| using std::function< void(TimePosition const &)> | TimeChangedCallback |
| using std::function< void(TimeKey new_key, TimeKey old_key)> | TimeKeyChangedCallback |
Public Functions
| Name | |
|---|---|
| void | setCurrentTime(TimePosition const & position) Set the current visualization time. |
| void | setCurrentTime(TimeFrameIndex index, std::shared_ptr< TimeFrame > tf) Set the current visualization time from index and timeframe. |
| TimePosition | currentPosition() const |
| TimeFrameIndex | currentTimeIndex() const |
| std::shared_ptr< TimeFrame > | currentTimeFrame() const |
| void | setActiveTimeKey(TimeKey key) Select which logical timeframe key is active for the UI. |
| TimeKey | activeTimeKey() const |
| void | setOnTimeChanged(TimeChangedCallback cb) Replace the time-changed notification callback. |
| void | setOnTimeKeyChanged(TimeKeyChangedCallback cb) Replace the active-time-key notification callback. |
Public Types Documentation
using TimeChangedCallback
using TimeController::TimeChangedCallback = std::function<void(TimePosition const &)>;using TimeKeyChangedCallback
using TimeController::TimeKeyChangedCallback = std::function<void(TimeKey new_key, TimeKey old_key)>;Public Functions Documentation
function setCurrentTime
void setCurrentTime(
TimePosition const & position
)Set the current visualization time.
Parameters:
- position New time position (index and clock identity)
function setCurrentTime
void setCurrentTime(
TimeFrameIndex index,
std::shared_ptr< TimeFrame > tf
)Set the current visualization time from index and timeframe.
Parameters:
- index Index within the timeframe
- tf Timeframe shared pointer (may be null)
function currentPosition
TimePosition currentPosition() constReturn: Current visualization time position
function currentTimeIndex
TimeFrameIndex currentTimeIndex() constReturn: Current frame index component
function currentTimeFrame
std::shared_ptr< TimeFrame > currentTimeFrame() constReturn: Current timeframe pointer (may be null)
function setActiveTimeKey
void setActiveTimeKey(
TimeKey key
)Select which logical timeframe key is active for the UI.
Parameters:
- key New active key; no-op if equal to the current key
function activeTimeKey
TimeKey activeTimeKey() constReturn: The active timeframe key (defaults to "time")
function setOnTimeChanged
void setOnTimeChanged(
TimeChangedCallback cb
)Replace the time-changed notification callback.
Parameters:
- cb Callback invoked after a successful time update, or empty to clear
function setOnTimeKeyChanged
void setOnTimeKeyChanged(
TimeKeyChangedCallback cb
)Replace the active-time-key notification callback.
Parameters:
- cb Callback invoked when the active key changes, or empty to clear
Updated on 2026-11-13 at 20:25:39 +0000