![]() |
Olympe Engine 2.0
2D Game Engine with ECS Architecture
|
#include <NodeGraphManager.h>
Collaboration diagram for Olympe::NodeGraph:Public Member Functions | |
| NodeGraph () | |
| ~NodeGraph ()=default | |
| int | CreateNode (NodeType type, float x, float y, const std::string &name="") |
| bool | DeleteNode (int nodeId) |
| GraphNode * | GetNode (int nodeId) |
| const GraphNode * | GetNode (int nodeId) const |
| std::vector< GraphNode * > | GetAllNodes () |
| std::vector< const GraphNode * > | GetAllNodes () const |
| bool | LinkNodes (int parentId, int childId) |
| bool | UnlinkNodes (int parentId, int childId) |
| std::vector< GraphLink > | GetAllLinks () const |
| bool | SetNodeParameter (int nodeId, const std::string ¶mName, const std::string &value) |
| std::string | GetNodeParameter (int nodeId, const std::string ¶mName) const |
| nlohmann::json | ToJson () const |
| bool | ValidateGraph (std::string &errorMsg) const |
| void | Clear () |
| int | GetNextNodeId () const |
| void | CalculateNodePositionsHierarchical () |
| bool | IsDirty () const |
| void | MarkDirty () |
| void | ClearDirty () |
| const std::string & | GetFilepath () const |
| void | SetFilepath (const std::string &filepath) |
| bool | HasFilepath () const |
Static Public Member Functions | |
| static NodeGraph | FromJson (const nlohmann::json &j) |
Public Attributes | |
| std::string | name |
| std::string | type |
| int | rootNodeId = -1 |
| EditorMetadata | editorMetadata |
Private Member Functions | |
| int | FindNodeIndex (int nodeId) const |
Private Attributes | |
| std::vector< GraphNode > | m_Nodes |
| int | m_NextNodeId = 1 |
| bool | m_IsDirty = false |
| std::string | m_Filepath |
Definition at line 123 of file NodeGraphManager.h.
| Olympe::NodeGraph::NodeGraph | ( | ) |
Definition at line 24 of file NodeGraphManager.cpp.
|
default |
| void Olympe::NodeGraph::CalculateNodePositionsHierarchical | ( | ) |
Definition at line 476 of file NodeGraphManager.cpp.
References FindNodeIndex(), GetComponentTypeID_Static(), m_Nodes, rootNodeId, and visited.
Here is the call graph for this function:| void Olympe::NodeGraph::Clear | ( | ) |
Definition at line 459 of file NodeGraphManager.cpp.
References m_NextNodeId, m_Nodes, and rootNodeId.
|
inline |
Definition at line 169 of file NodeGraphManager.h.
References m_IsDirty.
| int Olympe::NodeGraph::CreateNode | ( | NodeType | type, |
| float | x, | ||
| float | y, | ||
| const std::string & | name = "" |
||
| ) |
Definition at line 32 of file NodeGraphManager.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 49 of file NodeGraphManager.cpp.
References FindNodeIndex(), GetComponentTypeID_Static(), m_Nodes, and MarkDirty().
Referenced by Olympe::CreateNodeCommand::Undo(), and Olympe::DuplicateNodeCommand::Undo().
Here is the call graph for this function:
Here is the caller graph for this function:Definition at line 466 of file NodeGraphManager.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 277 of file NodeGraphManager.cpp.
References JsonHelper::ForEachInArray(), GetComponentTypeID_Static(), JsonHelper::GetFloat(), JsonHelper::GetInt(), JsonHelper::GetString(), Olympe::GraphNode::id, JsonHelper::IsArray(), name, and Olympe::StringToNodeType().
Referenced by Olympe::NodeGraphManager::LoadGraph().
Here is the call graph for this function:
Here is the caller graph for this function:| std::vector< GraphLink > Olympe::NodeGraph::GetAllLinks | ( | ) | const |
Definition at line 166 of file NodeGraphManager.cpp.
References GetComponentTypeID_Static(), and m_Nodes.
Here is the call graph for this function:| std::vector< GraphNode * > Olympe::NodeGraph::GetAllNodes | ( | ) |
Definition at line 93 of file NodeGraphManager.cpp.
References GetComponentTypeID_Static(), and m_Nodes.
Referenced by Olympe::NodeGraphPanel::RenderContextMenu().
Here is the call graph for this function:
Here is the caller graph for this function:Definition at line 101 of file NodeGraphManager.cpp.
References GetComponentTypeID_Static(), and m_Nodes.
Here is the call graph for this function:
|
inline |
Definition at line 172 of file NodeGraphManager.h.
References m_Filepath.
|
inline |
Definition at line 161 of file NodeGraphManager.h.
References m_NextNodeId.
Definition at line 77 of file NodeGraphManager.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 85 of file NodeGraphManager.cpp.
References FindNodeIndex(), GetComponentTypeID_Static(), and m_Nodes.
Here is the call graph for this function:Definition at line 199 of file NodeGraphManager.cpp.
References GetComponentTypeID_Static(), and GetNode().
Here is the call graph for this function:
|
inline |
Definition at line 174 of file NodeGraphManager.h.
References m_Filepath.
Referenced by Olympe::NodeGraphPanel::Render().
Here is the caller graph for this function:
|
inline |
Definition at line 167 of file NodeGraphManager.h.
References m_IsDirty.
Definition at line 109 of file NodeGraphManager.cpp.
References Olympe::BT_Decorator, Olympe::GraphNode::childIds, Olympe::GraphNode::decoratorChildId, GetNode(), MarkDirty(), and Olympe::GraphNode::type.
Referenced by Olympe::LinkNodesCommand::Execute(), and Olympe::UnlinkNodesCommand::Undo().
Here is the call graph for this function:
Here is the caller graph for this function:
|
inline |
Definition at line 168 of file NodeGraphManager.h.
References m_IsDirty.
Referenced by CreateNode(), DeleteNode(), LinkNodes(), SetNodeParameter(), and UnlinkNodes().
Here is the caller graph for this function:Definition at line 173 of file NodeGraphManager.h.
References m_Filepath.
| bool Olympe::NodeGraph::SetNodeParameter | ( | int | nodeId, |
| const std::string & | paramName, | ||
| const std::string & | value | ||
| ) |
Definition at line 188 of file NodeGraphManager.cpp.
References GetComponentTypeID_Static(), GetNode(), and MarkDirty().
Referenced by Olympe::SetParameterCommand::Execute(), and Olympe::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 212 of file NodeGraphManager.cpp.
References editorMetadata, GetComponentTypeID_Static(), Olympe::EditorMetadata::lastModified, m_Nodes, name, Olympe::NodeTypeToString(), push_back(), rootNodeId, Olympe::EditorMetadata::scrollOffsetX, Olympe::EditorMetadata::scrollOffsetY, type, and Olympe::EditorMetadata::zoom.
Here is the call graph for this function:Definition at line 135 of file NodeGraphManager.cpp.
References Olympe::GraphNode::childIds, Olympe::GraphNode::decoratorChildId, GetComponentTypeID_Static(), GetNode(), and MarkDirty().
Referenced by Olympe::UnlinkNodesCommand::Execute(), and Olympe::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 434 of file NodeGraphManager.cpp.
References GetComponentTypeID_Static(), GetNode(), and m_Nodes.
Here is the call graph for this function:| EditorMetadata Olympe::NodeGraph::editorMetadata |
Definition at line 133 of file NodeGraphManager.h.
Referenced by ToJson().
|
private |
Definition at line 180 of file NodeGraphManager.h.
Referenced by GetFilepath(), HasFilepath(), and SetFilepath().
Definition at line 179 of file NodeGraphManager.h.
Referenced by ClearDirty(), IsDirty(), and MarkDirty().
|
private |
Definition at line 178 of file NodeGraphManager.h.
Referenced by Clear(), CreateNode(), and GetNextNodeId().
|
private |
Definition at line 177 of file NodeGraphManager.h.
Referenced by CalculateNodePositionsHierarchical(), Clear(), CreateNode(), DeleteNode(), FindNodeIndex(), GetAllLinks(), GetAllNodes(), GetAllNodes(), GetNode(), GetNode(), ToJson(), and ValidateGraph().
| std::string Olympe::NodeGraph::name |
Definition at line 130 of file NodeGraphManager.h.
Referenced by FromJson(), and ToJson().
| int Olympe::NodeGraph::rootNodeId = -1 |
Definition at line 132 of file NodeGraphManager.h.
Referenced by CalculateNodePositionsHierarchical(), Clear(), and ToJson().
| std::string Olympe::NodeGraph::type |
Definition at line 131 of file NodeGraphManager.h.
Referenced by ToJson().