Olympe Engine 2.0
2D Game Engine with ECS Architecture
Loading...
Searching...
No Matches
Public Member Functions | Private Member Functions | Static Private Member Functions | Private Attributes | Friends | List of all members
Olympe::AI::AIEditorGUI Class Reference

Main AI Editor GUI class. More...

#include <AIEditorGUI.h>

+ Collaboration diagram for Olympe::AI::AIEditorGUI:

Public Member Functions

 AIEditorGUI ()
 
 ~AIEditorGUI ()
 
bool Initialize ()
 Initialize the editor.
 
void Shutdown ()
 Shutdown and cleanup.
 
void Render ()
 Render the complete UI.
 
void Update (float deltaTime)
 Update (called per frame)
 
bool IsActive () const
 Check if editor is active.
 
void SetActive (bool active)
 Set editor active state.
 
NodeGraph::CommandStackGetCommandStack ()
 Get command stack for undo/redo.
 

Private Member Functions

void RenderMenuBar ()
 Render main menu bar.
 
void RenderAssetBrowser ()
 Render asset browser panel (left)
 
void RenderNodeGraph ()
 Render node graph panel (center)
 
void RenderInspector ()
 Render inspector panel (right)
 
void MenuAction_NewBT ()
 
void MenuAction_NewHFSM ()
 
void MenuAction_Open ()
 
void MenuAction_Save ()
 
void MenuAction_SaveAs ()
 
void MenuAction_Close ()
 
void MenuAction_Undo ()
 
void MenuAction_Redo ()
 
void MenuAction_Cut ()
 
void MenuAction_Copy ()
 
void MenuAction_Paste ()
 
void MenuAction_Delete ()
 
void MenuAction_SelectAll ()
 
void MenuAction_ResetLayout ()
 
void MenuAction_ShowNodePalette ()
 
void MenuAction_ShowBlackboard ()
 
void MenuAction_ShowSensesPanel ()
 
void MenuAction_ShowRuntimeDebug ()
 
void MenuAction_About ()
 
void MenuAction_AutoLayout ()
 
void RenderNodeGraphCanvas ()
 Render node graph with ImNodes.
 
void RenderNode (NodeGraph::NodeId nodeId)
 Render a single node.
 
void RenderConnections ()
 Render connections between nodes.
 
void HandleNodeCreation ()
 Handle node creation from palette.
 
void HandleNodeSelection ()
 Handle node selection.
 
void HandleLinkCreation ()
 Handle link creation.
 
void RenderBlackboardPanel ()
 Render blackboard inspector panel.
 
void RenderSensesPanel ()
 Render AI senses debug panel.
 
void RenderRuntimeDebugPanel ()
 Render runtime debug panel (entity list + execution)
 
void ScanAIGraphDirectory (const std::string &directory)
 Scan directory for AI graphs.
 
void RenderAssetEntry (const std::string &filename, const std::string &fullPath)
 Render asset entry.
 

Static Private Member Functions

static std::string ExtractDirectory (const std::string &filepath)
 Extract directory from filepath.
 
static std::string ExtractFilename (const std::string &filepath)
 Extract filename from filepath.
 
static bool EndsWith (const std::string &str, const std::string &suffix)
 Check if string ends with suffix.
 

Private Attributes

bool m_isActive
 
bool m_showNodePalette
 
bool m_showBlackboardPanel
 
bool m_showSensesPanel
 
bool m_showRuntimeDebugPanel
 
char m_assetSearchFilter [256]
 
std::vector< std::string > m_assetFiles
 
std::string m_lastOpenPath
 
std::string m_lastSavePath
 
std::unique_ptr< BTNodePalettem_nodePalette
 
BlackboardPanel m_blackboardPanel
 
NodeGraph::CommandStack m_commandStack
 
voidm_imnodesContext
 
std::vector< intm_selectedNodeIds
 
std::vector< intm_selectedLinkIds
 

Friends

class AIEditorMenus
 

Detailed Description

Main AI Editor GUI class.

Manages the complete AI Editor interface. Integrates NodeGraphCore for graph management and AIGraphPlugin_BT for BT-specific functionality.

Definition at line 41 of file AIEditorGUI.h.

Constructor & Destructor Documentation

◆ AIEditorGUI()

Olympe::AI::AIEditorGUI::AIEditorGUI ( )

Definition at line 32 of file AIEditorGUI.cpp.

References m_assetSearchFilter.

◆ ~AIEditorGUI()

Olympe::AI::AIEditorGUI::~AIEditorGUI ( )

Definition at line 43 of file AIEditorGUI.cpp.

References Shutdown().

+ Here is the call graph for this function:

Member Function Documentation

◆ EndsWith()

bool Olympe::AI::AIEditorGUI::EndsWith ( const std::string &  str,
const std::string &  suffix 
)
staticprivate

Check if string ends with suffix.

Parameters
strString to check
suffixSuffix to look for
Returns
true if str ends with suffix

Definition at line 938 of file AIEditorGUI.cpp.

References GetComponentTypeID_Static().

+ Here is the call graph for this function:

◆ ExtractDirectory()

std::string Olympe::AI::AIEditorGUI::ExtractDirectory ( const std::string &  filepath)
staticprivate

Extract directory from filepath.

Parameters
filepathFull file path
Returns
Directory path without filename

Definition at line 920 of file AIEditorGUI.cpp.

References GetComponentTypeID_Static().

+ Here is the call graph for this function:

◆ ExtractFilename()

std::string Olympe::AI::AIEditorGUI::ExtractFilename ( const std::string &  filepath)
staticprivate

Extract filename from filepath.

Parameters
filepathFull file path
Returns
Filename without directory

Definition at line 929 of file AIEditorGUI.cpp.

References GetComponentTypeID_Static().

+ Here is the call graph for this function:

◆ GetCommandStack()

NodeGraph::CommandStack & Olympe::AI::AIEditorGUI::GetCommandStack ( )
inline

Get command stack for undo/redo.

Definition at line 84 of file AIEditorGUI.h.

References m_commandStack.

◆ HandleLinkCreation()

void Olympe::AI::AIEditorGUI::HandleLinkCreation ( )
private

Handle link creation.

Definition at line 516 of file AIEditorGUI.cpp.

References Olympe::NodeGraph::NodeGraphManager::Get(), GetComponentTypeID_Static(), SYSTEM_LOG, and Olympe::NodeGraph::PinId::value.

Referenced by RenderNodeGraphCanvas().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ HandleNodeCreation()

void Olympe::AI::AIEditorGUI::HandleNodeCreation ( )
private

Handle node creation from palette.

Definition at line 491 of file AIEditorGUI.cpp.

References m_nodePalette.

Referenced by RenderNodeGraphCanvas().

+ Here is the caller graph for this function:

◆ HandleNodeSelection()

void Olympe::AI::AIEditorGUI::HandleNodeSelection ( )
private

Handle node selection.

Definition at line 499 of file AIEditorGUI.cpp.

References GetComponentTypeID_Static(), m_selectedLinkIds, and m_selectedNodeIds.

Referenced by RenderNodeGraphCanvas().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ Initialize()

bool Olympe::AI::AIEditorGUI::Initialize ( )

◆ IsActive()

bool Olympe::AI::AIEditorGUI::IsActive ( ) const
inline

Check if editor is active.

Definition at line 74 of file AIEditorGUI.h.

References m_isActive.

◆ MenuAction_About()

void Olympe::AI::AIEditorGUI::MenuAction_About ( )
private

Definition at line 911 of file AIEditorGUI.cpp.

References SYSTEM_LOG.

Referenced by RenderMenuBar().

+ Here is the caller graph for this function:

◆ MenuAction_AutoLayout()

void Olympe::AI::AIEditorGUI::MenuAction_AutoLayout ( )
private

Definition at line 685 of file AIEditorGUI.cpp.

References Olympe::NodeGraph::NodeGraphManager::Get(), GetComponentTypeID_Static(), and SYSTEM_LOG.

Referenced by RenderMenuBar().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ MenuAction_Close()

void Olympe::AI::AIEditorGUI::MenuAction_Close ( )
private

Definition at line 719 of file AIEditorGUI.cpp.

References Olympe::NodeGraph::NodeGraphManager::Get(), GetComponentTypeID_Static(), and SYSTEM_LOG.

Referenced by RenderMenuBar(), and Update().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ MenuAction_Copy()

void Olympe::AI::AIEditorGUI::MenuAction_Copy ( )
private

Definition at line 777 of file AIEditorGUI.cpp.

References Olympe::AI::AIEditorClipboard::Copy(), Olympe::AI::AIEditorClipboard::Get(), Olympe::NodeGraph::NodeGraphManager::Get(), GetComponentTypeID_Static(), m_selectedNodeIds, SYSTEM_LOG, and Olympe::NodeGraph::NodeId::value.

Referenced by RenderMenuBar(), and Update().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ MenuAction_Cut()

void Olympe::AI::AIEditorGUI::MenuAction_Cut ( )
private

Definition at line 746 of file AIEditorGUI.cpp.

References Olympe::AI::AIEditorClipboard::Cut(), Olympe::AI::AIEditorClipboard::Get(), Olympe::NodeGraph::NodeGraphManager::Get(), GetComponentTypeID_Static(), m_selectedNodeIds, SYSTEM_LOG, and Olympe::NodeGraph::NodeId::value.

Referenced by RenderMenuBar(), and Update().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ MenuAction_Delete()

void Olympe::AI::AIEditorGUI::MenuAction_Delete ( )
private

Definition at line 832 of file AIEditorGUI.cpp.

References Olympe::NodeGraph::NodeGraphManager::Get(), GetComponentTypeID_Static(), m_selectedNodeIds, SYSTEM_LOG, and Olympe::NodeGraph::NodeId::value.

Referenced by RenderMenuBar(), and Update().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ MenuAction_NewBT()

void Olympe::AI::AIEditorGUI::MenuAction_NewBT ( )
private

Definition at line 600 of file AIEditorGUI.cpp.

References Olympe::NodeGraph::NodeGraphManager::Get(), GetComponentTypeID_Static(), and SYSTEM_LOG.

Referenced by RenderMenuBar(), and Update().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ MenuAction_NewHFSM()

void Olympe::AI::AIEditorGUI::MenuAction_NewHFSM ( )
private

Definition at line 609 of file AIEditorGUI.cpp.

References Olympe::NodeGraph::NodeGraphManager::Get(), GetComponentTypeID_Static(), and SYSTEM_LOG.

Referenced by RenderMenuBar().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ MenuAction_Open()

void Olympe::AI::AIEditorGUI::MenuAction_Open ( )
private

Definition at line 618 of file AIEditorGUI.cpp.

References Olympe::NodeGraph::NodeGraphManager::Get(), GetComponentTypeID_Static(), m_lastOpenPath, Olympe::AI::AIEditorFileDialog::OpenFile(), and SYSTEM_LOG.

Referenced by RenderMenuBar(), and Update().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ MenuAction_Paste()

void Olympe::AI::AIEditorGUI::MenuAction_Paste ( )
private

Definition at line 805 of file AIEditorGUI.cpp.

References Olympe::AI::AIEditorClipboard::Get(), Olympe::NodeGraph::NodeGraphManager::Get(), GetComponentTypeID_Static(), m_selectedNodeIds, Olympe::AI::AIEditorClipboard::Paste(), and SYSTEM_LOG.

Referenced by RenderMenuBar(), and Update().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ MenuAction_Redo()

void Olympe::AI::AIEditorGUI::MenuAction_Redo ( )
private

Definition at line 738 of file AIEditorGUI.cpp.

References Olympe::NodeGraph::CommandStack::CanRedo(), Olympe::NodeGraph::CommandStack::GetRedoDescription(), m_commandStack, Olympe::NodeGraph::CommandStack::Redo(), and SYSTEM_LOG.

Referenced by RenderMenuBar(), and Update().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ MenuAction_ResetLayout()

void Olympe::AI::AIEditorGUI::MenuAction_ResetLayout ( )
private

Definition at line 880 of file AIEditorGUI.cpp.

References m_showBlackboardPanel, m_showNodePalette, m_showRuntimeDebugPanel, m_showSensesPanel, and SYSTEM_LOG.

Referenced by RenderMenuBar().

+ Here is the caller graph for this function:

◆ MenuAction_Save()

void Olympe::AI::AIEditorGUI::MenuAction_Save ( )
private

Definition at line 638 of file AIEditorGUI.cpp.

References Olympe::NodeGraph::NodeGraphManager::Get(), GetComponentTypeID_Static(), and SYSTEM_LOG.

Referenced by RenderMenuBar(), and Update().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ MenuAction_SaveAs()

void Olympe::AI::AIEditorGUI::MenuAction_SaveAs ( )
private

Definition at line 664 of file AIEditorGUI.cpp.

References Olympe::NodeGraph::NodeGraphManager::Get(), GetComponentTypeID_Static(), m_lastSavePath, Olympe::AI::AIEditorFileDialog::SaveFile(), and SYSTEM_LOG.

Referenced by RenderMenuBar(), and Update().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ MenuAction_SelectAll()

void Olympe::AI::AIEditorGUI::MenuAction_SelectAll ( )
private

Definition at line 859 of file AIEditorGUI.cpp.

References Olympe::NodeGraph::NodeGraphManager::Get(), GetComponentTypeID_Static(), Olympe::NodeGraph::GraphDocument::GetNodes(), m_selectedNodeIds, and SYSTEM_LOG.

Referenced by RenderMenuBar(), and Update().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ MenuAction_ShowBlackboard()

void Olympe::AI::AIEditorGUI::MenuAction_ShowBlackboard ( )
private

Definition at line 896 of file AIEditorGUI.cpp.

References m_showBlackboardPanel.

◆ MenuAction_ShowNodePalette()

void Olympe::AI::AIEditorGUI::MenuAction_ShowNodePalette ( )
private

Definition at line 891 of file AIEditorGUI.cpp.

References m_showNodePalette.

◆ MenuAction_ShowRuntimeDebug()

void Olympe::AI::AIEditorGUI::MenuAction_ShowRuntimeDebug ( )
private

Definition at line 906 of file AIEditorGUI.cpp.

References m_showRuntimeDebugPanel.

◆ MenuAction_ShowSensesPanel()

void Olympe::AI::AIEditorGUI::MenuAction_ShowSensesPanel ( )
private

Definition at line 901 of file AIEditorGUI.cpp.

References m_showSensesPanel.

◆ MenuAction_Undo()

void Olympe::AI::AIEditorGUI::MenuAction_Undo ( )
private

Definition at line 730 of file AIEditorGUI.cpp.

References Olympe::NodeGraph::CommandStack::CanUndo(), Olympe::NodeGraph::CommandStack::GetUndoDescription(), m_commandStack, SYSTEM_LOG, and Olympe::NodeGraph::CommandStack::Undo().

Referenced by RenderMenuBar(), and Update().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ Render()

void Olympe::AI::AIEditorGUI::Render ( )

◆ RenderAssetBrowser()

void Olympe::AI::AIEditorGUI::RenderAssetBrowser ( )
private

Render asset browser panel (left)

Definition at line 351 of file AIEditorGUI.cpp.

References GetComponentTypeID_Static(), m_assetFiles, m_assetSearchFilter, and RenderAssetEntry().

Referenced by Render().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ RenderAssetEntry()

void Olympe::AI::AIEditorGUI::RenderAssetEntry ( const std::string &  filename,
const std::string &  fullPath 
)
private

Render asset entry.

Parameters
filenameFilename to render
fullPathFull path to file

Definition at line 384 of file AIEditorGUI.cpp.

References GetComponentTypeID_Static(), and SYSTEM_LOG.

Referenced by RenderAssetBrowser().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ RenderBlackboardPanel()

void Olympe::AI::AIEditorGUI::RenderBlackboardPanel ( )
private

Render blackboard inspector panel.

Definition at line 561 of file AIEditorGUI.cpp.

References Olympe::NodeGraph::NodeGraphManager::Get(), GetComponentTypeID_Static(), m_blackboardPanel, m_showBlackboardPanel, and Olympe::AI::BlackboardPanel::Render().

Referenced by Render().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ RenderConnections()

void Olympe::AI::AIEditorGUI::RenderConnections ( )
private

Render connections between nodes.

Definition at line 472 of file AIEditorGUI.cpp.

References Olympe::NodeGraph::NodeGraphManager::Get(), GetComponentTypeID_Static(), and Olympe::NodeGraph::GraphDocument::GetLinks().

Referenced by RenderNodeGraphCanvas().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ RenderInspector()

void Olympe::AI::AIEditorGUI::RenderInspector ( )
private

Render inspector panel (right)

Definition at line 543 of file AIEditorGUI.cpp.

References m_selectedNodeIds.

Referenced by Render().

+ Here is the caller graph for this function:

◆ RenderMenuBar()

void Olympe::AI::AIEditorGUI::RenderMenuBar ( )
private

◆ RenderNode()

void Olympe::AI::AIEditorGUI::RenderNode ( NodeGraph::NodeId  nodeId)
private

Render a single node.

Parameters
nodeIdNode to render

Definition at line 442 of file AIEditorGUI.cpp.

References Olympe::NodeGraph::NodeGraphManager::Get(), GetComponentTypeID_Static(), m_selectedNodeIds, Olympe::AI::AIEditorNodeRenderer::RenderNode(), and Olympe::NodeGraph::NodeId::value.

Referenced by RenderNodeGraphCanvas().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ RenderNodeGraph()

void Olympe::AI::AIEditorGUI::RenderNodeGraph ( )
private

Render node graph panel (center)

Definition at line 396 of file AIEditorGUI.cpp.

References Olympe::NodeGraph::NodeGraphManager::Get(), GetComponentTypeID_Static(), and RenderNodeGraphCanvas().

Referenced by Render().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ RenderNodeGraphCanvas()

void Olympe::AI::AIEditorGUI::RenderNodeGraphCanvas ( )
private

Render node graph with ImNodes.

Definition at line 414 of file AIEditorGUI.cpp.

References Olympe::NodeGraph::NodeGraphManager::Get(), GetComponentTypeID_Static(), Olympe::NodeGraph::GraphDocument::GetNodes(), HandleLinkCreation(), HandleNodeCreation(), HandleNodeSelection(), m_imnodesContext, RenderConnections(), and RenderNode().

Referenced by RenderNodeGraph().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ RenderRuntimeDebugPanel()

void Olympe::AI::AIEditorGUI::RenderRuntimeDebugPanel ( )
private

Render runtime debug panel (entity list + execution)

Definition at line 583 of file AIEditorGUI.cpp.

References m_showRuntimeDebugPanel.

Referenced by Render().

+ Here is the caller graph for this function:

◆ RenderSensesPanel()

void Olympe::AI::AIEditorGUI::RenderSensesPanel ( )
private

Render AI senses debug panel.

Definition at line 570 of file AIEditorGUI.cpp.

References m_showSensesPanel.

Referenced by Render().

+ Here is the caller graph for this function:

◆ ScanAIGraphDirectory()

void Olympe::AI::AIEditorGUI::ScanAIGraphDirectory ( const std::string &  directory)
private

Scan directory for AI graphs.

Definition at line 376 of file AIEditorGUI.cpp.

References GetComponentTypeID_Static(), m_assetFiles, and SYSTEM_LOG.

Referenced by Initialize().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ SetActive()

void Olympe::AI::AIEditorGUI::SetActive ( bool  active)
inline

Set editor active state.

Definition at line 79 of file AIEditorGUI.h.

References GetComponentTypeID_Static(), and m_isActive.

+ Here is the call graph for this function:

◆ Shutdown()

void Olympe::AI::AIEditorGUI::Shutdown ( )

Shutdown and cleanup.

Definition at line 81 of file AIEditorGUI.cpp.

References Olympe::NodeGraph::CommandStack::Clear(), GetComponentTypeID_Static(), m_commandStack, m_imnodesContext, m_isActive, m_nodePalette, and SYSTEM_LOG.

Referenced by ~AIEditorGUI().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ Update()

void Olympe::AI::AIEditorGUI::Update ( float  deltaTime)

Friends And Related Symbol Documentation

◆ AIEditorMenus

Definition at line 44 of file AIEditorGUI.h.

Member Data Documentation

◆ m_assetFiles

std::vector<std::string> Olympe::AI::AIEditorGUI::m_assetFiles
private

Definition at line 244 of file AIEditorGUI.h.

Referenced by RenderAssetBrowser(), and ScanAIGraphDirectory().

◆ m_assetSearchFilter

char Olympe::AI::AIEditorGUI::m_assetSearchFilter[256]
private

Definition at line 243 of file AIEditorGUI.h.

Referenced by AIEditorGUI(), and RenderAssetBrowser().

◆ m_blackboardPanel

BlackboardPanel Olympe::AI::AIEditorGUI::m_blackboardPanel
private

Definition at line 254 of file AIEditorGUI.h.

Referenced by RenderBlackboardPanel().

◆ m_commandStack

NodeGraph::CommandStack Olympe::AI::AIEditorGUI::m_commandStack
private

◆ m_imnodesContext

void* Olympe::AI::AIEditorGUI::m_imnodesContext
private

Definition at line 260 of file AIEditorGUI.h.

Referenced by Initialize(), RenderNodeGraphCanvas(), and Shutdown().

◆ m_isActive

bool Olympe::AI::AIEditorGUI::m_isActive
private

Definition at line 236 of file AIEditorGUI.h.

Referenced by Initialize(), IsActive(), Render(), SetActive(), Shutdown(), and Update().

◆ m_lastOpenPath

std::string Olympe::AI::AIEditorGUI::m_lastOpenPath
private

Definition at line 247 of file AIEditorGUI.h.

Referenced by MenuAction_Open().

◆ m_lastSavePath

std::string Olympe::AI::AIEditorGUI::m_lastSavePath
private

Definition at line 248 of file AIEditorGUI.h.

Referenced by MenuAction_SaveAs().

◆ m_nodePalette

std::unique_ptr<BTNodePalette> Olympe::AI::AIEditorGUI::m_nodePalette
private

Definition at line 251 of file AIEditorGUI.h.

Referenced by HandleNodeCreation(), Initialize(), Render(), and Shutdown().

◆ m_selectedLinkIds

std::vector<int> Olympe::AI::AIEditorGUI::m_selectedLinkIds
private

Definition at line 264 of file AIEditorGUI.h.

Referenced by HandleNodeSelection().

◆ m_selectedNodeIds

std::vector<int> Olympe::AI::AIEditorGUI::m_selectedNodeIds
private

◆ m_showBlackboardPanel

bool Olympe::AI::AIEditorGUI::m_showBlackboardPanel
private

◆ m_showNodePalette

bool Olympe::AI::AIEditorGUI::m_showNodePalette
private

◆ m_showRuntimeDebugPanel

bool Olympe::AI::AIEditorGUI::m_showRuntimeDebugPanel
private

◆ m_showSensesPanel

bool Olympe::AI::AIEditorGUI::m_showSensesPanel
private

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