TachyonUI 0.1.0
High-performance UI for building tools.
Loading...
Searching...
No Matches
tachyon::NodeView Struct Reference

All state of one node-view widget; no global state. 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
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 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::ID revealedFocusID = tachyon::ID::Invalid()
 internal: the focus last scrolled into view
CommandMode commandMode = CommandMode::Default
 Command mode set while the canvas has focus.
std::vector< int > ordering
 Z-order, last == front (a clicked node moves there).
std::unordered_set< tachyon::ID > selectedNodeIDs
 Selected node stableIDs.
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::PointerDrag marquee
 A press on the empty background: a marquee once it moves the drag distance.
tachyon::int2 marqueeCurrentScreen {}
std::unordered_set< tachyon::ID > marqueeBaseSelection
 selection snapshot before the drag
bool marqueeShift = false
 modifier snapshot at start
bool marqueeCtrl = false
std::unordered_map< uint32_t, WireRouteOverrides > wireOverrides
 Pinned wire lanes, keyed by WireKey() of the wire's target endpoint.
std::vector< CachedWireHandle > wireHandleCache
 Last frame's draggable segments, since grab elements are laid out before routing.
WireSegmentDrag wireDrag
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(const NodeViewEdit &)> onEdit
 Called once per finished user edit (a whole drag is one), after it is applied.
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
tachyon::PointerDrag pan
 internal: a right press; once dragged, not a click
tachyon::float3x2 panStart {}
 internal: the transform before it; put back by Escape
tachyon::PointerDrag nodeDrag
 internal: the press on a node; moves the selection once dragged
tachyon::PointerDrag minimapDrag
 internal: a press in the minimap
tachyon::float3x2 minimapStart {}
 internal: the transform before it; put back by Escape
std::function< bool(const NodeView &view, PropertyEndpoint output, PropertyEndpoint input)> canConnect
 Whether an output -> input wire is allowed; null allows any.
std::unordered_map< uint32_t, tachyon::VisualColorStyleIndex > wireColorStyles
 Packed RGBA -> registered color style, since RenderPolyline takes a style index.
uint32_t wireColorStylesGeneration = 0
 StyleManager::Generation() of the cache.

Detailed Description

All state of one node-view widget; no global state.

commandMode is active while the view has focus, for per-view shortcuts.

Member Data Documentation

◆ nodes

std::vector<NodeModel> tachyon::NodeView::nodes

the graph; endpoints and edits refer to nodes by index

◆ breadcrumb

std::vector<std::string> tachyon::NodeView::breadcrumb

Breadcrumb overlay at the canvas top-left, shown when non-empty.

◆ onBreadcrumb

std::function<void(int)> tachyon::NodeView::onBreadcrumb

called with the clicked segment index

◆ showZoomControls

bool tachyon::NodeView::showZoomControls = true

zoom overlay, bottom-left

◆ showMinimap

bool tachyon::NodeView::showMinimap = true

minimap overlay, bottom-right

◆ minimapScale

float tachyon::NodeView::minimapScale = 0.0f

Last frame's minimap mapping (canvas = origin + minimap pixels / scale), for clicks.

◆ minimapOrigin

tachyon::float2 tachyon::NodeView::minimapOrigin {}

◆ pendingConnection

PendingConnection tachyon::NodeView::pendingConnection

internal: the wire being dragged

◆ transform

tachyon::float3x2 tachyon::NodeView::transform

identity = centered view (no pan/zoom)

◆ lastInnerSize

tachyon::int2 tachyon::NodeView::lastInnerSize { 0, 0 }

last frame's canvas size, for centering

◆ lastCanvasRect

tachyon::IntRect tachyon::NodeView::lastCanvasRect {}

Last frame's canvas padding box, in screen pixels (as events have them), for NodeViewScreenToCanvas and NodeViewCanvasToScreen.

◆ revealedFocusID

tachyon::ID tachyon::NodeView::revealedFocusID = tachyon::ID::Invalid()

internal: the focus last scrolled into view

◆ commandMode

CommandMode tachyon::NodeView::commandMode = CommandMode::Default

Command mode set while the canvas has focus.

◆ ordering

std::vector<int> tachyon::NodeView::ordering

Z-order, last == front (a clicked node moves there).

◆ selectedNodeIDs

std::unordered_set<tachyon::ID> tachyon::NodeView::selectedNodeIDs

Selected node stableIDs.

◆ lastClickedNodeID

tachyon::ID tachyon::NodeView::lastClickedNodeID = tachyon::ID::Invalid()

StableID of the last clicked node.

◆ nodeDoubleClick

DoubleClickTracker tachyon::NodeView::nodeDoubleClick

Double-click-to-collapse, per view so views (and test frames) don't share it.

◆ marquee

tachyon::PointerDrag tachyon::NodeView::marquee

A press on the empty background: a marquee once it moves the drag distance.

Its points are screen space (marquee.pressScreen is the start).

◆ marqueeCurrentScreen

tachyon::int2 tachyon::NodeView::marqueeCurrentScreen {}

◆ marqueeBaseSelection

std::unordered_set<tachyon::ID> tachyon::NodeView::marqueeBaseSelection

selection snapshot before the drag

◆ marqueeShift

bool tachyon::NodeView::marqueeShift = false

modifier snapshot at start

◆ marqueeCtrl

bool tachyon::NodeView::marqueeCtrl = false

◆ wireOverrides

std::unordered_map<uint32_t, WireRouteOverrides> tachyon::NodeView::wireOverrides

Pinned wire lanes, keyed by WireKey() of the wire's target endpoint.

◆ wireHandleCache

std::vector<CachedWireHandle> tachyon::NodeView::wireHandleCache

Last frame's draggable segments, since grab elements are laid out before routing.

◆ wireDrag

WireSegmentDrag tachyon::NodeView::wireDrag

◆ hoveredWire

std::optional<uint32_t> tachyon::NodeView::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.

◆ onEdit

std::function<void(const NodeViewEdit&)> tachyon::NodeView::onEdit

Called once per finished user edit (a whole drag is one), after it is applied.

◆ onWireDroppedOnCanvas

std::function<void(PropertyEndpoint from, bool fromOutput, float2 canvasPos)> tachyon::NodeView::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.

◆ wireMenuWire

std::optional<uint32_t> tachyon::NodeView::wireMenuWire

the wire the open context menu is for

◆ wireMenuPos

float2 tachyon::NodeView::wireMenuPos {}

internal: where on the canvas it was opened

◆ onCanvasContextMenu

std::function<void(float2 canvasPos)> tachyon::NodeView::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).

◆ onNodeContextMenu

std::function<void(int node)> tachyon::NodeView::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).

◆ canvasMenuPos

std::optional<float2> tachyon::NodeView::canvasMenuPos

internal: where the open canvas menu is for

◆ nodeMenuNode

std::optional<tachyon::ID> tachyon::NodeView::nodeMenuNode

internal: the stableID the open node menu is for

◆ pan

tachyon::PointerDrag tachyon::NodeView::pan

internal: a right press; once dragged, not a click

◆ panStart

tachyon::float3x2 tachyon::NodeView::panStart {}

internal: the transform before it; put back by Escape

◆ nodeDrag

tachyon::PointerDrag tachyon::NodeView::nodeDrag

internal: the press on a node; moves the selection once dragged

◆ minimapDrag

tachyon::PointerDrag tachyon::NodeView::minimapDrag

internal: a press in the minimap

◆ minimapStart

tachyon::float3x2 tachyon::NodeView::minimapStart {}

internal: the transform before it; put back by Escape

◆ canConnect

std::function<bool(const NodeView& view, PropertyEndpoint output, PropertyEndpoint input)> tachyon::NodeView::canConnect

Whether an output -> input wire is allowed; null allows any.

Called only for bounds-checked, cross-node endpoints, so it may index view.nodes directly.

◆ wireColorStyles

std::unordered_map<uint32_t, tachyon::VisualColorStyleIndex> tachyon::NodeView::wireColorStyles

Packed RGBA -> registered color style, since RenderPolyline takes a style index.

◆ wireColorStylesGeneration

uint32_t tachyon::NodeView::wireColorStylesGeneration = 0

The documentation for this struct was generated from the following file: