Skip to main content

DataSynthesizerState

DataSynthesizerState

State class for DataSynthesizer widget. More…

#include <DataSynthesizerState.hpp>

Inherits from EditorState, QObject

Public Signals

Name
void outputTypeChanged(std::string const & type)
void generatorNameChanged(std::string const & name)
void parameterJsonChanged(std::string const & json)
void outputKeyChanged(std::string const & key)
void timeFrameModeChanged(std::string const & mode)

Public Functions

Name
DataSynthesizerState(QObject * parent =[nullptr])
~DataSynthesizerState() 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.
virtual std::string toJson() const override
Serialize state to JSON string.
virtual bool fromJson(std::string const & json) override
Restore state from JSON string.
std::string const & outputType() const
void setOutputType(std::string const & type)
std::string const & generatorName() const
void setGeneratorName(std::string const & name)
std::string const & parameterJson() const
void setParameterJson(std::string const & json)
std::string const & outputKey() const
void setOutputKey(std::string const & key)
std::string const & timeKey() const
void setTimeKey(std::string const & key)
std::string const & timeFrameMode() const
void setTimeFrameMode(std::string const & mode)

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 DataSynthesizerState;

State class for DataSynthesizer widget.

Manages the serializable state of the DataSynthesizer widget, including generator selection, parameters, and output configuration.

Public Signals Documentation

signal outputTypeChanged

void outputTypeChanged(
    std::string const & type
)

signal generatorNameChanged

void generatorNameChanged(
    std::string const & name
)

signal parameterJsonChanged

void parameterJsonChanged(
    std::string const & json
)

signal outputKeyChanged

void outputKeyChanged(
    std::string const & key
)

signal timeFrameModeChanged

void timeFrameModeChanged(
    std::string const & mode
)

Public Functions Documentation

function DataSynthesizerState

explicit DataSynthesizerState(
    QObject * parent =nullptr
)

function ~DataSynthesizerState

~DataSynthesizerState() 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 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; }



### function outputType

```cpp
std::string const & outputType() const

function setOutputType

void setOutputType(
    std::string const & type
)

function generatorName

std::string const & generatorName() const

function setGeneratorName

void setGeneratorName(
    std::string const & name
)

function parameterJson

std::string const & parameterJson() const

function setParameterJson

void setParameterJson(
    std::string const & json
)

function outputKey

std::string const & outputKey() const

function setOutputKey

void setOutputKey(
    std::string const & key
)

function timeKey

std::string const & timeKey() const

function setTimeKey

void setTimeKey(
    std::string const & key
)

function timeFrameMode

std::string const & timeFrameMode() const

function setTimeFrameMode

void setTimeFrameMode(
    std::string const & mode
)

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