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(std::string title, bool show =false) | |
virtual | ~IWindow() =default |
virtual const char * | getID() const =0 |
WPtr< InputController > | getInput()<br>Returns window input controller. |
const char * | getName() |
bool * | getShowPtr() |
const std::string & | getTitle() const |
void | hide() |
bool | isVisible() const |
virtual void | render() =0 |
const void | setTitle(std::string title) |
void | show() |
Protected Functions
Name | |
---|---|
void | updateWindowInfo()<br>Collect information about the current window. |
Public Attributes
Name | |
---|---|
bool | m_autoFocus <br>When true the window will get focus immediately upon hovering over it. |
std::string | m_title <br>Visible window title. |
bool | m_windowInfoUpdated <br>A flag indicating the updateWindowInfo() method was called. |
WindowManager * | m_windowManager <br>Weak reference to a WindowManager set when this window is added to it. |
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 | |
---|---|
Ptr< InputController > | m_input |
std::string | m_name <br>Full ImGui window identifier. |
bool | m_nameNeedsUpdate <br>Workaround to avoid setting the name in the constructor (cannot call getID there) |
bool | m_show |
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
explicit IWindow(
std::string title,
bool show =false
)
explicit IWindow(
std::string title,
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 WPtr< InputController > getInput()
inline WPtr< InputController > getInput()
Returns window input controller.
function getName
const char * getName()
const char * getName()
Return: ImGui window name.
function getShowPtr
inline bool * getShowPtr()
inline bool * getShowPtr()
function getTitle
const std::string & getTitle() const
const std::string & getTitle() const
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 setTitle
const void setTitle(
std::string title
)
const void setTitle(
std::string title
)
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_autoFocus
bool m_autoFocus {false};
bool m_autoFocus {false};
When true the window will get focus immediately upon hovering over it.
variable m_title
std::string m_title;
std::string m_title;
Visible window title.
variable m_windowInfoUpdated
bool m_windowInfoUpdated {false};
bool m_windowInfoUpdated {false};
A flag indicating the updateWindowInfo() method was called.
variable m_windowManager
WindowManager * m_windowManager {nullptr};
WindowManager * m_windowManager {nullptr};
Weak reference to a WindowManager set when this window is added to it.
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 m_input
Ptr< InputController > m_input {std::make_shared<InputController>()};
Ptr< InputController > m_input {std::make_shared<InputController>()};
variable m_name
std::string m_name;
std::string m_name;
Full ImGui window identifier.
variable m_nameNeedsUpdate
bool m_nameNeedsUpdate {true};
bool m_nameNeedsUpdate {true};
Workaround to avoid setting the name in the constructor (cannot call getID there)
variable m_show
bool m_show {false};
bool m_show {false};
Friends
friend WindowManager
friend class WindowManager(
WindowManager
);
friend class WindowManager(
WindowManager
);
Updated on 2024-11-06 at 20:16:53 +0000