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() |
void | hide() |
bool | isVisible() const |
virtual void | render() =0 |
const std::string & | setName(const char * name) |
void | show() |
Protected Functions
Name | |
---|---|
void | updateWindowInfo()<br>Collect information about the current window. |
Public Attributes
Name | |
---|---|
glm::vec2 | m_windowMax <br>Bottom right corner of the window. |
glm::vec2 | m_windowMin <br>Top left corner of the window, same as m_windowPos (separate variable for clarity) |
glm::vec2 | m_windowPos <br>Top-left corner of the window in screen coordinates. |
glm::ivec2 | m_windowSize <br>Window width and height dimensions. |
Protected Attributes
Name | |
---|---|
std::string | imGuiName |
InputController | Input |
bool | m_show |
WindowManager * | m_windowManager <br>Weak reference to a WindowManager set when this window is added to it. |
Friends
Name | |
---|---|
class | WindowManager |
Detailed Description
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
inline explicit IWindow(
bool show =false
)
inline explicit IWindow(
bool show =false
)
function ~IWindow
virtual ~IWindow() =default
virtual ~IWindow() =default
Precondition: Window cannot be destroyed at runtime. It may cause crash.
function getID
virtual const char * getID() const =0
virtual const char * getID() const =0
Reimplemented by: ModalWindow::getID
function getInput
inline InputController & getInput()
inline InputController & getInput()
Returns window input controller.
function getInputPtr
inline InputController * getInputPtr()
inline InputController * getInputPtr()
function getName
const char * getName() const
const char * getName() const
Return: ImGui window name.
function getShowPtr
inline bool * getShowPtr()
inline bool * getShowPtr()
function hide
inline void hide()
inline void hide()
function isVisible
inline bool isVisible() const
inline bool isVisible() const
function render
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
const std::string & setName(
const char * name
)
const std::string & setName(
const char * name
)
function show
inline void show()
inline void show()
Protected Functions Documentation
function updateWindowInfo
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
glm::vec2 m_windowMax;
glm::vec2 m_windowMax;
Bottom right corner of the window.
variable m_windowMin
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
glm::vec2 m_windowPos;
glm::vec2 m_windowPos;
Top-left corner of the window in screen coordinates.
variable m_windowSize
glm::ivec2 m_windowSize;
glm::ivec2 m_windowSize;
Window width and height dimensions.
Protected Attributes Documentation
variable imGuiName
std::string imGuiName;
std::string imGuiName;
variable Input
InputController Input;
InputController Input;
variable m_show
bool m_show;
bool m_show;
variable m_windowManager
WindowManager * m_windowManager = nullptr;
WindowManager * m_windowManager = nullptr;
Weak reference to a WindowManager set when this window is added to it.
Friends
friend WindowManager
friend class WindowManager(
WindowManager
);
friend class WindowManager(
WindowManager
);
Updated on 2024-03-16 at 19:15:01 +0000