Olympe Engine 2.0
2D Game Engine with ECS Architecture
Loading...
Searching...
No Matches
Public Member Functions | List of all members
Olympe::IGraphRenderer Class Referenceabstract

Polymorphic interface for all graph editor renderers. More...

#include <IGraphRenderer.h>

+ Inheritance diagram for Olympe::IGraphRenderer:

Public Member Functions

virtual ~IGraphRenderer ()
 
virtual void Render ()=0
 Renders the graph canvas into the current ImGui child window.
 
virtual bool Load (const std::string &path)=0
 Loads a graph from a file on disk.
 
virtual bool Save (const std::string &path)=0
 Saves the current graph state to disk.
 
virtual bool IsDirty () const =0
 Returns true when the graph has unsaved changes.
 
virtual std::string GetGraphType () const =0
 Returns the graph type string, e.g.
 
virtual std::string GetCurrentPath () const =0
 Returns the last path successfully loaded/saved, or empty string.
 
virtual void SaveCanvasState ()
 Save the current canvas viewport state (pan, zoom, etc.) Called when tab is deactivated.
 
virtual void RestoreCanvasState ()
 Restore previously saved canvas viewport state Called when tab is reactivated.
 
virtual std::string GetCanvasStateJSON () const
 Get canvas state as JSON string for persistence.
 
virtual void SetCanvasStateJSON (const std::string &json)
 Restore canvas state from JSON string.
 

Detailed Description

Polymorphic interface for all graph editor renderers.

Implementations are owned by TabManager via raw pointers (C++14 style). Lifetime: the owning EditorTab deletes the renderer when the tab is closed.

Definition at line 27 of file IGraphRenderer.h.

Constructor & Destructor Documentation

◆ ~IGraphRenderer()

virtual Olympe::IGraphRenderer::~IGraphRenderer ( )
inlinevirtual

Definition at line 30 of file IGraphRenderer.h.

Member Function Documentation

◆ GetCanvasStateJSON()

virtual std::string Olympe::IGraphRenderer::GetCanvasStateJSON ( ) const
inlinevirtual

Get canvas state as JSON string for persistence.

Returns
JSON representation of current canvas state

Reimplemented in Olympe::BehaviorTreeRenderer, Olympe::EntityPrefabRenderer, and Olympe::VisualScriptRenderer.

Definition at line 96 of file IGraphRenderer.h.

◆ GetCurrentPath()

virtual std::string Olympe::IGraphRenderer::GetCurrentPath ( ) const
pure virtual

Returns the last path successfully loaded/saved, or empty string.

Implemented in Olympe::BehaviorTreeRenderer, Olympe::EntityPrefabRenderer, and Olympe::VisualScriptRenderer.

◆ GetGraphType()

virtual std::string Olympe::IGraphRenderer::GetGraphType ( ) const
pure virtual

Returns the graph type string, e.g.

"VisualScript", "BehaviorTree".

Implemented in Olympe::BehaviorTreeRenderer, Olympe::EntityPrefabRenderer, and Olympe::VisualScriptRenderer.

◆ IsDirty()

virtual bool Olympe::IGraphRenderer::IsDirty ( ) const
pure virtual

Returns true when the graph has unsaved changes.

Implemented in Olympe::BehaviorTreeRenderer, Olympe::EntityPrefabRenderer, and Olympe::VisualScriptRenderer.

◆ Load()

virtual bool Olympe::IGraphRenderer::Load ( const std::string &  path)
pure virtual

Loads a graph from a file on disk.

Parameters
pathAbsolute or relative path to the .ats / .json file.
Returns
true on success.

Implemented in Olympe::BehaviorTreeRenderer, Olympe::EntityPrefabRenderer, and Olympe::VisualScriptRenderer.

◆ Render()

virtual void Olympe::IGraphRenderer::Render ( )
pure virtual

Renders the graph canvas into the current ImGui child window.

Implemented in Olympe::BehaviorTreeRenderer, Olympe::EntityPrefabRenderer, and Olympe::VisualScriptRenderer.

◆ RestoreCanvasState()

virtual void Olympe::IGraphRenderer::RestoreCanvasState ( )
inlinevirtual

Restore previously saved canvas viewport state Called when tab is reactivated.

Ensures smooth tab switching without losing layout.

Reimplemented in Olympe::BehaviorTreeRenderer, Olympe::EntityPrefabRenderer, and Olympe::VisualScriptRenderer.

Definition at line 90 of file IGraphRenderer.h.

◆ Save()

virtual bool Olympe::IGraphRenderer::Save ( const std::string &  path)
pure virtual

Saves the current graph state to disk.

Parameters
pathDestination path. If empty, save to the path passed to Load().
Returns
true on success.

Implemented in Olympe::BehaviorTreeRenderer, Olympe::EntityPrefabRenderer, and Olympe::VisualScriptRenderer.

◆ SaveCanvasState()

virtual void Olympe::IGraphRenderer::SaveCanvasState ( )
inlinevirtual

Save the current canvas viewport state (pan, zoom, etc.) Called when tab is deactivated.

Used to preserve viewport when switching between multiple tabs.

Reimplemented in Olympe::BehaviorTreeRenderer, Olympe::EntityPrefabRenderer, and Olympe::VisualScriptRenderer.

Definition at line 83 of file IGraphRenderer.h.

◆ SetCanvasStateJSON()

virtual void Olympe::IGraphRenderer::SetCanvasStateJSON ( const std::string &  json)
inlinevirtual

Restore canvas state from JSON string.

Parameters
jsonJSON representation of saved canvas state

Reimplemented in Olympe::BehaviorTreeRenderer, Olympe::EntityPrefabRenderer, and Olympe::VisualScriptRenderer.

Definition at line 105 of file IGraphRenderer.h.

References GetComponentTypeID_Static().

+ Here is the call graph for this function:

The documentation for this class was generated from the following file: