/****************************************************************************** * File - iPanel.cpp * Author - Joey Pollack * Date - 2021/11/01 (y/m/d) * Mod Date - 2021/11/01 (y/m/d) * Description - Base class for all editor panels ******************************************************************************/ #include "iPanel.h" #include #include namespace lunarium { namespace editor { Panel::Panel(PanelType type, std::string name, PanelDockZone dock_zone, bool isOpen) : mType(type), mIsOpen(isOpen), mPanelName(name), mDockZone(dock_zone) { } PanelType Panel::GetType() const { return mType; } const char* Panel::GetName() const { return mPanelName.c_str(); } PanelDockZone Panel::GetDockZone() const { return mDockZone; } void Panel::SetOpen(bool isOpen) { mIsOpen = isOpen; } bool Panel::IsOpen() { return mIsOpen; } void Panel::GetPosition(int& x, int& y) const { x = mX; y = mY; } void Panel::GetSize(int& w, int& h) const { w = mWidth; h = mHeight; } void Panel::Update(float dt) { } void Panel::UpdateMetaInfo() { ImVec2 p = ImGui::GetWindowPos(); ImVec2 s = ImGui::GetWindowSize(); mX = p.x; mY = p.y; mWidth = s.x; mHeight = s.y; } } }