|
TachyonUI 1.1.0
High-performance UI for building tools.
|
What a node view's graph is: its nodes, frames and wires (or a state machine's states and transitions), the edits made to it, and how it's laid out on the grid. More...
#include <gui_controls/gui_node_view_types.h>
Public Attributes | |
| std::vector< NodeModel > | nodes |
| the graph; endpoints and edits refer to nodes by index | |
| NodeViewKind | kind = NodeViewKind::Graph |
| A graph of fields and wires, or a state machine. | |
| std::vector< NodeFrame > | frames |
| Frames, drawn behind the nodes and wires, the first at the back. | |
| std::vector< int > | ordering |
| Z-order, last == front (a clicked node moves there). | |
| bool | snapToGrid = true |
| Keeps node positions on the grid: dragged nodes land on it, and positions set in code are moved onto it. | |
| NodeWireShape | wireShape = NodeWireShape::Orthogonal |
| Orthogonal: wires run along the grid, round the nodes, their lanes dragged by hand. | |
| std::unordered_map< uint32_t, WireRouteOverrides > | wireOverrides |
| Pinned wire lanes, keyed by WireKey() of the wire's target endpoint. | |
| std::function< void(const NodeViewEdit &)> | onEdit |
| Called once per finished user edit (a whole drag is one), after it is applied. | |
| std::function< bool(const NodeGraph &graph, PropertyEndpoint output, PropertyEndpoint input)> | canConnect |
| Whether an output -> input wire is allowed; null allows any. | |
| uint32_t | revision = 0 |
| Goes up by one with each edit applied (ApplyNodeViewEdit). | |
State machine (NodeViewKind::StateMachine) | |
| std::vector< StateTransition > | transitions |
| tachyon::ID | initialState = tachyon::ID::Invalid() |
| where the machine starts: marked with an arrow in | |
| tachyon::ID | activeState = tachyon::ID::Invalid() |
| The state the machine is in, as the app runs it: ringed. Invalid: none. | |
| float | activeStateTime = -1.0f |
| How long the machine has been in activeState, in seconds, shown under it ("1.24 s"); negative shows nothing. | |
What a node view's graph is: its nodes, frames and wires (or a state machine's states and transitions), the edits made to it, and how it's laid out on the grid.
Several views can show one graph, each with a NodeViewState of its own (pan, zoom, selection):
NodeGraph graph; // the document's
NodeViewState left, right; // a panel's each
RenderNodeView({ graph, left }); // in one panel
RenderNodeView({ graph, right }); // in the other
NodeView is both in one, for a graph shown in one place.
| std::vector<NodeModel> tachyon::NodeGraph::nodes |
the graph; endpoints and edits refer to nodes by index
| NodeViewKind tachyon::NodeGraph::kind = NodeViewKind::Graph |
A graph of fields and wires, or a state machine.
In a state machine the nodes are states: their properties aren't shown, and transitions join them instead of wires.
| std::vector<StateTransition> tachyon::NodeGraph::transitions |
The arrows between the states. A press on a state's edge and a drag to another state (or back onto itself) adds one; each can be selected, relabelled and deleted.
| tachyon::ID tachyon::NodeGraph::initialState = tachyon::ID::Invalid() |
where the machine starts: marked with an arrow in
| tachyon::ID tachyon::NodeGraph::activeState = tachyon::ID::Invalid() |
The state the machine is in, as the app runs it: ringed. Invalid: none.
| float tachyon::NodeGraph::activeStateTime = -1.0f |
How long the machine has been in activeState, in seconds, shown under it ("1.24 s"); negative shows nothing.
The app keeps it, and redraws while it counts.
| std::vector<NodeFrame> tachyon::NodeGraph::frames |
Frames, drawn behind the nodes and wires, the first at the back.
| std::vector<int> tachyon::NodeGraph::ordering |
Z-order, last == front (a clicked node moves there).
| bool tachyon::NodeGraph::snapToGrid = true |
Keeps node positions on the grid: dragged nodes land on it, and positions set in code are moved onto it.
Off: nodes go where they're dropped or put.
| NodeWireShape tachyon::NodeGraph::wireShape = NodeWireShape::Orthogonal |
Orthogonal: wires run along the grid, round the nodes, their lanes dragged by hand.
Curved: each wire is one curve, leaving the output and entering the input level, with no lanes to drag.
| std::unordered_map<uint32_t, WireRouteOverrides> tachyon::NodeGraph::wireOverrides |
Pinned wire lanes, keyed by WireKey() of the wire's target endpoint.
| std::function<void(const NodeViewEdit&)> tachyon::NodeGraph::onEdit |
Called once per finished user edit (a whole drag is one), after it is applied.
| std::function<bool(const NodeGraph& graph, PropertyEndpoint output, PropertyEndpoint input)> tachyon::NodeGraph::canConnect |
Whether an output -> input wire is allowed; null allows any.
Called only for bounds-checked, cross-node endpoints, so it may index graph.nodes directly.
| uint32_t tachyon::NodeGraph::revision = 0 |
Goes up by one with each edit applied (ApplyNodeViewEdit).
A view that last saw another drops what it kept by node index.