![]() |
Olympe Engine 2.0
2D Game Engine with ECS Architecture
|
Renderer adapter for Entity Prefab graphs. More...
#include <EntityPrefabRenderer.h>
Inheritance diagram for Olympe::EntityPrefabRenderer:
Collaboration diagram for Olympe::EntityPrefabRenderer:Classes | |
| struct | CanvasState |
Public Member Functions | |
| EntityPrefabRenderer (PrefabCanvas &canvas) | |
| ~EntityPrefabRenderer () | |
| void | Render () override |
| Renders the graph canvas into the current ImGui child window. | |
| bool | Load (const std::string &path) override |
| Loads a graph from a file on disk. | |
| bool | Save (const std::string &path) override |
| Saves the current graph state to disk. | |
| bool | IsDirty () const override |
| Returns true when the graph has unsaved changes. | |
| std::string | GetGraphType () const override |
| Returns the graph type string, e.g. | |
| std::string | GetCurrentPath () const override |
| Returns the last path successfully loaded/saved, or empty string. | |
| void | SaveCanvasState () override |
| Save the current canvas viewport state (pan, zoom, etc.) Called when tab is deactivated. | |
| void | RestoreCanvasState () override |
| Restore previously saved canvas viewport state Called when tab is reactivated. | |
| std::string | GetCanvasStateJSON () const override |
| Get canvas state as JSON string for persistence. | |
| void | SetCanvasStateJSON (const std::string &json) override |
| Restore canvas state from JSON string. | |
Public Member Functions inherited from Olympe::IGraphRenderer | |
| virtual | ~IGraphRenderer () |
Private Member Functions | |
| void | RenderToolbar () |
| void | RenderLayoutWithTabs () |
| void | RenderRightPanelTabs () |
Private Attributes | |
| PrefabCanvas & | m_canvas |
| ComponentPalettePanel | m_componentPalette |
| PropertyEditorPanel | m_propertyEditor |
| std::unique_ptr< ICanvasEditor > | m_canvasEditor |
| std::string | m_filePath |
| bool | m_isDirty = false |
| float | m_canvasPanelWidth = 0.75f |
| int | m_rightPanelTabSelection = 0 |
| struct Olympe::EntityPrefabRenderer::CanvasState | m_savedCanvasState |
| bool | m_minimapVisible = true |
| float | m_minimapSize = 0.15f |
| int | m_minimapPosition = 1 |
Renderer adapter for Entity Prefab graphs.
Implements IGraphRenderer interface for the TabManager, delegating rendering to PrefabCanvas with integrated component palette and property panel.
Definition at line 20 of file EntityPrefabRenderer.h.
|
explicit |
Definition at line 11 of file EntityPrefabRenderer.cpp.
References Olympe::ComponentPalettePanel::Initialize(), m_canvasEditor, and m_componentPalette.
Here is the call graph for this function:| Olympe::EntityPrefabRenderer::~EntityPrefabRenderer | ( | ) |
Definition at line 22 of file EntityPrefabRenderer.cpp.
|
overridevirtual |
Get canvas state as JSON string for persistence.
Reimplemented from Olympe::IGraphRenderer.
Definition at line 336 of file EntityPrefabRenderer.cpp.
|
overridevirtual |
Returns the last path successfully loaded/saved, or empty string.
Implements Olympe::IGraphRenderer.
Definition at line 307 of file EntityPrefabRenderer.cpp.
References m_filePath.
|
overridevirtual |
Returns the graph type string, e.g.
"VisualScript", "BehaviorTree".
Implements Olympe::IGraphRenderer.
Definition at line 302 of file EntityPrefabRenderer.cpp.
|
overridevirtual |
Returns true when the graph has unsaved changes.
Implements Olympe::IGraphRenderer.
Definition at line 291 of file EntityPrefabRenderer.cpp.
References GetComponentTypeID_Static(), Olympe::PrefabCanvas::GetDocument(), Olympe::EntityPrefabGraphDocument::IsDirty(), m_canvas, and m_isDirty.
Here is the call graph for this function:Loads a graph from a file on disk.
| path | Absolute or relative path to the .ats / .json file. |
Implements Olympe::IGraphRenderer.
Definition at line 208 of file EntityPrefabRenderer.cpp.
References GetComponentTypeID_Static(), Olympe::PrefabCanvas::GetDocument(), Olympe::PrefabLoader::LoadJsonFromFile(), m_canvas, m_filePath, m_isDirty, and SYSTEM_LOG.
Here is the call graph for this function:
|
overridevirtual |
Renders the graph canvas into the current ImGui child window.
Implements Olympe::IGraphRenderer.
Definition at line 26 of file EntityPrefabRenderer.cpp.
References RenderLayoutWithTabs().
Here is the call graph for this function:
|
private |
Definition at line 31 of file EntityPrefabRenderer.cpp.
References Olympe::PrefabCanvas::AcceptComponentDropAtScreenPos(), GetComponentTypeID_Static(), m_canvas, m_canvasEditor, m_canvasPanelWidth, m_minimapPosition, m_minimapSize, m_minimapVisible, Olympe::PrefabCanvas::Render(), RenderRightPanelTabs(), RenderToolbar(), Olympe::PrefabCanvas::SetCanvasEditor(), and SYSTEM_LOG.
Referenced by Render().
Here is the call graph for this function:
Here is the caller graph for this function:
|
private |
Definition at line 174 of file EntityPrefabRenderer.cpp.
References GetComponentTypeID_Static(), Olympe::PrefabCanvas::GetDocument(), Olympe::EntityPrefabGraphDocument::GetSelectedNodes(), m_canvas, m_componentPalette, m_propertyEditor, Olympe::ComponentPalettePanel::Render(), Olympe::PropertyEditorPanel::Render(), and Olympe::PropertyEditorPanel::SetSelectedNode().
Referenced by RenderLayoutWithTabs().
Here is the call graph for this function:
Here is the caller graph for this function:
|
private |
Definition at line 348 of file EntityPrefabRenderer.cpp.
References GetComponentTypeID_Static(), m_canvasEditor, m_minimapPosition, m_minimapSize, and m_minimapVisible.
Referenced by RenderLayoutWithTabs().
Here is the call graph for this function:
Here is the caller graph for this function:
|
overridevirtual |
Restore previously saved canvas viewport state Called when tab is reactivated.
Ensures smooth tab switching without losing layout.
Reimplemented from Olympe::IGraphRenderer.
Definition at line 325 of file EntityPrefabRenderer.cpp.
References GetComponentTypeID_Static(), m_canvasEditor, m_savedCanvasState, Olympe::EntityPrefabRenderer::CanvasState::panX, Olympe::EntityPrefabRenderer::CanvasState::panY, and Olympe::EntityPrefabRenderer::CanvasState::zoom.
Here is the call graph for this function:Saves the current graph state to disk.
| path | Destination path. If empty, save to the path passed to Load(). |
Implements Olympe::IGraphRenderer.
Definition at line 258 of file EntityPrefabRenderer.cpp.
References GetComponentTypeID_Static(), Olympe::PrefabCanvas::GetDocument(), m_canvas, m_filePath, and m_isDirty.
Here is the call graph for this function:
|
overridevirtual |
Save the current canvas viewport state (pan, zoom, etc.) Called when tab is deactivated.
Used to preserve viewport when switching between multiple tabs.
Reimplemented from Olympe::IGraphRenderer.
Definition at line 313 of file EntityPrefabRenderer.cpp.
References GetComponentTypeID_Static(), m_canvasEditor, m_savedCanvasState, Olympe::EntityPrefabRenderer::CanvasState::panX, Olympe::EntityPrefabRenderer::CanvasState::panY, and Olympe::EntityPrefabRenderer::CanvasState::zoom.
Here is the call graph for this function:Restore canvas state from JSON string.
| json | JSON representation of saved canvas state |
Reimplemented from Olympe::IGraphRenderer.
Definition at line 342 of file EntityPrefabRenderer.cpp.
References GetComponentTypeID_Static().
Here is the call graph for this function:
|
private |
Definition at line 40 of file EntityPrefabRenderer.h.
Referenced by IsDirty(), Load(), RenderLayoutWithTabs(), RenderRightPanelTabs(), and Save().
|
private |
Definition at line 43 of file EntityPrefabRenderer.h.
Referenced by EntityPrefabRenderer(), RenderLayoutWithTabs(), RenderToolbar(), RestoreCanvasState(), and SaveCanvasState().
Definition at line 46 of file EntityPrefabRenderer.h.
Referenced by RenderLayoutWithTabs().
|
private |
Definition at line 41 of file EntityPrefabRenderer.h.
Referenced by EntityPrefabRenderer(), and RenderRightPanelTabs().
|
private |
Definition at line 44 of file EntityPrefabRenderer.h.
Referenced by GetCurrentPath(), Load(), and Save().
Definition at line 45 of file EntityPrefabRenderer.h.
|
private |
Definition at line 60 of file EntityPrefabRenderer.h.
Referenced by RenderLayoutWithTabs(), and RenderToolbar().
Definition at line 59 of file EntityPrefabRenderer.h.
Referenced by RenderLayoutWithTabs(), and RenderToolbar().
Definition at line 58 of file EntityPrefabRenderer.h.
Referenced by RenderLayoutWithTabs(), and RenderToolbar().
|
private |
Definition at line 42 of file EntityPrefabRenderer.h.
Referenced by RenderRightPanelTabs().
|
private |
Definition at line 47 of file EntityPrefabRenderer.h.
|
private |
Referenced by RestoreCanvasState(), and SaveCanvasState().