Skip to main content

TemporalProjectionViewState

TemporalProjectionViewState

State class for TemporalProjectionViewWidget. More…

#include <TemporalProjectionViewState.hpp>

Inherits from EditorState, QObject

Public Signals

Name
void viewStateChanged()
void pointDataKeyAdded(QString const & key)
void pointDataKeyRemoved(QString const & key)
void pointDataKeysCleared()
void lineDataKeyAdded(QString const & key)
void lineDataKeyRemoved(QString const & key)
void lineDataKeysCleared()
void glyphStyleChanged()
void lineStyleChanged()
void colorByGroupChanged()
void selectionModeChanged(QString const & mode)
void selectionChanged()

Public Functions

Name
TemporalProjectionViewState(QObject * parent =[nullptr])
Construct a new TemporalProjectionViewState.
~TemporalProjectionViewState() override =default
virtual QString getTypeName() const override
Get unique type name for this editor state.
virtual QString getDisplayName() const override
Get display name for UI.
virtual void setDisplayName(QString const & name) override
Set display name.
HorizontalAxisState * horizontalAxisState()
VerticalAxisState * verticalAxisState()
CorePlotting::ViewStateData const & viewState() const
Get the current view state (bounds + zoom + pan).
void setXZoom(double zoom)
void setYZoom(double zoom)
void setPan(double x_pan, double y_pan)
void setXBounds(double x_min, double x_max)
Set X data bounds and keep horizontal axis in sync. Call when the plot updates the horizontal axis from data (e.g. after a rebuild).
void setYBounds(double y_min, double y_max)
Set Y data bounds and keep vertical axis in sync. Call when the plot updates the vertical axis from data (e.g. after a rebuild).
std::vector< QString > getPointDataKeys() const
Get all point data keys.
void addPointDataKey(QString const & key)
Add a point data key.
void removePointDataKey(QString const & key)
Remove a point data key.
void clearPointDataKeys()
Clear all point data keys.
std::vector< QString > getLineDataKeys() const
Get all line data keys.
void addLineDataKey(QString const & key)
Add a line data key.
void removeLineDataKey(QString const & key)
Remove a line data key.
void clearLineDataKeys()
Clear all line data keys.
GlyphStyleState * glyphStyleState()
Get glyph style state (for GlyphStyleControls binding).
LineStyleState * lineStyleState()
Get line style state (for LineStyleControls binding).
float getPointSize() const
Get point size (convenience, reads from glyph style).
void setPointSize(float size)
Set point size (convenience, delegates to glyph style state).
float getLineWidth() const
Get line width (convenience, reads from line style).
void setLineWidth(float width)
Set line width (convenience, delegates to line style state).
CorePlotting::LineStyleData getLineStyle() const
Get the serializable line style data (read-only).
bool colorByGroup() const
void setColorByGroup(bool enabled)
QString getSelectionMode() const
Get selection mode.
void setSelectionMode(QString const & mode)
Set selection mode (“none”, “point”, “line”, “polygon”).
virtual std::string toJson() const override
Serialize state to JSON string.
virtual bool fromJson(std::string const & json) override
Restore state from JSON string.

Additional inherited members

Public Signals inherited from EditorState

Name
void stateChanged()
Emitted when any state property changes.
void displayNameChanged(QString const & newName)
Emitted when display name changes.
void dirtyChanged(bool isDirty)
Emitted when dirty state changes.

Public Functions inherited from EditorState

Name
EditorState(QObject * parent =[nullptr])
Construct a new EditorState.
~EditorState() override =default
Virtual destructor.
QString getInstanceId() const
Get unique instance ID.
bool isDirty() const
Check if state has unsaved changes.
void markClean()
Mark state as clean (after save).

Protected Functions inherited from EditorState

Name
void markDirty()
Mark state as modified.
void setInstanceId(QString const & id)
Set instance ID (for deserialization).
QString generateInstanceId()
Generate a new unique instance ID.

Detailed Description

class TemporalProjectionViewState;

State class for TemporalProjectionViewWidget.

Single source of truth: view_state (zoom/pan) plus horizontal and vertical axis states (full range). OpenGL widget and axis widgets read from state.

Public Signals Documentation

signal viewStateChanged

void viewStateChanged()

signal pointDataKeyAdded

void pointDataKeyAdded(
    QString const & key
)

signal pointDataKeyRemoved

void pointDataKeyRemoved(
    QString const & key
)

signal pointDataKeysCleared

void pointDataKeysCleared()

signal lineDataKeyAdded

void lineDataKeyAdded(
    QString const & key
)

signal lineDataKeyRemoved

void lineDataKeyRemoved(
    QString const & key
)

signal lineDataKeysCleared

void lineDataKeysCleared()

signal glyphStyleChanged

void glyphStyleChanged()

signal lineStyleChanged

void lineStyleChanged()

signal colorByGroupChanged

void colorByGroupChanged()

signal selectionModeChanged

void selectionModeChanged(
    QString const & mode
)

signal selectionChanged

void selectionChanged()

Public Functions Documentation

function TemporalProjectionViewState

explicit TemporalProjectionViewState(
    QObject * parent =nullptr
)

Construct a new TemporalProjectionViewState.

Parameters:

  • parent Parent QObject (typically nullptr, managed by WorkspaceManager)

function ~TemporalProjectionViewState

~TemporalProjectionViewState() override =default

function getTypeName

inline virtual QString getTypeName() const override

Get unique type name for this editor state.

Return: Type name, e.g., “MediaWidget”, “DataViewerWidget”

Reimplements: EditorState::getTypeName

This is used for:

  • Factory registration
  • Serialization type field
  • Properties panel routing

function getDisplayName

virtual QString getDisplayName() const override

Get display name for UI.

Return: Display name, e.g., “Media Viewer 1”

Reimplements: EditorState::getDisplayName

This is the user-visible name shown in tabs, window titles, etc. It may be customized by the user.

function setDisplayName

virtual void setDisplayName(
    QString const & name
) override

Set display name.

Parameters:

  • name New display name

Reimplements: EditorState::setDisplayName

function horizontalAxisState

inline HorizontalAxisState * horizontalAxisState()

function verticalAxisState

inline VerticalAxisState * verticalAxisState()

function viewState

inline CorePlotting::ViewStateData const & viewState() const

Get the current view state (bounds + zoom + pan).

function setXZoom

void setXZoom(
    double zoom
)

function setYZoom

void setYZoom(
    double zoom
)

function setPan

void setPan(
    double x_pan,
    double y_pan
)

function setXBounds

void setXBounds(
    double x_min,
    double x_max
)

Set X data bounds and keep horizontal axis in sync. Call when the plot updates the horizontal axis from data (e.g. after a rebuild).

Parameters:

  • x_min Minimum X value
  • x_max Maximum X value

function setYBounds

void setYBounds(
    double y_min,
    double y_max
)

Set Y data bounds and keep vertical axis in sync. Call when the plot updates the vertical axis from data (e.g. after a rebuild).

Parameters:

  • y_min Minimum Y value
  • y_max Maximum Y value

function getPointDataKeys

std::vector< QString > getPointDataKeys() const

Get all point data keys.

function addPointDataKey

void addPointDataKey(
    QString const & key
)

Add a point data key.

function removePointDataKey

void removePointDataKey(
    QString const & key
)

Remove a point data key.

function clearPointDataKeys

void clearPointDataKeys()

Clear all point data keys.

function getLineDataKeys

std::vector< QString > getLineDataKeys() const

Get all line data keys.

function addLineDataKey

void addLineDataKey(
    QString const & key
)

Add a line data key.

function removeLineDataKey

void removeLineDataKey(
    QString const & key
)

Remove a line data key.

function clearLineDataKeys

void clearLineDataKeys()

Clear all line data keys.

function glyphStyleState

inline GlyphStyleState * glyphStyleState()

Get glyph style state (for GlyphStyleControls binding).

function lineStyleState

inline LineStyleState * lineStyleState()

Get line style state (for LineStyleControls binding).

function getPointSize

inline float getPointSize() const

Get point size (convenience, reads from glyph style).

function setPointSize

void setPointSize(
    float size
)

Set point size (convenience, delegates to glyph style state).

function getLineWidth

inline float getLineWidth() const

Get line width (convenience, reads from line style).

function setLineWidth

void setLineWidth(
    float width
)

Set line width (convenience, delegates to line style state).

function getLineStyle

inline CorePlotting::LineStyleData getLineStyle() const

Get the serializable line style data (read-only).

function colorByGroup

inline bool colorByGroup() const

function setColorByGroup

void setColorByGroup(
    bool enabled
)

function getSelectionMode

inline QString getSelectionMode() const

Get selection mode.

function setSelectionMode

void setSelectionMode(
    QString const & mode
)

Set selection mode (“none”, “point”, “line”, “polygon”).

function toJson

virtual std::string toJson() const override

Serialize state to JSON string.

Return: JSON string representation of state

Reimplements: EditorState::toJson

Subclasses should use reflect-cpp for serialization: ```cpp

std::string toJson() const override { return rfl::json::write(_data); }



### function fromJson

```cpp
virtual bool fromJson(
    std::string const & json
) override

Restore state from JSON string.

Parameters:

  • json JSON string to parse

Return: true if parsing succeeded, false on error

Reimplements: EditorState::fromJson

Subclasses should use reflect-cpp for deserialization: ```cpp

bool fromJson(std::string const& json) override { auto result = rfl::json::read(json); if (result) { _data = *result; emit stateChanged(); return true; } return false; } ```


Updated on 2026-11-13 at 20:25:39 +0000