Skip to content

ViewportModule ​

Module managing the I3T scene view. More...

#include "GUI/Viewport/ViewportModule.h"

Inherits from Module, IStateful

Public Functions ​

Name
ViewportModule()
virtual voidappendScene(const Memento & memento, State::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.
voidcollectGlobal()<br>Update current settings with global data.
voidcollectScene(UI::ViewportWindow * window)<br>Update current settings with data from the current scene.
Ptr< UI::ViewportWindow >getOrCreateViewportWindow(int index)
ViewportModuleSettings &getSettings()
Vp::Viewport &getViewport()
const Ptr< UI::ViewportWindow > &getWindow(int index) const
intgetWindowCount() const
const std::vector< Ptr< UI::ViewportWindow > >getWindows()
boolisMoreThanOneWindowVisible() const
virtual voidloadGlobal(const Memento & memento) override<br>Load global state from a memento.
virtual voidloadScene(const Memento & memento, State::Scene * scene) override<br>Called on scene load, undo and redo.
virtual voidonInit() override
virtual voidonUpdate(double deltaSeconds) override
virtual MementosaveGlobal() override<br>Save shared global state.
virtual MementosaveScene(State::Scene * scene) override<br>Save state for the current scene.
Ptr< UI::ViewportWindow >showNewViewportWindow()
voidupdateGlobal()<br>Update global values from current settings.
voidupdateScene(UI::ViewportWindow * window)<br>Update current scene from current settings.

Public Attributes ​

Name
intm_interactingWindowIndex <br>Index of the window that is being interacted with, 0 for none.

Additional inherited members ​

Public Functions inherited from Module

Name
Module() =default
virtual~Module() =default
virtual voidonBeforeFrame()
virtual voidonBeginFrame()
virtual voidonClose()
virtual voidonEndFrame()

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

Module managing the I3T scene view.

Scene view is displayed in ViewportWindow.h.

Public Functions Documentation ​

function ViewportModule ​

cpp
ViewportModule()

function appendScene ​

cpp
inline virtual void appendScene(
    const Memento & memento,
    State::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

Set the global state to some default empty state.

Reimplements: IStateful::clearGlobal

function clearScene ​

cpp
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 collectGlobal ​

cpp
void collectGlobal()

Update current settings with global data.

function collectScene ​

cpp
void collectScene(
    UI::ViewportWindow * window
)

Update current settings with data from the current scene.

function getOrCreateViewportWindow ​

cpp
Ptr< UI::ViewportWindow > getOrCreateViewportWindow(
    int index
)

function getSettings ​

cpp
ViewportModuleSettings & getSettings()

function getViewport ​

cpp
Vp::Viewport & getViewport()

function getWindow ​

cpp
const Ptr< UI::ViewportWindow > & getWindow(
    int index
) const

function getWindowCount ​

cpp
int getWindowCount() const

function getWindows ​

cpp
const std::vector< Ptr< UI::ViewportWindow > > getWindows()

function isMoreThanOneWindowVisible ​

cpp
bool isMoreThanOneWindowVisible() const

function loadGlobal ​

cpp
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,
    State::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 onInit ​

cpp
virtual void onInit() override

Reimplements: Module::onInit

function onUpdate ​

cpp
virtual void onUpdate(
    double deltaSeconds
) override

Reimplements: Module::onUpdate

function saveGlobal ​

cpp
virtual Memento saveGlobal() override

Save shared global state.

Reimplements: IStateful::saveGlobal

function saveScene ​

cpp
virtual Memento saveScene(
    State::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 showNewViewportWindow ​

cpp
Ptr< UI::ViewportWindow > showNewViewportWindow()

function updateGlobal ​

cpp
void updateGlobal()

Update global values from current settings.

function updateScene ​

cpp
void updateScene(
    UI::ViewportWindow * window
)

Update current scene from current settings.

Public Attributes Documentation ​

variable m_interactingWindowIndex ​

cpp
int m_interactingWindowIndex = 0;

Index of the window that is being interacted with, 0 for none.


Updated on 2026-09-11 at 21:24:24 +0000