Skip to content

WorkspaceModule

Object managing the I3T workspace node editor. More...

#include "GUI/Workspace/WorkspaceModule.h"

Inherits from Module, IStateful

Public Functions

Name
WorkspaceModule()
virtual voidappendScene(const Memento & memento, Scene * scene) override<br>Called on scene append.
virtual voidclearGlobal() override<br>Set the global state to some default empty state.
virtual voidclearScene(bool newScene) override<br>Set the scene state to some default empty state.
Workspace::WorkspaceDiwne &getNodeEditor()
virtual voidloadGlobal(const Memento & memento) override<br>Load global state from a memento.
virtual voidloadScene(const Memento & memento, Scene * scene) override<br>Called on scene load, undo and redo.
virtual MementosaveGlobal() override<br>Save shared global state.
virtual MementosaveScene(Scene * scene) override<br>Save state for the current scene.
template <typename T &gt; <br>autoaddNodeToNodeEditor(ImVec2 const position =ImVec2(0, 0))<br>This function takes snapshot of current state.
template <typename T &gt; <br>autoaddNodeToNodeEditorNoSave(ImVec2 const position =ImVec2(0, 0))
boolconnectNodes(Ptr< Workspace::CoreNode > lhs, Ptr< Workspace::CoreNode > rhs, int lhsPin, int rhsPin)
boolconnectNodesNoSave(Ptr< Workspace::CoreNode > lhs, Ptr< Workspace::CoreNode > rhs, int lhsPin, int rhsPin)

Public Attributes

Name
boolg_createNodesOnInit
Ptr< Workspace::WorkspaceDiwne >g_editor
intg_pinStyle
intg_pinStyleModelMatrix
intg_pinStyleMul
intg_pinStylePulse
intg_pinStyleScreen
WorkspaceSettingsg_settings

Additional inherited members

Public Functions inherited from Module

Name
Module() =default
virtual~Module() =default
virtual voidonBeforeFrame()
virtual voidonBeginFrame()
virtual voidonClose()
virtual voidonEndFrame()
virtual voidonInit()
virtual voidonUpdate(double deltaSeconds)

Friends inherited from Module

Name
classApplication

Public Functions inherited from IStateful

Name
virtual~IStateful()
MementoemptyMemento()<br>Create an empty memento (rapidjson::Document)

Detailed Description

cpp
class WorkspaceModule;
class WorkspaceModule;

Object managing the I3T workspace node editor.

Separate from the WorkspaceWindow which merely offers a view upon it.

Public Functions Documentation

function WorkspaceModule

cpp
WorkspaceModule()
WorkspaceModule()

function appendScene

cpp
virtual void appendScene(
    const Memento & memento,
    Scene * scene
) override
virtual void appendScene(
    const Memento & memento,
    Scene * scene
) override

Called on scene append.

Parameters:

  • scene The current scene
  • memento Scene state to appended

Reimplements: IStateful::appendScene

function clearGlobal

cpp
virtual void clearGlobal() override
virtual void clearGlobal() override

Set the global state to some default empty state.

Reimplements: IStateful::clearGlobal

function clearScene

cpp
virtual void clearScene(
    bool newScene
) override
virtual void clearScene(
    bool newScene
) override

Set the scene state to some default empty state.

Parameters:

  • newScene Whether to perform basic new scene initialization.

Reimplements: IStateful::clearScene

function getNodeEditor

cpp
Workspace::WorkspaceDiwne & getNodeEditor()
Workspace::WorkspaceDiwne & getNodeEditor()

function loadGlobal

cpp
virtual void loadGlobal(
    const Memento & memento
) override
virtual void loadGlobal(
    const Memento & memento
) override

Load global state from a memento.

Parameters:

  • memento New global state

Reimplements: IStateful::loadGlobal

function loadScene

cpp
virtual void loadScene(
    const Memento & memento,
    Scene * scene
) override
virtual void loadScene(
    const Memento & memento,
    Scene * scene
) override

Called on scene load, undo and redo.

Parameters:

  • scene The current scene or nullptr (in case of undo/redo)
  • memento New scene state

Reimplements: IStateful::loadScene

function saveGlobal

cpp
virtual Memento saveGlobal() override
virtual Memento saveGlobal() override

Save shared global state.

Reimplements: IStateful::saveGlobal

function saveScene

cpp
virtual Memento saveScene(
    Scene * scene
) override
virtual Memento saveScene(
    Scene * scene
) override

Save state for the current scene.

Parameters:

  • scene The current scene or nullptr (in case of undo/redo)

Reimplements: IStateful::saveScene

The scene parameter should contain a scene object for full filesystem saves and nullptr for quick undo/redo operations.

function addNodeToNodeEditor

cpp
template <typename T >
static inline auto addNodeToNodeEditor(
    ImVec2 const position =ImVec2(0, 0)
)
template <typename T >
static inline auto addNodeToNodeEditor(
    ImVec2 const position =ImVec2(0, 0)
)

This function takes snapshot of current state.

function addNodeToNodeEditorNoSave

cpp
template <typename T >
static inline auto addNodeToNodeEditorNoSave(
    ImVec2 const position =ImVec2(0, 0)
)
template <typename T >
static inline auto addNodeToNodeEditorNoSave(
    ImVec2 const position =ImVec2(0, 0)
)

function connectNodes

cpp
static bool connectNodes(
    Ptr< Workspace::CoreNode > lhs,
    Ptr< Workspace::CoreNode > rhs,
    int lhsPin,
    int rhsPin
)
static bool connectNodes(
    Ptr< Workspace::CoreNode > lhs,
    Ptr< Workspace::CoreNode > rhs,
    int lhsPin,
    int rhsPin
)

function connectNodesNoSave

cpp
static bool connectNodesNoSave(
    Ptr< Workspace::CoreNode > lhs,
    Ptr< Workspace::CoreNode > rhs,
    int lhsPin,
    int rhsPin
)
static bool connectNodesNoSave(
    Ptr< Workspace::CoreNode > lhs,
    Ptr< Workspace::CoreNode > rhs,
    int lhsPin,
    int rhsPin
)

Public Attributes Documentation

variable g_createNodesOnInit

cpp
static bool g_createNodesOnInit = true;
static bool g_createNodesOnInit = true;

variable g_editor

cpp
static Ptr< Workspace::WorkspaceDiwne > g_editor;
static Ptr< Workspace::WorkspaceDiwne > g_editor;

variable g_pinStyle

cpp
static int g_pinStyle = 1;
static int g_pinStyle = 1;

variable g_pinStyleModelMatrix

cpp
static int g_pinStyleModelMatrix = 2;
static int g_pinStyleModelMatrix = 2;

variable g_pinStyleMul

cpp
static int g_pinStyleMul = 0;
static int g_pinStyleMul = 0;

variable g_pinStylePulse

cpp
static int g_pinStylePulse = 0;
static int g_pinStylePulse = 0;

variable g_pinStyleScreen

cpp
static int g_pinStyleScreen = 0;
static int g_pinStyleScreen = 0;

variable g_settings

cpp
static WorkspaceSettings g_settings;
static WorkspaceSettings g_settings;

Updated on 2025-05-31 at 12:55:30 +0000