![]() |
Olympe Engine 2.0
2D Game Engine with ECS Architecture
|
#include <BTNodeGraphManager.h>
Collaboration diagram for Olympe::NodeGraph:Public Types | |
| enum class | BlackboardType : uint8_t { Int = 0 , Float , Bool , String , Vector3 } |
| Supported variable types in the blackboard. More... | |
| enum class | EditorMode { Editor , Visualizer , Debug } |
| Mode d'édition du graphe. More... | |
| enum class | LayoutDirection : uint8_t { TopToBottom = 0 , BottomToTop = 1 , LeftToRight = 2 , RightToLeft = 3 } |
| using | Vector2 = Vector |
Static Public Member Functions | |
| static NodeGraph | FromJson (const nlohmann::json &j) |
Public Attributes | |
| std::string | name |
| std::string | type |
| int | rootNodeId = -1 |
| EditorMetadata | editorMetadata |
| std::vector< ClipboardNode > | m_clipboardData |
Private Member Functions | |
| bool | IsValidRoot (uint32_t nodeId) const |
| Check if a node ID is a valid root (main Root or OnEvent root) Root nodes cannot be deleted or moved under other nodes. | |
| void | AddEventRoot (uint32_t nodeId) |
| Add node ID to event roots array Called when creating an OnEvent node. | |
| void | RemoveEventRoot (uint32_t nodeId) |
| Remove node ID from event roots array Called when deleting an OnEvent node. | |
| const std::vector< uint32_t > & | GetEventRootIds () const |
| Get all OnEvent root node IDs. | |
| int | FindNodeIndex (int nodeId) const |
Private Attributes | |
| std::vector< GraphNode > | m_Nodes |
| int | m_NextNodeId = 1 |
| bool | m_IsDirty = false |
| std::string | m_Filepath |
| std::unique_ptr< CommandHistory > | m_commandHistory |
| std::vector< uint32_t > | m_eventRootIds |
| Separate array of node IDs that are OnEvent root nodes These nodes represent independent execution trees triggered by EventQueue messages Not connected to the main Root node tree. | |
Definition at line 279 of file BTNodeGraphManager.h.
Definition at line 64 of file NodeGraphCore.h.
Supported variable types in the blackboard.
| Enumerator | |
|---|---|
| Int | |
| Float | |
| Bool | |
| String | |
| Vector3 | |
Definition at line 29 of file BlackboardSystem.h.
Mode d'édition du graphe.
| Enumerator | |
|---|---|
| Editor | |
| Visualizer | |
| Debug | |
Definition at line 23 of file EditorContext.h.
| Enumerator | |
|---|---|
| TopToBottom | |
| BottomToTop | |
| LeftToRight | |
| RightToLeft | |
Definition at line 123 of file NodeGraphCore.h.
| Olympe::NodeGraph::NodeGraph | ( | ) |
Definition at line 27 of file BTNodeGraphManager.cpp.
|
default |
Definition at line 36 of file BTNodeGraphManager.cpp.
|
noexcept |
Definition at line 69 of file BTNodeGraphManager.cpp.
Add node ID to event roots array Called when creating an OnEvent node.
Definition at line 637 of file BTNodeGraphManager.cpp.
References m_eventRootIds, and MarkDirty().
Here is the call graph for this function:| void Olympe::NodeGraph::CalculateNodePositionsHierarchical | ( | ) |
Definition at line 674 of file BTNodeGraphManager.cpp.
References FindNodeIndex(), GetComponentTypeID_Static(), m_Nodes, and rootNodeId.
Here is the call graph for this function:| bool Olympe::NodeGraph::CanRedo | ( | ) | const |
Definition at line 600 of file BTNodeGraphManager.cpp.
References m_commandHistory.
| bool Olympe::NodeGraph::CanUndo | ( | ) | const |
Definition at line 595 of file BTNodeGraphManager.cpp.
References m_commandHistory.
| void Olympe::NodeGraph::Clear | ( | ) |
Definition at line 576 of file BTNodeGraphManager.cpp.
References m_commandHistory, m_NextNodeId, m_Nodes, and rootNodeId.
|
inline |
Definition at line 334 of file BTNodeGraphManager.h.
References m_IsDirty.
Referenced by Olympe::NodeGraphShared::BTGraphDocumentConverter::FromBehaviorTree().
Here is the caller graph for this function:Definition at line 1174 of file BTNodeGraphManager.cpp.
References GetComponentTypeID_Static(), m_clipboardData, m_IsDirty, m_Nodes, and Olympe::ClipboardNode::nodeId.
Referenced by Olympe::CopyNodesCommand::Execute().
Here is the call graph for this function:
Here is the caller graph for this function:| int Olympe::NodeGraph::CreateNode | ( | NodeType | type, |
| float | x, | ||
| float | y, | ||
| const std::string & | name = "" |
||
| ) |
Definition at line 100 of file BTNodeGraphManager.cpp.
References GetComponentTypeID_Static(), Olympe::GraphNode::id, m_NextNodeId, m_Nodes, MarkDirty(), and Olympe::NodeTypeToString().
Here is the call graph for this function:Definition at line 117 of file BTNodeGraphManager.cpp.
References FindNodeIndex(), GetComponentTypeID_Static(), m_Nodes, and MarkDirty().
Referenced by Olympe::Blueprint::CreateNodeCommand::Undo(), Olympe::Blueprint::DuplicateNodeCommand::Undo(), Olympe::PasteNodesCommand::Undo(), and Olympe::DuplicateNodeCommand::Undo().
Here is the call graph for this function:
Here is the caller graph for this function:| std::vector< int > Olympe::NodeGraph::DuplicateNodes | ( | const std::vector< int > & | nodeIds, |
| float | offsetX = 30.0f, |
||
| float | offsetY = 30.0f |
||
| ) |
Definition at line 1246 of file BTNodeGraphManager.cpp.
References GetComponentTypeID_Static(), Olympe::GraphNode::id, m_IsDirty, m_NextNodeId, and m_Nodes.
Referenced by Olympe::DuplicateNodeCommand::Execute().
Here is the call graph for this function:
Here is the caller graph for this function:Definition at line 664 of file BTNodeGraphManager.cpp.
References GetComponentTypeID_Static(), and m_Nodes.
Referenced by CalculateNodePositionsHierarchical(), DeleteNode(), GetNode(), and GetNode().
Here is the call graph for this function:
Here is the caller graph for this function:
|
static |
Definition at line 360 of file BTNodeGraphManager.cpp.
References JsonHelper::ForEachInArray(), GetComponentTypeID_Static(), JsonHelper::GetFloat(), JsonHelper::GetInt(), JsonHelper::GetString(), Olympe::GraphNode::id, JsonHelper::IsArray(), name, and Olympe::StringToNodeType().
Here is the call graph for this function:| std::vector< GraphLink > Olympe::NodeGraph::GetAllLinks | ( | ) | const |
Definition at line 234 of file BTNodeGraphManager.cpp.
References GetComponentTypeID_Static(), and m_Nodes.
Here is the call graph for this function:| std::vector< GraphNode * > Olympe::NodeGraph::GetAllNodes | ( | ) |
Definition at line 161 of file BTNodeGraphManager.cpp.
References GetComponentTypeID_Static(), and m_Nodes.
Referenced by Olympe::NodeGraphPanel::RenderContextMenu(), and Olympe::NodeGraphPanel::SyncNodePositionsFromImNodes().
Here is the call graph for this function:
Here is the caller graph for this function:Definition at line 169 of file BTNodeGraphManager.cpp.
References GetComponentTypeID_Static(), and m_Nodes.
Here is the call graph for this function:| CommandHistory * Olympe::NodeGraph::GetCommandHistory | ( | ) |
Definition at line 585 of file BTNodeGraphManager.cpp.
References m_commandHistory.
| const CommandHistory * Olympe::NodeGraph::GetCommandHistory | ( | ) | const |
Definition at line 590 of file BTNodeGraphManager.cpp.
References m_commandHistory.
Get all OnEvent root node IDs.
Definition at line 659 of file BTNodeGraphManager.cpp.
References m_eventRootIds.
|
inline |
Definition at line 337 of file BTNodeGraphManager.h.
References m_Filepath.
|
inline |
Definition at line 325 of file BTNodeGraphManager.h.
References m_NextNodeId.
Definition at line 145 of file BTNodeGraphManager.cpp.
References FindNodeIndex(), GetComponentTypeID_Static(), and m_Nodes.
Referenced by GetNodeParameter(), LinkNodes(), SetNodeParameter(), UnlinkNodes(), and ValidateGraph().
Here is the call graph for this function:
Here is the caller graph for this function:Definition at line 153 of file BTNodeGraphManager.cpp.
References FindNodeIndex(), GetComponentTypeID_Static(), and m_Nodes.
Here is the call graph for this function:Definition at line 267 of file BTNodeGraphManager.cpp.
References GetComponentTypeID_Static(), and GetNode().
Here is the call graph for this function:| std::string Olympe::NodeGraph::GetRedoDescription | ( | ) | const |
Definition at line 610 of file BTNodeGraphManager.cpp.
References m_commandHistory.
|
inline |
Definition at line 326 of file BTNodeGraphManager.h.
| std::string Olympe::NodeGraph::GetUndoDescription | ( | ) | const |
Definition at line 605 of file BTNodeGraphManager.cpp.
References m_commandHistory.
|
inline |
Definition at line 339 of file BTNodeGraphManager.h.
References m_Filepath.
Referenced by Olympe::NodeGraphPanel::RenderContent().
Here is the caller graph for this function:
|
inline |
Definition at line 332 of file BTNodeGraphManager.h.
References m_IsDirty.
Referenced by Olympe::BehaviorTreeRenderer::IsDirty().
Here is the caller graph for this function:Check if a node ID is a valid root (main Root or OnEvent root) Root nodes cannot be deleted or moved under other nodes.
Definition at line 627 of file BTNodeGraphManager.cpp.
References m_eventRootIds, and rootNodeId.
Definition at line 177 of file BTNodeGraphManager.cpp.
References Olympe::BT_Decorator, Olympe::GraphNode::childIds, Olympe::GraphNode::decoratorChildId, GetNode(), MarkDirty(), and Olympe::GraphNode::type.
Referenced by Olympe::Blueprint::LinkNodesCommand::Execute(), and Olympe::Blueprint::UnlinkNodesCommand::Undo().
Here is the call graph for this function:
Here is the caller graph for this function:
|
inline |
Definition at line 333 of file BTNodeGraphManager.h.
References m_IsDirty.
Referenced by AddEventRoot(), CreateNode(), DeleteNode(), LinkNodes(), RemoveEventRoot(), Olympe::NodeGraphPanel::RenderNodePinsAndContent(), SetNodeParameter(), and UnlinkNodes().
Here is the caller graph for this function:Definition at line 50 of file BTNodeGraphManager.cpp.
References editorMetadata, GetComponentTypeID_Static(), m_commandHistory, m_eventRootIds, m_Filepath, m_IsDirty, m_NextNodeId, m_Nodes, name, rootNodeId, and type.
Referenced by ~NodeGraph().
Here is the call graph for this function:
Here is the caller graph for this function:Definition at line 83 of file BTNodeGraphManager.cpp.
References GetComponentTypeID_Static().
Here is the call graph for this function:| std::vector< int > Olympe::NodeGraph::PasteNodesFromClipboard | ( | float | offsetX = 30.0f, |
| float | offsetY = 30.0f |
||
| ) |
Definition at line 1206 of file BTNodeGraphManager.cpp.
References GetComponentTypeID_Static(), Olympe::GraphNode::id, m_clipboardData, m_IsDirty, m_NextNodeId, and m_Nodes.
Referenced by Olympe::PasteNodesCommand::Execute().
Here is the call graph for this function:
Here is the caller graph for this function:| bool Olympe::NodeGraph::Redo | ( | ) |
Definition at line 620 of file BTNodeGraphManager.cpp.
References m_commandHistory.
Remove node ID from event roots array Called when deleting an OnEvent node.
Definition at line 648 of file BTNodeGraphManager.cpp.
References GetComponentTypeID_Static(), m_eventRootIds, and MarkDirty().
Here is the call graph for this function:Definition at line 338 of file BTNodeGraphManager.h.
References m_Filepath.
| bool Olympe::NodeGraph::SetNodeParameter | ( | int | nodeId, |
| const std::string & | paramName, | ||
| const std::string & | value | ||
| ) |
Definition at line 256 of file BTNodeGraphManager.cpp.
References GetComponentTypeID_Static(), GetNode(), and MarkDirty().
Referenced by Olympe::Blueprint::SetParameterCommand::Execute(), and Olympe::Blueprint::SetParameterCommand::Undo().
Here is the call graph for this function:
Here is the caller graph for this function:| nlohmann::json Olympe::NodeGraph::ToJson | ( | ) | const |
Definition at line 280 of file BTNodeGraphManager.cpp.
References editorMetadata, GetComponentTypeID_Static(), Olympe::EditorMetadata::lastModified, m_eventRootIds, m_Nodes, name, Olympe::NodeTypeToString(), rootNodeId, Olympe::EditorMetadata::scrollOffsetX, Olympe::EditorMetadata::scrollOffsetY, type, and Olympe::EditorMetadata::zoom.
Referenced by Olympe::NodeGraphPanel::RenderGraph().
Here is the call graph for this function:
Here is the caller graph for this function:| bool Olympe::NodeGraph::Undo | ( | ) |
Definition at line 615 of file BTNodeGraphManager.cpp.
References m_commandHistory.
Definition at line 203 of file BTNodeGraphManager.cpp.
References Olympe::GraphNode::childIds, Olympe::GraphNode::decoratorChildId, GetComponentTypeID_Static(), GetNode(), and MarkDirty().
Referenced by Olympe::Blueprint::UnlinkNodesCommand::Execute(), and Olympe::Blueprint::LinkNodesCommand::Undo().
Here is the call graph for this function:
Here is the caller graph for this function:| bool Olympe::NodeGraph::ValidateGraph | ( | std::string & | errorMsg | ) | const |
Definition at line 551 of file BTNodeGraphManager.cpp.
References GetComponentTypeID_Static(), GetNode(), and m_Nodes.
Here is the call graph for this function:| EditorMetadata Olympe::NodeGraph::editorMetadata |
Definition at line 297 of file BTNodeGraphManager.h.
Referenced by operator=(), and ToJson().
| std::vector<ClipboardNode> Olympe::NodeGraph::m_clipboardData |
Definition at line 352 of file BTNodeGraphManager.h.
Referenced by CopyNodesToClipboard(), and PasteNodesFromClipboard().
|
private |
Definition at line 362 of file BTNodeGraphManager.h.
Referenced by CanRedo(), CanUndo(), Clear(), GetCommandHistory(), GetCommandHistory(), GetRedoDescription(), GetUndoDescription(), operator=(), Redo(), and Undo().
|
private |
Separate array of node IDs that are OnEvent root nodes These nodes represent independent execution trees triggered by EventQueue messages Not connected to the main Root node tree.
Definition at line 372 of file BTNodeGraphManager.h.
Referenced by AddEventRoot(), GetEventRootIds(), IsValidRoot(), operator=(), RemoveEventRoot(), and ToJson().
|
private |
Definition at line 361 of file BTNodeGraphManager.h.
Referenced by GetFilepath(), HasFilepath(), operator=(), and SetFilepath().
Definition at line 360 of file BTNodeGraphManager.h.
Referenced by ClearDirty(), CopyNodesToClipboard(), DuplicateNodes(), IsDirty(), MarkDirty(), operator=(), and PasteNodesFromClipboard().
|
private |
Definition at line 359 of file BTNodeGraphManager.h.
Referenced by Clear(), CreateNode(), DuplicateNodes(), GetNextNodeId(), operator=(), and PasteNodesFromClipboard().
|
private |
Definition at line 358 of file BTNodeGraphManager.h.
Referenced by CalculateNodePositionsHierarchical(), Clear(), CopyNodesToClipboard(), CreateNode(), DeleteNode(), DuplicateNodes(), FindNodeIndex(), GetAllLinks(), GetAllNodes(), GetAllNodes(), GetNode(), GetNode(), operator=(), PasteNodesFromClipboard(), ToJson(), and ValidateGraph().
| std::string Olympe::NodeGraph::name |
Definition at line 294 of file BTNodeGraphManager.h.
Referenced by Olympe::NodeGraphShared::BTGraphDocumentConverter::FromBehaviorTree(), FromJson(), Olympe::BehaviorTreeRenderer::OnRunGraphClicked(), operator=(), and ToJson().
| int Olympe::NodeGraph::rootNodeId = -1 |
Definition at line 296 of file BTNodeGraphManager.h.
Referenced by CalculateNodePositionsHierarchical(), Clear(), IsValidRoot(), operator=(), and ToJson().
| std::string Olympe::NodeGraph::type |
Definition at line 295 of file BTNodeGraphManager.h.
Referenced by operator=(), and ToJson().