Skip to main content

ThreeDPlotState

ThreeDPlotState

State class for 3DPlotWidget. More…

#include <3DPlotState.hpp>

Inherits from EditorState, QObject

Public Signals

Name
void activePointDataKeyChanged(QString const & key)
Emitted when the active PointData key changes.
void plotDataKeyAdded(QString const & data_key)
Emitted when a plot data key is added.
void plotDataKeyRemoved(QString const & data_key)
Emitted when a plot data key is removed.
void stateChanged()
Emitted when state changes.

Public Functions

Name
ThreeDPlotState(QObject * parent =[nullptr])
Construct a new ThreeDPlotState.
~ThreeDPlotState() override =default
virtual QString getTypeName() const override
Get the type name for this state.
virtual QString getDisplayName() const override
Get the display name for UI.
virtual void setDisplayName(QString const & name) override
Set the display name.
ThreeDPlotStateData const & data() const
Get const reference to underlying data.
QString getActivePointDataKey() const
Get the currently active PointData key.
void setActivePointDataKey(QString const & key)
Set the currently active PointData key.
void addPlotDataKey(QString const & data_key)
Add a data key to the plot.
void removePlotDataKey(QString const & data_key)
Remove a data key from the plot.
std::vector< QString > getPlotDataKeys() const
Get all plot data keys.
std::optional< ThreeDPlotDataOptions > getPlotDataKeyOptions(QString const & data_key) const
Get options for a specific plot data key.
virtual std::string toJson() const override
Serialize state to JSON.
virtual bool fromJson(std::string const & json) override
Restore state from JSON.

Additional inherited members

Public Signals inherited from EditorState

Name
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 ThreeDPlotState;

State class for 3DPlotWidget.

3DPlotState is the Qt wrapper around ThreeDPlotStateData that provides typed accessors and Qt signals for all state properties.

Public Signals Documentation

signal activePointDataKeyChanged

void activePointDataKeyChanged(
    QString const & key
)

Emitted when the active PointData key changes.

Parameters:

  • key The new active key

signal plotDataKeyAdded

void plotDataKeyAdded(
    QString const & data_key
)

Emitted when a plot data key is added.

Parameters:

  • data_key The added data key

signal plotDataKeyRemoved

void plotDataKeyRemoved(
    QString const & data_key
)

Emitted when a plot data key is removed.

Parameters:

  • data_key The removed data key

signal stateChanged

void stateChanged()

Emitted when state changes.

Public Functions Documentation

function ThreeDPlotState

explicit ThreeDPlotState(
    QObject * parent =nullptr
)

Construct a new ThreeDPlotState.

Parameters:

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

function ~ThreeDPlotState

~ThreeDPlotState() override =default

function getTypeName

inline virtual QString getTypeName() const override

Get the type name for this state.

Return: “3DPlot”

Reimplements: EditorState::getTypeName

function getDisplayName

virtual QString getDisplayName() const override

Get the display name for UI.

Return: User-visible name (default: “3D Plot”)

Reimplements: EditorState::getDisplayName

function setDisplayName

virtual void setDisplayName(
    QString const & name
) override

Set the display name.

Parameters:

  • name New display name

Reimplements: EditorState::setDisplayName

function data

inline ThreeDPlotStateData const & data() const

Get const reference to underlying data.

Return: Const reference to ThreeDPlotStateData

function getActivePointDataKey

QString getActivePointDataKey() const

Get the currently active PointData key.

Return: The active key as QString

function setActivePointDataKey

void setActivePointDataKey(
    QString const & key
)

Set the currently active PointData key.

Parameters:

  • key The key to set

function addPlotDataKey

void addPlotDataKey(
    QString const & data_key
)

Add a data key to the plot.

Parameters:

function removePlotDataKey

void removePlotDataKey(
    QString const & data_key
)

Remove a data key from the plot.

Parameters:

function getPlotDataKeys

std::vector< QString > getPlotDataKeys() const

Get all plot data keys.

Return: List of data keys currently in the plot

function getPlotDataKeyOptions

std::optional< ThreeDPlotDataOptions > getPlotDataKeyOptions(
    QString const & data_key
) const

Get options for a specific plot data key.

Parameters:

  • data_key The data key

Return: Options struct, or std::nullopt if key not found

function toJson

virtual std::string toJson() const override

Serialize state to JSON.

Return: JSON string representation

Reimplements: EditorState::toJson

function fromJson

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

Restore state from JSON.

Parameters:

  • json JSON string to parse

Return: true if parsing succeeded

Reimplements: EditorState::fromJson


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