Skip to content

IWindow

ImGui GUIWindow abstract class. More...

#include "GUI/Elements/IWindow.h"

Inherits from std::enable_shared_from_this< IWindow >

Inherited by AboutWindow, DescriptionDialog, ImportedModelsDialog, LogWindow, ModalWindow, SetupDialog, StartWindow, TutorialWindow, UI::Console, UI::StyleEditor, UI::ViewportWindow, WorkspaceWindow

Public Functions

Name
IWindow(bool show =false)
virtual~IWindow() =default
virtual const char *getID() const =0
InputController &getInput()<br>Returns window input controller.
InputController *getInputPtr()
const char *getName() const
bool *getShowPtr()
voidhide()
boolisVisible() const
virtual voidrender() =0
const std::string &setName(const char * name)
voidshow()

Protected Functions

Name
voidupdateWindowInfo()<br>Collect information about the current window.

Public Attributes

Name
glm::vec2m_windowMax <br>Bottom right corner of the window.
glm::vec2m_windowMin <br>Top left corner of the window, same as m_windowPos (separate variable for clarity)
glm::vec2m_windowPos <br>Top-left corner of the window in screen coordinates.
glm::ivec2m_windowSize <br>Window width and height dimensions.

Protected Attributes

Name
std::stringimGuiName
InputControllerInput
boolm_show
WindowManager *m_windowManager <br>Weak reference to a WindowManager set when this window is added to it.

Friends

Name
classWindowManager

Detailed Description

cpp
class IWindow;
class IWindow;

ImGui GUIWindow abstract class.

See: WindowManager for lifecycle information.

Every window should call its IWindow::updateWindowInfo() method after ImGui::Begin() call.

Public Functions Documentation

function IWindow

cpp
inline explicit IWindow(
    bool show =false
)
inline explicit IWindow(
    bool show =false
)

function ~IWindow

cpp
virtual ~IWindow() =default
virtual ~IWindow() =default

Precondition: Window cannot be destroyed at runtime. It may cause crash.

function getID

cpp
virtual const char * getID() const =0
virtual const char * getID() const =0

Reimplemented by: ModalWindow::getID

function getInput

cpp
inline InputController & getInput()
inline InputController & getInput()

Returns window input controller.

function getInputPtr

cpp
inline InputController * getInputPtr()
inline InputController * getInputPtr()

function getName

cpp
const char * getName() const
const char * getName() const

Return: ImGui window name.

function getShowPtr

cpp
inline bool * getShowPtr()
inline bool * getShowPtr()

function hide

cpp
inline void hide()
inline void hide()

function isVisible

cpp
inline bool isVisible() const
inline bool isVisible() const

function render

cpp
virtual void render() =0
virtual void render() =0

Reimplemented by: WorkspaceWindow::render, DescriptionDialog::render, ImportedModelsDialog::render, SetupDialog::render, ModalWindow::render, AboutWindow::render, UI::Console::render, LogWindow::render, StartWindow::render, UI::StyleEditor::render, TutorialWindow::render, UI::ViewportWindow::render

function setName

cpp
const std::string & setName(
    const char * name
)
const std::string & setName(
    const char * name
)

function show

cpp
inline void show()
inline void show()

Protected Functions Documentation

function updateWindowInfo

cpp
void updateWindowInfo()
void updateWindowInfo()

Collect information about the current window.

Should be called right after ImGui's Begin() function to store and supply window's screen position and size to any code being called until another window starts being constructed. If this call is omitted after beginning a window anything querying the WindowManager for window position and dimensions may receive invalid information.

Public Attributes Documentation

variable m_windowMax

cpp
glm::vec2 m_windowMax;
glm::vec2 m_windowMax;

Bottom right corner of the window.

variable m_windowMin

cpp
glm::vec2 m_windowMin;
glm::vec2 m_windowMin;

Top left corner of the window, same as m_windowPos (separate variable for clarity)

variable m_windowPos

cpp
glm::vec2 m_windowPos;
glm::vec2 m_windowPos;

Top-left corner of the window in screen coordinates.

variable m_windowSize

cpp
glm::ivec2 m_windowSize;
glm::ivec2 m_windowSize;

Window width and height dimensions.

Protected Attributes Documentation

variable imGuiName

cpp
std::string imGuiName;
std::string imGuiName;

variable Input

cpp
InputController Input;
InputController Input;

variable m_show

cpp
bool m_show;
bool m_show;

variable m_windowManager

cpp
WindowManager * m_windowManager = nullptr;
WindowManager * m_windowManager = nullptr;

Weak reference to a WindowManager set when this window is added to it.

Friends

friend WindowManager

cpp
friend class WindowManager(
    WindowManager 
);
friend class WindowManager(
    WindowManager 
);

Updated on 2024-03-16 at 19:15:01 +0000