|
TachyonUI 1.1.0
High-performance UI for building tools.
|
A graph shown in one place: the graph and the one view of it together. More...
#include <gui_controls/gui_node_view_types.h>
Additional Inherited Members | |
| Public Attributes inherited from tachyon::NodeGraph | |
| 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). | |
| 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. | |
| Public Attributes inherited from tachyon::NodeViewState | |
| 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). | |
| 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 | |
A graph shown in one place: the graph and the one view of it together.
For several views of one graph, keep the NodeGraph and a NodeViewState per view instead.