![]() |
Olympe Engine 2.0
2D Game Engine with ECS Architecture
|
Manages per-node annotations (breakpoints, comments, colors) More...
#include <NodeAnnotations.h>
Public Member Functions | |
| NodeAnnotationsManager ()=default | |
| ~NodeAnnotationsManager ()=default | |
| bool | HasAnnotation (int nodeId) const |
| Check if a node has any annotation. | |
| NodeAnnotation * | GetAnnotation (int nodeId) |
| Get annotation for a node (non-const) | |
| const NodeAnnotation * | GetAnnotation (int nodeId) const |
| Get annotation for a node (const) | |
| void | SetBreakpoint (int nodeId, bool enabled) |
| Set breakpoint state for a node. | |
| void | SetComment (int nodeId, const std::string &text) |
| Set comment for a node. | |
| void | SetColor (int nodeId, float r, float g, float b, float a) |
| Set custom color for a node. | |
| void | ClearAnnotation (int nodeId) |
| Remove all annotation data for a node. | |
| const std::map< int, NodeAnnotation > & | GetAll () const |
| Get all annotations (for serialization / rendering) | |
| json | ToJson () const |
| Serialize all annotations to JSON. | |
| void | FromJson (const json &j) |
| Deserialize annotations from JSON. | |
Private Member Functions | |
| NodeAnnotation & | GetOrCreate (int nodeId) |
| Get or create annotation for a node. | |
Private Attributes | |
| std::map< int, NodeAnnotation > | m_annotations |
Manages per-node annotations (breakpoints, comments, colors)
Definition at line 49 of file NodeAnnotations.h.
|
default |
|
default |
Remove all annotation data for a node.
| nodeId | Node identifier |
Definition at line 71 of file NodeAnnotations.cpp.
References m_annotations, and SYSTEM_LOG.
Deserialize annotations from JSON.
| j | JSON array of annotation objects |
Definition at line 111 of file NodeAnnotations.cpp.
References JsonHelper::GetBool(), GetComponentTypeID_Static(), JsonHelper::GetFloat(), JsonHelper::GetInt(), JsonHelper::GetString(), m_annotations, and Olympe::NodeGraph::NodeAnnotation::nodeId.
Here is the call graph for this function:| const std::map< int, NodeAnnotation > & Olympe::NodeGraph::NodeAnnotationsManager::GetAll | ( | ) | const |
Get all annotations (for serialization / rendering)
Definition at line 81 of file NodeAnnotations.cpp.
References m_annotations.
| NodeAnnotation * Olympe::NodeGraph::NodeAnnotationsManager::GetAnnotation | ( | int | nodeId | ) |
Get annotation for a node (non-const)
| nodeId | Node identifier |
Definition at line 23 of file NodeAnnotations.cpp.
References GetComponentTypeID_Static(), and m_annotations.
Referenced by Olympe::NodeGraph::ToggleNodeBreakpointCommand::ToggleNodeBreakpointCommand().
Here is the call graph for this function:
Here is the caller graph for this function:| const NodeAnnotation * Olympe::NodeGraph::NodeAnnotationsManager::GetAnnotation | ( | int | nodeId | ) | const |
Get annotation for a node (const)
| nodeId | Node identifier |
Definition at line 33 of file NodeAnnotations.cpp.
References GetComponentTypeID_Static(), and m_annotations.
Here is the call graph for this function:
|
private |
Get or create annotation for a node.
| nodeId | Node identifier |
Definition at line 156 of file NodeAnnotations.cpp.
References GetComponentTypeID_Static(), m_annotations, and Olympe::NodeGraph::NodeAnnotation::nodeId.
Referenced by SetBreakpoint(), SetColor(), and SetComment().
Here is the call graph for this function:
Here is the caller graph for this function:Check if a node has any annotation.
| nodeId | Node identifier |
Definition at line 18 of file NodeAnnotations.cpp.
References m_annotations.
Set breakpoint state for a node.
| nodeId | Node identifier |
| enabled | Whether breakpoint is active |
Definition at line 47 of file NodeAnnotations.cpp.
References GetComponentTypeID_Static(), GetOrCreate(), and SYSTEM_LOG.
Referenced by Olympe::NodeGraph::ToggleNodeBreakpointCommand::Execute(), and Olympe::NodeGraph::ToggleNodeBreakpointCommand::Undo().
Here is the call graph for this function:
Here is the caller graph for this function:| void Olympe::NodeGraph::NodeAnnotationsManager::SetColor | ( | int | nodeId, |
| float | r, | ||
| float | g, | ||
| float | b, | ||
| float | a | ||
| ) |
Set custom color for a node.
| nodeId | Node identifier |
| r | Red component [0,1] |
| g | Green component [0,1] |
| b | Blue component [0,1] |
| a | Alpha component [0,1] |
Definition at line 62 of file NodeAnnotations.cpp.
References GetComponentTypeID_Static(), and GetOrCreate().
Here is the call graph for this function:Set comment for a node.
| nodeId | Node identifier |
| text | Comment text |
Definition at line 55 of file NodeAnnotations.cpp.
References GetComponentTypeID_Static(), GetOrCreate(), and SYSTEM_LOG.
Here is the call graph for this function:| json Olympe::NodeGraph::NodeAnnotationsManager::ToJson | ( | ) | const |
Serialize all annotations to JSON.
Definition at line 90 of file NodeAnnotations.cpp.
References GetComponentTypeID_Static(), and m_annotations.
Referenced by Olympe::NodeGraph::GraphDocument::ToJson().
Here is the call graph for this function:
Here is the caller graph for this function:
|
private |
Definition at line 124 of file NodeAnnotations.h.
Referenced by ClearAnnotation(), FromJson(), GetAll(), GetAnnotation(), GetAnnotation(), GetOrCreate(), HasAnnotation(), and ToJson().