14#include <unordered_map>
15#include <unordered_set>
40 std::optional<PropertyEndpoint>
input;
61 std::function<std::string()>
value;
178 std::vector<std::pair<PropertyEndpoint, int>>
fed;
179 std::vector<std::pair<uint32_t, WireRouteOverrides>>
lanes;
293 std::function<bool(
const NodeView& view,
WireHandle
Interior lane a drag handle adjusts: the corridor route's vertical lane (LaneX), or the detour route'...
Definition gui_node_view_types.h:105
@ LaneY
Definition gui_node_view_types.h:105
@ EntryX
Definition gui_node_view_types.h:105
@ None
Definition gui_node_view_types.h:105
@ ExitX
Definition gui_node_view_types.h:105
@ LaneX
Definition gui_node_view_types.h:105
@ None
Definition gui_element_flags.h:19
Definition gui_logging.h:24
Last frame's draggable segment (node.pos space), for laying out its grab element.
Definition gui_node_view_types.h:149
uint32_t wireKey
Definition gui_node_view_types.h:150
bool vertical
Definition gui_node_view_types.h:152
tachyon::int2 a
Definition gui_node_view_types.h:153
tachyon::int2 b
Definition gui_node_view_types.h:153
WireHandle role
Definition gui_node_view_types.h:151
Click-gesture tracker, owned per widget instance so instances (and tests) don't share it.
Definition gui_widget_state_types.h:75
A wire as drawn this frame, for hit-testing; points in node.pos space.
Definition gui_node_view_types.h:195
std::vector< tachyon::int2 > points
Definition gui_node_view_types.h:197
uint32_t wireKey
Definition gui_node_view_types.h:196
A 64-bit element ID whose bit layout depends on its IDMode.
Definition gui_id.h:23
static constexpr ID Invalid()
The "no element" ID (all bits zero); also the default for optional ID parameters.
Definition gui_id.h:66
Definition gui_base_types.h:407
One node of a node view.
Definition gui_node_view_types.h:66
std::string category
Category name, shown right-aligned in the header.
Definition gui_node_view_types.h:73
bool collapsed
rows hidden, header only (double-click toggles)
Definition gui_node_view_types.h:80
tachyon::int2 startPos
internal: pos at drag start
Definition gui_node_view_types.h:78
bool reroute
A reroute: a dot that a wire passes through, a waypoint, instead of a box.
Definition gui_node_view_types.h:85
tachyon::int2 lastSize
outer-rect size from last frame's layout
Definition gui_node_view_types.h:79
tachyon::ID stableID
Assigned once on creation; the node's element ID and the salt for its sub-IDs, so ID-keyed state surv...
Definition gui_node_view_types.h:69
std::vector< NodeProperty > properties
the rows, top to bottom
Definition gui_node_view_types.h:86
tachyon::color4f categoryColor
Color of the header's category square; alpha 0 uses the accent.
Definition gui_node_view_types.h:75
std::string title
header text
Definition gui_node_view_types.h:71
tachyon::int2 pos
Top-left in canvas layout space (whole pixels relative to the canvas, before pan/zoom).
Definition gui_node_view_types.h:77
One row of a node: an optional input socket, a body, and an optional output socket.
Definition gui_node_view_types.h:38
std::function< std::string()> value
Definition gui_node_view_types.h:61
std::string type
Definition gui_node_view_types.h:60
std::function< void()> renderBody
Row body, built between the two sockets; may call any widget (Label, Field, ...).
Definition gui_node_view_types.h:46
bool output
Right socket, rendered when true. It drives every input that names it as its source.
Definition gui_node_view_types.h:43
int rowSpan
Row height in row pitches, for tall bodies (previews, multi-line).
Definition gui_node_view_types.h:53
tachyon::color4f socketColor
Socket dot colour, also used for wires leaving this output.
Definition gui_node_view_types.h:49
std::optional< PropertyEndpoint > input
Left socket, rendered when has_value(); holds the source output feeding it (one at most).
Definition gui_node_view_types.h:40
std::string name
What its sockets' tooltip says: the pin's name, its type (muted, monospace) and its value now,...
Definition gui_node_view_types.h:59
A node (index) collapsed or expanded.
Definition gui_node_view_types.h:165
bool from
Definition gui_node_view_types.h:165
int node
Definition gui_node_view_types.h:165
bool to
Definition gui_node_view_types.h:165
A wire's (by WireKey) lane overrides changed; default means no overrides.
Definition gui_node_view_types.h:167
uint32_t wireKey
Definition gui_node_view_types.h:167
WireRouteOverrides to
Definition gui_node_view_types.h:167
WireRouteOverrides from
Definition gui_node_view_types.h:167
A node (index) moved; positions in node.pos space.
Definition gui_node_view_types.h:161
tachyon::int2 from
Definition gui_node_view_types.h:161
tachyon::int2 to
Definition gui_node_view_types.h:161
int node
Definition gui_node_view_types.h:161
A node added at index (or, when !added, taken from there), with the wires from its outputs into other...
Definition gui_node_view_types.h:173
NodeModel node
Definition gui_node_view_types.h:176
std::vector< std::pair< uint32_t, WireRouteOverrides > > lanes
WireKey -> overrides.
Definition gui_node_view_types.h:179
std::vector< std::pair< PropertyEndpoint, int > > fed
Another node's input and the property of this node whose output feeds it.
Definition gui_node_view_types.h:178
bool added
Definition gui_node_view_types.h:175
int index
Definition gui_node_view_types.h:174
An input's source changed; an invalid endpoint means unwired.
Definition gui_node_view_types.h:163
PropertyEndpoint to
Definition gui_node_view_types.h:163
PropertyEndpoint from
Definition gui_node_view_types.h:163
PropertyEndpoint input
Definition gui_node_view_types.h:163
One thing the user did in a node view, as values before and after, so a host can keep the undo histor...
Definition gui_node_view_types.h:159
std::vector< Move > moves
Definition gui_node_view_types.h:182
std::vector< Rewire > rewires
Definition gui_node_view_types.h:183
std::vector< Node > nodes
Applied before the others (so a rewire may name an added node) and undone after.
Definition gui_node_view_types.h:187
std::vector< Collapse > collapses
Definition gui_node_view_types.h:184
std::vector< Lanes > lanes
Definition gui_node_view_types.h:185
bool empty() const
True when nothing changed.
Definition gui_node_view_types.h:190
All state of one node-view widget; no global state.
Definition gui_node_view_types.h:215
std::unordered_map< uint32_t, WireRouteOverrides > wireOverrides
Pinned wire lanes, keyed by WireKey() of the wire's target endpoint.
Definition gui_node_view_types.h:257
bool marqueeCtrl
Definition gui_node_view_types.h:254
tachyon::PointerDrag nodeDrag
internal: the press on a node; moves the selection once dragged
Definition gui_node_view_types.h:287
PendingConnection pendingConnection
internal: the wire being dragged
Definition gui_node_view_types.h:228
tachyon::int2 marqueeCurrentScreen
Definition gui_node_view_types.h:251
std::optional< float2 > canvasMenuPos
internal: where the open canvas menu is for
Definition gui_node_view_types.h:283
std::vector< NodeModel > nodes
the graph; endpoints and edits refer to nodes by index
Definition gui_node_view_types.h:216
DoubleClickTracker nodeDoubleClick
Double-click-to-collapse, per view so views (and test frames) don't share it.
Definition gui_node_view_types.h:246
tachyon::ID lastClickedNodeID
StableID of the last clicked node.
Definition gui_node_view_types.h:243
tachyon::int2 lastInnerSize
last frame's canvas size, for centering
Definition gui_node_view_types.h:230
uint32_t wireColorStylesGeneration
StyleManager::Generation() of the cache.
Definition gui_node_view_types.h:299
std::function< bool(const NodeView &view, PropertyEndpoint output, PropertyEndpoint input)> canConnect
Whether an output -> input wire is allowed; null allows any.
Definition gui_node_view_types.h:295
std::vector< int > ordering
Z-order, last == front (a clicked node moves there).
Definition gui_node_view_types.h:238
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.
Definition gui_node_view_types.h:271
float minimapScale
Last frame's minimap mapping (canvas = origin + minimap pixels / scale), for clicks.
Definition gui_node_view_types.h:225
float2 wireMenuPos
internal: where on the canvas it was opened
Definition gui_node_view_types.h:273
tachyon::IntRect lastCanvasRect
Last frame's canvas padding box, in screen pixels (as events have them), for NodeViewScreenToCanvas a...
Definition gui_node_view_types.h:233
std::function< void(float2 canvasPos)> onCanvasContextMenu
Builds the canvas's context menu (MenuItem and the like), each frame while it's open; without it ther...
Definition gui_node_view_types.h:278
tachyon::float2 minimapOrigin
Definition gui_node_view_types.h:226
tachyon::float3x2 minimapStart
internal: the transform before it; put back by Escape
Definition gui_node_view_types.h:289
bool showZoomControls
zoom overlay, bottom-left
Definition gui_node_view_types.h:221
std::optional< uint32_t > wireMenuWire
the wire the open context menu is for
Definition gui_node_view_types.h:272
tachyon::PointerDrag minimapDrag
internal: a press in the minimap
Definition gui_node_view_types.h:288
bool marqueeShift
modifier snapshot at start
Definition gui_node_view_types.h:253
std::function< void(int)> onBreadcrumb
called with the clicked segment index
Definition gui_node_view_types.h:220
std::unordered_set< tachyon::ID > marqueeBaseSelection
selection snapshot before the drag
Definition gui_node_view_types.h:252
tachyon::float3x2 transform
identity = centered view (no pan/zoom)
Definition gui_node_view_types.h:229
std::unordered_set< tachyon::ID > selectedNodeIDs
Selected node stableIDs.
Definition gui_node_view_types.h:241
tachyon::float3x2 panStart
internal: the transform before it; put back by Escape
Definition gui_node_view_types.h:286
std::function< void(const NodeViewEdit &)> onEdit
Called once per finished user edit (a whole drag is one), after it is applied.
Definition gui_node_view_types.h:266
std::optional< uint32_t > hoveredWire
The wire under the mouse (by WireKey), from the last frame: highlighted, removed by a middle click,...
Definition gui_node_view_types.h:264
WireSegmentDrag wireDrag
Definition gui_node_view_types.h:260
std::vector< std::string > breadcrumb
Breadcrumb overlay at the canvas top-left, shown when non-empty.
Definition gui_node_view_types.h:219
std::vector< CachedWireHandle > wireHandleCache
Last frame's draggable segments, since grab elements are laid out before routing.
Definition gui_node_view_types.h:259
tachyon::PointerDrag marquee
A press on the empty background: a marquee once it moves the drag distance.
Definition gui_node_view_types.h:250
std::function< void(int node)> onNodeContextMenu
As onCanvasContextMenu, for node node (an index into nodes): opened by a right click on it,...
Definition gui_node_view_types.h:282
std::unordered_map< uint32_t, tachyon::VisualColorStyleIndex > wireColorStyles
Packed RGBA -> registered color style, since RenderPolyline takes a style index.
Definition gui_node_view_types.h:298
std::optional< tachyon::ID > nodeMenuNode
internal: the stableID the open node menu is for
Definition gui_node_view_types.h:284
CommandMode commandMode
Command mode set while the canvas has focus.
Definition gui_node_view_types.h:236
tachyon::PointerDrag pan
internal: a right press; once dragged, not a click
Definition gui_node_view_types.h:285
bool showMinimap
minimap overlay, bottom-right
Definition gui_node_view_types.h:222
tachyon::ID revealedFocusID
internal: the focus last scrolled into view
Definition gui_node_view_types.h:234
A wire being dragged. Committed wires are the reciprocal endpoints on NodeProperty.
Definition gui_node_view_types.h:91
std::optional< PropertyEndpoint > detachedInput
the input the wire was pulled off, if any
Definition gui_node_view_types.h:100
tachyon::int2 currentScreen
most recent mouse screen pos
Definition gui_node_view_types.h:96
PropertyEndpoint target
This frame: the socket it is over and may connect to (an input, or an output when fromInput).
Definition gui_node_view_types.h:99
bool active
a wire drag is in progress
Definition gui_node_view_types.h:92
bool fromInput
dragged from an input, towards an output
Definition gui_node_view_types.h:95
PropertyEndpoint source
The socket the wire starts from: an output, or an unwired input when fromInput.
Definition gui_node_view_types.h:94
One press on an element that may become a drag.
Definition gui_pointer_drag.h:41
A property on a node. Default-constructed is invalid: in a socket it means "present,...
Definition gui_node_view_types.h:27
int nodeIdx
index into NodeView::nodes
Definition gui_node_view_types.h:28
bool operator==(const PropertyEndpoint &) const =default
bool valid() const
True when both indices are set.
Definition gui_node_view_types.h:32
int propIdx
index into that node's properties
Definition gui_node_view_types.h:29
A wire's place among the wires between the same two nodes, so their default lanes nest instead of coi...
Definition gui_node_view_types.h:110
int32_t index
by input, top first
Definition gui_node_view_types.h:112
int32_t offset
grid steps right for the corridor lane
Definition gui_node_view_types.h:111
int32_t count
wires in the group
Definition gui_node_view_types.h:113
bool operator==(const WireLane &) const =default
User-pinned lanes of one wire (unset = default), in the route's space.
Definition gui_node_view_types.h:121
std::optional< int32_t > laneX
corridor vertical lane X
Definition gui_node_view_types.h:122
std::optional< int32_t > exitX
detour vertical lane near the output
Definition gui_node_view_types.h:123
std::optional< int32_t > laneY
detour horizontal return-lane Y
Definition gui_node_view_types.h:125
bool operator==(const WireRouteOverrides &) const =default
std::optional< int32_t > entryX
detour vertical lane near the input
Definition gui_node_view_types.h:124
WireLane lane
where the unpinned lanes go in its group
Definition gui_node_view_types.h:126
Polyline plus its draggable interior segments (never the end stubs).
Definition gui_node_view_types.h:141
std::vector< tachyon::int2 > points
the polyline, output to input
Definition gui_node_view_types.h:142
std::vector< WireSegmentHandle > handles
Definition gui_node_view_types.h:143
Segment drag via mouse capture rather than DnD, so the resize cursor sticks.
Definition gui_node_view_types.h:202
bool vertical
Definition gui_node_view_types.h:206
int32_t startValue
lane coordinate at drag start (node.pos space)
Definition gui_node_view_types.h:207
WireRouteOverrides lanesBefore
the wire's overrides at drag start, for the edit
Definition gui_node_view_types.h:208
uint32_t wireKey
Definition gui_node_view_types.h:204
WireHandle role
Definition gui_node_view_types.h:205
tachyon::PointerDrag press
the handle's press, a drag from the start
Definition gui_node_view_types.h:203
Draggable interior segment; vertical segments drag horizontally and vice versa.
Definition gui_node_view_types.h:133
WireHandle role
which lane dragging it changes
Definition gui_node_view_types.h:135
tachyon::int2 b
segment endpoints, same space as the route points
Definition gui_node_view_types.h:134
bool vertical
Definition gui_node_view_types.h:136
tachyon::int2 a
Definition gui_node_view_types.h:134
Definition gui_base_types.h:395
Definition gui_base_types.h:121
2D affine transform matrix (2 rows x 3 columns): x' = r0.x*x + r0.y*y + r0.z y' = r1....
Definition gui_base_types.h:219
Integer 2D vector.
Definition gui_base_types.h:19