![]() |
Olympe Engine 2.0
2D Game Engine with ECS Architecture
|
Singleton manager for multiple node graphs. More...
#include <NodeGraphManager.h>
Collaboration diagram for Olympe::NodeGraph::NodeGraphManager:Public Member Functions | |
| NodeGraphManager (const NodeGraphManager &)=delete | |
| NodeGraphManager & | operator= (const NodeGraphManager &)=delete |
| GraphId | CreateGraph (const std::string &graphType, const std::string &graphKind) |
| Create a new graph. | |
| GraphId | LoadGraph (const std::string &filepath) |
| Load a graph from file. | |
| bool | SaveGraph (GraphId id, const std::string &filepath) |
| Save a graph to file. | |
| bool | CloseGraph (GraphId id) |
| Close a graph. | |
| void | SetActiveGraph (GraphId id) |
| Set active graph. | |
| GraphDocument * | GetActiveGraph () |
| Get active graph. | |
| GraphId | GetActiveGraphId () const |
| Get active graph ID. | |
| GraphDocument * | GetGraph (GraphId id) |
| Get graph by ID. | |
| std::vector< GraphId > | GetAllGraphIds () const |
| Get all graph IDs. | |
| std::string | GetGraphName (GraphId id) const |
| Get graph name (for tab display) | |
| std::vector< GraphId > | GetGraphOrderForTabs () const |
| Get graph order for tabs. | |
Static Public Member Functions | |
| static NodeGraphManager & | Get () |
| Get singleton instance. | |
Private Member Functions | |
| NodeGraphManager () | |
| ~NodeGraphManager () | |
Private Attributes | |
| std::map< GraphId, std::unique_ptr< GraphDocument > > | m_graphs |
| std::map< GraphId, std::string > | m_graphNames |
| std::vector< GraphId > | m_graphOrder |
| GraphId | m_activeGraphId |
| uint32_t | m_nextGraphId = 1 |
Singleton manager for multiple node graphs.
Definition at line 25 of file NodeGraphManager.h.
|
delete |
|
private |
Definition at line 28 of file NodeGraphManager.cpp.
|
private |
Definition at line 33 of file NodeGraphManager.cpp.
Close a graph.
| id | Graph ID |
Definition at line 119 of file NodeGraphManager.cpp.
References GetComponentTypeID_Static(), m_activeGraphId, m_graphNames, m_graphOrder, m_graphs, SYSTEM_LOG, and Olympe::NodeGraph::GraphId::value.
Here is the call graph for this function:| GraphId Olympe::NodeGraph::NodeGraphManager::CreateGraph | ( | const std::string & | graphType, |
| const std::string & | graphKind | ||
| ) |
Create a new graph.
| graphType | Type of graph (e.g., "AIGraph") |
| graphKind | Kind of graph (e.g., "BehaviorTree", "HFSM") |
Definition at line 41 of file NodeGraphManager.cpp.
References GetComponentTypeID_Static(), m_activeGraphId, m_graphNames, m_graphOrder, m_graphs, m_nextGraphId, SYSTEM_LOG, and Olympe::NodeGraph::GraphId::value.
Here is the call graph for this function:
|
static |
Get singleton instance.
Definition at line 22 of file NodeGraphManager.cpp.
References GetComponentTypeID_Static().
Referenced by Olympe::AI::AIEditorGUI::HandleLinkCreation(), Olympe::AI::AIEditorGUI::MenuAction_AutoLayout(), Olympe::AI::AIEditorGUI::MenuAction_Close(), Olympe::AI::AIEditorGUI::MenuAction_Copy(), Olympe::AI::AIEditorGUI::MenuAction_Cut(), Olympe::AI::AIEditorGUI::MenuAction_Delete(), Olympe::AI::AIEditorGUI::MenuAction_NewBT(), Olympe::AI::AIEditorGUI::MenuAction_NewHFSM(), Olympe::AI::AIEditorGUI::MenuAction_Open(), Olympe::AI::AIEditorGUI::MenuAction_Paste(), Olympe::AI::AIEditorGUI::MenuAction_Save(), Olympe::AI::AIEditorGUI::MenuAction_SaveAs(), Olympe::AI::AIEditorGUI::MenuAction_SelectAll(), Olympe::AI::AIEditorGUI::RenderBlackboardPanel(), Olympe::AI::AIEditorGUI::RenderConnections(), Olympe::AI::AIEditorGUI::RenderNode(), Olympe::AI::AIEditorGUI::RenderNodeGraph(), Olympe::AI::AIEditorGUI::RenderNodeGraphCanvas(), Test11_ClipboardCopyPaste(), Test12_ClipboardCut(), Test13_ClipboardLinkPreservation(), Test15_SaveLoadIntegration(), Test2_CreateNewBTGraph(), Test3_LoadExistingBT(), Test4_NodeCreationViaPalette(), Test5_MultiGraph(), Test5_UndoRedo(), Test6_ValidateGraph(), Test7_SaveLoadRoundtrip(), Test8_MultiGraphTabs(), and Olympe::AI::AIEditorGUI::Update().
Here is the call graph for this function:
Here is the caller graph for this function:| GraphDocument * Olympe::NodeGraph::NodeGraphManager::GetActiveGraph | ( | ) |
Get active graph.
Definition at line 168 of file NodeGraphManager.cpp.
References GetGraph(), m_activeGraphId, and Olympe::NodeGraph::GraphId::value.
Here is the call graph for this function:
|
inline |
Get active graph ID.
Definition at line 90 of file NodeGraphManager.h.
References m_activeGraphId.
| std::vector< GraphId > Olympe::NodeGraph::NodeGraphManager::GetAllGraphIds | ( | ) | const |
Get all graph IDs.
Definition at line 190 of file NodeGraphManager.cpp.
References GetComponentTypeID_Static(), and m_graphs.
Here is the call graph for this function:| GraphDocument * Olympe::NodeGraph::NodeGraphManager::GetGraph | ( | GraphId | id | ) |
Get graph by ID.
| id | Graph ID |
Definition at line 180 of file NodeGraphManager.cpp.
References GetComponentTypeID_Static(), and m_graphs.
Referenced by GetActiveGraph().
Here is the call graph for this function:
Here is the caller graph for this function:| std::string Olympe::NodeGraph::NodeGraphManager::GetGraphName | ( | GraphId | id | ) | const |
Get graph name (for tab display)
| id | Graph ID |
Definition at line 200 of file NodeGraphManager.cpp.
References GetComponentTypeID_Static(), and m_graphNames.
Here is the call graph for this function:
|
inline |
Get graph order for tabs.
Definition at line 120 of file NodeGraphManager.h.
References m_graphOrder.
Load a graph from file.
| filepath | Path to JSON file |
Definition at line 62 of file NodeGraphManager.cpp.
References GetComponentTypeID_Static(), JsonHelper::LoadJsonFromFile(), Olympe::NodeGraph::GraphMigrator::LoadWithMigration(), m_activeGraphId, m_graphNames, m_graphOrder, m_graphs, m_nextGraphId, SYSTEM_LOG, and Olympe::NodeGraph::GraphId::value.
Here is the call graph for this function:
|
delete |
Save a graph to file.
| id | Graph ID |
| filepath | Path to save file |
Definition at line 95 of file NodeGraphManager.cpp.
References GetComponentTypeID_Static(), m_graphs, JsonHelper::SaveJsonToFile(), and SYSTEM_LOG.
Here is the call graph for this function:Set active graph.
| id | Graph ID |
Definition at line 159 of file NodeGraphManager.cpp.
References GetComponentTypeID_Static(), m_activeGraphId, and m_graphs.
Here is the call graph for this function:
|
private |
Definition at line 129 of file NodeGraphManager.h.
Referenced by CloseGraph(), CreateGraph(), GetActiveGraph(), GetActiveGraphId(), LoadGraph(), and SetActiveGraph().
|
private |
Definition at line 127 of file NodeGraphManager.h.
Referenced by CloseGraph(), CreateGraph(), GetGraphName(), and LoadGraph().
|
private |
Definition at line 128 of file NodeGraphManager.h.
Referenced by CloseGraph(), CreateGraph(), GetGraphOrderForTabs(), and LoadGraph().
|
private |
Definition at line 126 of file NodeGraphManager.h.
Referenced by CloseGraph(), CreateGraph(), GetAllGraphIds(), GetGraph(), LoadGraph(), SaveGraph(), and SetActiveGraph().
|
private |
Definition at line 130 of file NodeGraphManager.h.
Referenced by CreateGraph(), and LoadGraph().