|
TachyonUI 1.1.0
High-performance UI for building tools.
|
How one view shows a NodeGraph: its pan and zoom, what's selected in it, what the user is doing in it, what it shows over the canvas and the callbacks that act on what it shows. More...
#include <gui_controls/gui_node_view_types.h>
Classes | |
| struct | MarqueeStart |
| What a marquee starts from: the selection before it, put back by Escape, and the modifiers held at its press. More... | |
Public Attributes | |
| std::unordered_set< tachyon::ID > | selectedTransitionIDs |
| selected transition stableIDs | |
| std::function< void(int node)> | onOpenState |
| A double-click on a state that holds a machine of its own (NodeModel::subMachine): open it, typically by showing that machine's view and extending breadcrumb. | |
| std::function< void(int transition)> | onTransitionContextMenu |
| As onNodeContextMenu, for transition transition (an index into transitions): a right click on its arrow or label opens it and selects the transition. | |
| std::unordered_set< tachyon::ID > | selectedFrameIDs |
| Selected frame stableIDs. | |
| std::function< void(int frame)> | onFrameContextMenu |
| As onNodeContextMenu, for frame frame (an index into frames): a right click on its title opens it and selects the frame. | |
| std::vector< std::string > | breadcrumb |
| Breadcrumb overlay at the canvas top-left, shown when non-empty. | |
| std::function< void(int)> | onBreadcrumb |
| called with the clicked segment index | |
| bool | showZoomControls = true |
| zoom overlay, bottom-left | |
| bool | showMinimap = true |
| minimap overlay, bottom-right | |
| float | minZoom = 0.1f |
| The zoom range (1 = 100%) the wheel, the keys and the zoom controls stay in. | |
| float | maxZoom = 4.0f |
| bool | virtualizeLayout = true |
| Lays out (and calls renderBody for) only the nodes in or near view: one far out of view stands in as its box, at its last size, with its sockets, so wires, the minimap and selection still have it. | |
| float | minimapScale = 0.0f |
| Last frame's minimap mapping (canvas = origin + minimap pixels / scale), for clicks. | |
| tachyon::float2 | minimapOrigin {} |
| PendingConnection | pendingConnection |
| internal: the wire being dragged | |
| tachyon::float3x2 | transform |
| identity = centered view (no pan/zoom) | |
| tachyon::int2 | lastInnerSize { 0, 0 } |
| last frame's canvas size, for centering | |
| tachyon::IntRect | lastCanvasRect {} |
| Last frame's canvas padding box, in screen pixels (as events have them), for NodeViewScreenToCanvas and NodeViewCanvasToScreen. | |
| tachyon::int2 | lastGridOrigin {} |
| Last frame's canvas border box less its content box: node.pos is measured from the border box, NodeViewScreenToCanvas's points from the content box. | |
| tachyon::ID | revealedFocusID = tachyon::ID::Invalid() |
| internal: the focus last scrolled into view | |
| tachyon::ID | focusedNodeID = tachyon::ID::Invalid() |
| internal: the node holding the focus last frame | |
| CommandMode | commandMode = CommandMode::Default |
| Command mode set while the canvas has focus. | |
| std::unordered_set< tachyon::ID > | selectedNodeIDs |
| Selected node stableIDs. | |
| std::function< void()> | onSelectionChanged |
| Called when the selection changed, once per RenderNodeView that finds it changed: by the user (clicks, the marquee, keys), a removed node, or the app itself. | |
| uint32_t | selectionGeneration = 0 |
| Goes up by one each time onSelectionChanged would be called, for an app that would rather compare it than be called. | |
| std::unordered_set< tachyon::ID > | reportedSelection |
| internal: the selection last reported | |
| std::unordered_set< tachyon::ID > | reportedFrameSelection |
| internal: the frames selected last reported | |
| tachyon::ID | lastClickedNodeID = tachyon::ID::Invalid() |
| StableID of the last clicked node. | |
| DoubleClickTracker | nodeDoubleClick |
| Double-click-to-collapse, per view so views (and test frames) don't share it. | |
| tachyon::Gesture< MarqueeStart > | marquee |
| A press on the empty background: a marquee once it moves the drag distance. | |
| tachyon::int2 | marqueeCurrentScreen {} |
| std::vector< CachedWireHandle > | wireHandleCache |
| Last frame's draggable segments, since grab elements are laid out before routing. | |
| WireSegmentDrag | wireDrag |
| tachyon::HoverPart< std::optional< uint32_t > > | hoveredWire |
| The wire under the mouse (by WireKey), from the last frame: highlighted, removed by a middle click, and offered for deletion by a right click. | |
| std::function< void(PropertyEndpoint from, bool fromOutput, float2 canvasPos)> | onWireDroppedOnCanvas |
| A new wire was released over the empty canvas (not on a node), e.g. | |
| std::optional< uint32_t > | wireMenuWire |
| the wire the open context menu is for | |
| float2 | wireMenuPos {} |
| internal: where on the canvas it was opened | |
| std::function< void(float2 canvasPos)> | onCanvasContextMenu |
| Builds the canvas's context menu (MenuItem and the like), each frame while it's open; without it there's none. | |
| std::function< void(int node)> | onNodeContextMenu |
| As onCanvasContextMenu, for node node (an index into nodes): opened by a right click on it, which selects it if it wasn't, or from the keys while one is selected (the one clicked last). | |
| std::optional< float2 > | canvasMenuPos |
| internal: where the open canvas menu is for | |
| std::optional< tachyon::ID > | nodeMenuNode |
| internal: the stableID the open node menu is for | |
| std::optional< tachyon::ID > | frameMenuFrame |
| internal: the stableID the open frame menu is for | |
| FrameDrag | frameDrag |
| internal: a frame being moved or resized | |
| DoubleClickTracker | frameDoubleClick |
| internal: a double-click on a title renames | |
| std::optional< tachyon::ID > | renamingFrame |
| internal: the frame whose title is being edited | |
| std::string | renameText |
| internal: its title as edited so far | |
| bool | renameFocused = false |
| internal: the field has had the focus | |
| int32_t | gridSize = 0 |
| internal: the grid the view was last drawn with | |
| std::vector< tachyon::IntRect > | frameBoxes |
| Internal: each frame's box as last drawn, by index (node.pos space): a collapsed one's node-like box, an empty rect for one hidden in a collapsed frame. | |
| tachyon::Gesture< tachyon::float3x2 > | pan |
| Internal: the view dragged (middle, or Alt + left); once dragged, not a click. | |
| tachyon::Gesture | menuPress |
| internal: a right press; its release without a drag opens a menu | |
| tachyon::Gesture | nodeDrag |
| internal: the press on a node; moves the selection once dragged | |
| tachyon::Gesture< tachyon::float3x2 > | minimapDrag |
| Internal: a press in the minimap; the transform before it, put back by Escape. | |
| tachyon::Gesture | transitionDrag |
| Internal: a transition being drawn from a state's edge, the state it leaves, and where the pointer is (screen). | |
| tachyon::ID | transitionFrom = tachyon::ID::Invalid() |
| tachyon::int2 | transitionPointer {} |
| bool | transitionPicking = false |
| Internal: a transition started from a menu (StartTransition): it follows the pointer until a click on a state finishes it, or a click elsewhere or Escape drops it. | |
| tachyon::HoverPart< tachyon::ID > | stateEdgeHover |
| Internal: the state whose edge is under the pointer (a transition starts there). | |
| tachyon::HoverPart< std::optional< tachyon::ID > > | hoveredTransition |
| Internal: the transition under the pointer, from the last frame: highlighted, and what a click selects. | |
| DoubleClickTracker | transitionClicks |
| internal: a double-click on a transition relabels it | |
| std::vector< std::pair< tachyon::ID, tachyon::IntRect > > | transitionLabelBoxes |
| Internal: each transition's label chip as last laid out (node.pos space): a click on it is a click on its transition. | |
| std::optional< tachyon::ID > | renamingTransition |
| internal: the transition whose label is being edited | |
| std::optional< tachyon::ID > | transitionMenuTransition |
| internal: the transition the open menu is for | |
| std::unordered_map< uint32_t, tachyon::VisualColorStyleIndex > | wireColorStyles |
| This frame's colors from the app (sockets, nodes, frames): packed RGBA -> its color style, a slot reused from frame to frame. | |
| uint32_t | seenRevision = 0 |
| Internal: the graph's revision this view last saw (NodeGraph::revision). | |
| tachyon::ID | canvasID = tachyon::ID::Invalid() |
| Internal: the canvas element as last built; its nodes' element IDs are scoped under it (NodeElementID). | |
Internal: a frame's working lists, kept for their storage | |
| NodeLists< tachyon::ElementRef > | socketRefs |
| std::vector< tachyon::ElementRef > | nodeRefs |
| each node's element, as last built | |
| std::vector< uint32_t > | drivenOutputs |
| the wired outputs' WireKeys, sorted | |
| std::vector< int > | nodeHiddenBy |
| the collapsed frame hiding each node, or -1 | |
| std::vector< tachyon::IntRect > | hiddenBox |
| that frame's box, for a hidden node with crossing wires | |
| NodeLists< NodeHiddenPort > | hiddenPorts |
| a hidden node's sockets on that box | |
| std::vector< std::vector< PropertyEndpoint > > | framePortsIn |
| Each collapsed frame's rows: the inputs wired from outside it, and the outputs inside it feeding a node outside. | |
| std::vector< std::vector< PropertyEndpoint > > | framePortsOut |
| std::vector< std::pair< tachyon::ID, int > > | nodesByID |
| (stableID, index), sorted: a collapsed frame's members | |
| std::vector< std::pair< tachyon::ID, int > > | framesByID |
| std::string | portText |
| a collapsed frame's port name, as built | |
How one view shows a NodeGraph: its pan and zoom, what's selected in it, what the user is doing in it, what it shows over the canvas and the callbacks that act on what it shows.
Keep one for each place the graph is shown.
| std::unordered_set<tachyon::ID> tachyon::NodeViewState::selectedTransitionIDs |
selected transition stableIDs
| std::function<void(int node)> tachyon::NodeViewState::onOpenState |
A double-click on a state that holds a machine of its own (NodeModel::subMachine): open it, typically by showing that machine's view and extending breadcrumb.
| std::function<void(int transition)> tachyon::NodeViewState::onTransitionContextMenu |
As onNodeContextMenu, for transition transition (an index into transitions): a right click on its arrow or label opens it and selects the transition.
| std::unordered_set<tachyon::ID> tachyon::NodeViewState::selectedFrameIDs |
Selected frame stableIDs.
A click on a frame's title selects it as one on a node does; selecting is all it does to it.
| std::function<void(int frame)> tachyon::NodeViewState::onFrameContextMenu |
As onNodeContextMenu, for frame frame (an index into frames): a right click on its title opens it and selects the frame.
| std::vector<std::string> tachyon::NodeViewState::breadcrumb |
Breadcrumb overlay at the canvas top-left, shown when non-empty.
| std::function<void(int)> tachyon::NodeViewState::onBreadcrumb |
called with the clicked segment index
| bool tachyon::NodeViewState::showZoomControls = true |
zoom overlay, bottom-left
| bool tachyon::NodeViewState::showMinimap = true |
minimap overlay, bottom-right
| float tachyon::NodeViewState::minZoom = 0.1f |
The zoom range (1 = 100%) the wheel, the keys and the zoom controls stay in.
Text is drawn at the zoom's size, so it stays sharp above 100%.
| float tachyon::NodeViewState::maxZoom = 4.0f |
| bool tachyon::NodeViewState::virtualizeLayout = true |
Lays out (and calls renderBody for) only the nodes in or near view: one far out of view stands in as its box, at its last size, with its sockets, so wires, the minimap and selection still have it.
Tab still reaches its controls: it's laid out as the focus moves into it. Off: every node, every frame.
| float tachyon::NodeViewState::minimapScale = 0.0f |
Last frame's minimap mapping (canvas = origin + minimap pixels / scale), for clicks.
| tachyon::float2 tachyon::NodeViewState::minimapOrigin {} |
| PendingConnection tachyon::NodeViewState::pendingConnection |
internal: the wire being dragged
| tachyon::float3x2 tachyon::NodeViewState::transform |
identity = centered view (no pan/zoom)
| tachyon::int2 tachyon::NodeViewState::lastInnerSize { 0, 0 } |
last frame's canvas size, for centering
| tachyon::IntRect tachyon::NodeViewState::lastCanvasRect {} |
Last frame's canvas padding box, in screen pixels (as events have them), for NodeViewScreenToCanvas and NodeViewCanvasToScreen.
| tachyon::int2 tachyon::NodeViewState::lastGridOrigin {} |
Last frame's canvas border box less its content box: node.pos is measured from the border box, NodeViewScreenToCanvas's points from the content box.
| tachyon::ID tachyon::NodeViewState::revealedFocusID = tachyon::ID::Invalid() |
internal: the focus last scrolled into view
| tachyon::ID tachyon::NodeViewState::focusedNodeID = tachyon::ID::Invalid() |
internal: the node holding the focus last frame
| CommandMode tachyon::NodeViewState::commandMode = CommandMode::Default |
Command mode set while the canvas has focus.
| std::unordered_set<tachyon::ID> tachyon::NodeViewState::selectedNodeIDs |
Selected node stableIDs.
| std::function<void()> tachyon::NodeViewState::onSelectionChanged |
Called when the selection changed, once per RenderNodeView that finds it changed: by the user (clicks, the marquee, keys), a removed node, or the app itself.
Read selectedNodeIDs for what it is now.
| uint32_t tachyon::NodeViewState::selectionGeneration = 0 |
Goes up by one each time onSelectionChanged would be called, for an app that would rather compare it than be called.
| std::unordered_set<tachyon::ID> tachyon::NodeViewState::reportedSelection |
internal: the selection last reported
| std::unordered_set<tachyon::ID> tachyon::NodeViewState::reportedFrameSelection |
internal: the frames selected last reported
| tachyon::ID tachyon::NodeViewState::lastClickedNodeID = tachyon::ID::Invalid() |
StableID of the last clicked node.
| DoubleClickTracker tachyon::NodeViewState::nodeDoubleClick |
Double-click-to-collapse, per view so views (and test frames) don't share it.
| tachyon::Gesture<MarqueeStart> tachyon::NodeViewState::marquee |
A press on the empty background: a marquee once it moves the drag distance.
Its points are screen space (marquee.drag.pressScreen is the start).
| tachyon::int2 tachyon::NodeViewState::marqueeCurrentScreen {} |
| std::vector<CachedWireHandle> tachyon::NodeViewState::wireHandleCache |
Last frame's draggable segments, since grab elements are laid out before routing.
| WireSegmentDrag tachyon::NodeViewState::wireDrag |
| tachyon::HoverPart<std::optional<uint32_t> > tachyon::NodeViewState::hoveredWire |
The wire under the mouse (by WireKey), from the last frame: highlighted, removed by a middle click, and offered for deletion by a right click.
| std::function<void(PropertyEndpoint from, bool fromOutput, float2 canvasPos)> tachyon::NodeViewState::onWireDroppedOnCanvas |
A new wire was released over the empty canvas (not on a node), e.g.
to offer the nodes it could connect to. from is the socket it was dragged from: an output when fromOutput, else an unwired input. canvasPos is where, in node.pos space. A wire pulled off an input and dropped there is a disconnect (onEdit), not this.
| std::optional<uint32_t> tachyon::NodeViewState::wireMenuWire |
the wire the open context menu is for
| float2 tachyon::NodeViewState::wireMenuPos {} |
internal: where on the canvas it was opened
| std::function<void(float2 canvasPos)> tachyon::NodeViewState::onCanvasContextMenu |
Builds the canvas's context menu (MenuItem and the like), each frame while it's open; without it there's none.
It opens on a right click (not a pan) on the empty canvas, or on the Menu key or Shift+F10 with the canvas focused and no node selected. canvasPos is where, in node.pos space (the canvas's centre from the keys).
| std::function<void(int node)> tachyon::NodeViewState::onNodeContextMenu |
As onCanvasContextMenu, for node node (an index into nodes): opened by a right click on it, which selects it if it wasn't, or from the keys while one is selected (the one clicked last).
Not for a reroute, whose menu is the view's own.
| std::optional<float2> tachyon::NodeViewState::canvasMenuPos |
internal: where the open canvas menu is for
| std::optional<tachyon::ID> tachyon::NodeViewState::nodeMenuNode |
internal: the stableID the open node menu is for
| std::optional<tachyon::ID> tachyon::NodeViewState::frameMenuFrame |
internal: the stableID the open frame menu is for
| FrameDrag tachyon::NodeViewState::frameDrag |
internal: a frame being moved or resized
| DoubleClickTracker tachyon::NodeViewState::frameDoubleClick |
internal: a double-click on a title renames
| std::optional<tachyon::ID> tachyon::NodeViewState::renamingFrame |
internal: the frame whose title is being edited
| std::string tachyon::NodeViewState::renameText |
internal: its title as edited so far
| bool tachyon::NodeViewState::renameFocused = false |
internal: the field has had the focus
| int32_t tachyon::NodeViewState::gridSize = 0 |
internal: the grid the view was last drawn with
| std::vector<tachyon::IntRect> tachyon::NodeViewState::frameBoxes |
Internal: each frame's box as last drawn, by index (node.pos space): a collapsed one's node-like box, an empty rect for one hidden in a collapsed frame.
| NodeLists<tachyon::ElementRef> tachyon::NodeViewState::socketRefs |
Each node's socket elements, [propIdx * 2 + isOutput], as last built: the wire pass reads them later in the frame.
| std::vector<tachyon::ElementRef> tachyon::NodeViewState::nodeRefs |
each node's element, as last built
| std::vector<uint32_t> tachyon::NodeViewState::drivenOutputs |
the wired outputs' WireKeys, sorted
| std::vector<int> tachyon::NodeViewState::nodeHiddenBy |
the collapsed frame hiding each node, or -1
| std::vector<tachyon::IntRect> tachyon::NodeViewState::hiddenBox |
that frame's box, for a hidden node with crossing wires
| NodeLists<NodeHiddenPort> tachyon::NodeViewState::hiddenPorts |
a hidden node's sockets on that box
| std::vector<std::vector<PropertyEndpoint> > tachyon::NodeViewState::framePortsIn |
Each collapsed frame's rows: the inputs wired from outside it, and the outputs inside it feeding a node outside.
| std::vector<std::vector<PropertyEndpoint> > tachyon::NodeViewState::framePortsOut |
Each node's socket elements, [propIdx * 2 + isOutput], as last built: the wire pass reads them later in the frame.
| std::vector<std::pair<tachyon::ID, int> > tachyon::NodeViewState::nodesByID |
(stableID, index), sorted: a collapsed frame's members
| std::vector<std::pair<tachyon::ID, int> > tachyon::NodeViewState::framesByID |
Each node's socket elements, [propIdx * 2 + isOutput], as last built: the wire pass reads them later in the frame.
| std::string tachyon::NodeViewState::portText |
a collapsed frame's port name, as built
| tachyon::Gesture<tachyon::float3x2> tachyon::NodeViewState::pan |
Internal: the view dragged (middle, or Alt + left); once dragged, not a click.
The transform before it, put back by Escape.
| tachyon::Gesture tachyon::NodeViewState::menuPress |
internal: a right press; its release without a drag opens a menu
| tachyon::Gesture tachyon::NodeViewState::nodeDrag |
internal: the press on a node; moves the selection once dragged
| tachyon::Gesture<tachyon::float3x2> tachyon::NodeViewState::minimapDrag |
Internal: a press in the minimap; the transform before it, put back by Escape.
| tachyon::Gesture tachyon::NodeViewState::transitionDrag |
Internal: a transition being drawn from a state's edge, the state it leaves, and where the pointer is (screen).
| tachyon::ID tachyon::NodeViewState::transitionFrom = tachyon::ID::Invalid() |
| tachyon::int2 tachyon::NodeViewState::transitionPointer {} |
| bool tachyon::NodeViewState::transitionPicking = false |
Internal: a transition started from a menu (StartTransition): it follows the pointer until a click on a state finishes it, or a click elsewhere or Escape drops it.
| tachyon::HoverPart<tachyon::ID> tachyon::NodeViewState::stateEdgeHover |
Internal: the state whose edge is under the pointer (a transition starts there).
| tachyon::HoverPart<std::optional<tachyon::ID> > tachyon::NodeViewState::hoveredTransition |
Internal: the transition under the pointer, from the last frame: highlighted, and what a click selects.
Its arrows as last drawn, for hit tests.
| DoubleClickTracker tachyon::NodeViewState::transitionClicks |
internal: a double-click on a transition relabels it
| std::vector<std::pair<tachyon::ID, tachyon::IntRect> > tachyon::NodeViewState::transitionLabelBoxes |
Internal: each transition's label chip as last laid out (node.pos space): a click on it is a click on its transition.
| std::optional<tachyon::ID> tachyon::NodeViewState::renamingTransition |
internal: the transition whose label is being edited
| std::optional<tachyon::ID> tachyon::NodeViewState::transitionMenuTransition |
internal: the transition the open menu is for
| std::unordered_map<uint32_t, tachyon::VisualColorStyleIndex> tachyon::NodeViewState::wireColorStyles |
This frame's colors from the app (sockets, nodes, frames): packed RGBA -> its color style, a slot reused from frame to frame.
Wires take their source socket's from here, since RenderPolyline takes a style index.
| uint32_t tachyon::NodeViewState::seenRevision = 0 |
Internal: the graph's revision this view last saw (NodeGraph::revision).
| tachyon::ID tachyon::NodeViewState::canvasID = tachyon::ID::Invalid() |
Internal: the canvas element as last built; its nodes' element IDs are scoped under it (NodeElementID).