The complete editable node graph for one script.
More...
#include <kscriptgraph.h>
|
| int | newId () |
| | Returns the next graph-unique id and advances the counter.
|
| kScriptGraphNode * | findNode (int id) |
| | Finds a node by id, or nullptr.
|
| const kScriptGraphNode * | findNode (int id) const |
| | Const overload: finds a node by id, or nullptr.
|
| const kScriptGraphLink * | incomingLink (int nodeId, int pinId) const |
| | Returns the link feeding an input pin, or nullptr.
|
| const kScriptGraphLink * | outgoingLink (int nodeId, int pinId) const |
| | Returns the first link leaving an output pin, or nullptr.
|
| bool | isPinConnected (int nodeId, int pinId) const |
| | True if any link touches the given pin.
|
| void | removeLinksByNode (int nodeId) |
| | Removes every link attached to a node.
|
| void | removeLinksByPin (int nodeId, int pinId) |
| | Removes every link attached to a specific pin.
|
| void | removeNode (int nodeId) |
| | Removes a node and all of its links.
|
| kScriptGraphNode | makeNode (kScriptNodeType type, float x, float y) |
| | Builds a fully-pinned node of the given type at (x, y).
|
| kJson | toJson () const |
| | Serialises the whole graph to JSON.
|
| void | fromJson (const kJson &j) |
| | Restores a graph from JSON produced by toJson().
|
The complete editable node graph for one script.
◆ findNode() [1/2]
Finds a node by id, or nullptr.
- Parameters
-
| id | Graph-unique node id to look up. |
- Returns
- Pointer to the matching node, or nullptr if none.
◆ findNode() [2/2]
Const overload: finds a node by id, or nullptr.
- Parameters
-
| id | Graph-unique node id to look up. |
- Returns
- Pointer to the matching node, or nullptr if none.
◆ fromJson()
| void kemena::kScriptGraph::fromJson |
( |
const kJson & | j | ) |
|
Restores a graph from JSON produced by toJson().
- Parameters
-
| j | JSON object previously emitted by toJson(). |
◆ incomingLink()
| const kScriptGraphLink * kemena::kScriptGraph::incomingLink |
( |
int | nodeId, |
|
|
int | pinId ) const |
Returns the link feeding an input pin, or nullptr.
- Parameters
-
| nodeId | Destination node id. |
| pinId | Destination input pin id. |
- Returns
- The incoming link, or nullptr if the pin is unconnected.
◆ isPinConnected()
| bool kemena::kScriptGraph::isPinConnected |
( |
int | nodeId, |
|
|
int | pinId ) const |
True if any link touches the given pin.
- Parameters
-
| nodeId | Owning node id. |
| pinId | Pin id to test. |
- Returns
- True when at least one link references the pin.
◆ makeNode()
Builds a fully-pinned node of the given type at (x, y).
Pin ids are drawn from newId(); the node id is assigned too.
- Parameters
-
| type | Node kind to construct. |
| x | Initial canvas X position. |
| y | Initial canvas Y position. |
- Returns
- The newly built node (not yet added to nodes).
◆ newId()
| int kemena::kScriptGraph::newId |
( |
| ) |
|
|
inline |
Returns the next graph-unique id and advances the counter.
- Returns
- A fresh id never previously handed out by this graph.
◆ outgoingLink()
| const kScriptGraphLink * kemena::kScriptGraph::outgoingLink |
( |
int | nodeId, |
|
|
int | pinId ) const |
Returns the first link leaving an output pin, or nullptr.
- Parameters
-
| nodeId | Source node id. |
| pinId | Source output pin id. |
- Returns
- The first outgoing link, or nullptr if none.
◆ removeLinksByNode()
| void kemena::kScriptGraph::removeLinksByNode |
( |
int | nodeId | ) |
|
Removes every link attached to a node.
- Parameters
-
| nodeId | Node whose links are removed. |
◆ removeLinksByPin()
| void kemena::kScriptGraph::removeLinksByPin |
( |
int | nodeId, |
|
|
int | pinId ) |
Removes every link attached to a specific pin.
- Parameters
-
| nodeId | Owning node id. |
| pinId | Pin whose links are removed. |
◆ removeNode()
| void kemena::kScriptGraph::removeNode |
( |
int | nodeId | ) |
|
Removes a node and all of its links.
- Parameters
-
◆ toJson()
| kJson kemena::kScriptGraph::toJson |
( |
| ) |
const |
Serialises the whole graph to JSON.
- Returns
- A JSON object holding nodes, links, variables and metadata.
◆ dirty
| bool kemena::kScriptGraph::dirty = false |
Unsaved-changes flag (editor only).
◆ links
◆ name
◆ nextId
| int kemena::kScriptGraph::nextId = 1 |
◆ nodes
◆ uuid
Stable script-asset UUID.
◆ variables
The documentation for this struct was generated from the following file: