SILICON
Loading...
Searching...
No Matches
graphicalWire.cpp
Go to the documentation of this file.
1/*
2 Copyright (c) 2026. Giulio Cocconi
3
4 This program is free software: you can redistribute it and/or modify
5 it under the terms of the GNU General Public License as published by
6 the Free Software Foundation, either version 3 of the License, or
7 (at your option) any later version.
8
9 This program is distributed in the hope that it will be useful,
10 but WITHOUT ANY WARRANTY; without even the implied warranty of
11 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 GNU General Public License for more details.
13
14 You should have received a copy of the GNU General Public License
15 along with this program. If not, see <http://www.gnu.org/licenses/>.
16 */
17
18#include "graphicalWire.hpp"
19#include <QFontInfo>
20
22
23#include <QDebug>
24#include <QGraphicsSceneMouseEvent>
25#include <QLineF>
26#include <algorithm>
27#include <atomic>
28#include <ranges>
29#include <stdexcept>
30#include <unordered_set>
31
32#include <core/wire.hpp> // Gives access to State enum for coloring
33#include <ui/shell/theme.hpp>
38
39
40namespace SILICON::ui {
41using namespace SILICON::core;
42
43namespace {
44std::atomic<uint64_t> nextGraphicalWireRouteId{1};
45}
46
47// --- Graphical Wire --------------------------------------------------------------------
48
49GraphicalWire::GraphicalWire() : routeId(nextGraphicalWireRouteId++) {}
50
51void GraphicalWire::restoreRouteId(const uint64_t id)
52{
53 routeId = id;
54 uint64_t expected = nextGraphicalWireRouteId.load();
55 while (expected <= id
56 && !nextGraphicalWireRouteId.compare_exchange_weak(expected, id + 1)) {}
57}
58
59GraphicalWire::GraphicalWire(unsigned int busSize)
61{
62 setBusSize(busSize);
63}
64
66{
67 if (!segment || segments.contains(segment))
68 return;
69
70 segments.insert(segment);
71}
72
74{
75 segments.erase(segment);
76}
77
78void GraphicalWire::setBusSize(unsigned int size)
79{
80 bus.setSize(size);
81}
82
84{
85 for (const auto& wire : bus)
86 if (wire)
87 wire->forceSetCurrentState(State::UNKNOWN);
88}
89
90void GraphicalWire::setConnectionError(std::optional<QString> reason)
91{
92 if (reason == connectionError)
93 return;
94
95 this->connectionError = reason;
96 for (auto* segment : getSegments()) {
97 segment->setToolTip(reason.value_or(""));
98 segment->update();
99 }
100}
101
103{
104 if (connectionError.has_value() || bus.isInErrorState())
106
107 // Show simulation state visually for single wires
108 if (bus.size() == 1 && bus[0]) {
109 switch (bus[0]->getCurrentState()) {
113 default:
114 qWarning() << "Unhandled wire status in getColor()";
116 }
117 }
119}
120
122{
123 if (!w)
125 return w->getColor();
126}
127
128std::vector<QPointF> GraphicalWire::getVertices() const
129{
130 std::vector<QPointF> vertices;
131
132 for (const auto segment : segments) {
133 const auto scenePoints = segment->getScenePoints();
134 const auto sceneFirst = scenePoints.front();
135 const auto sceneLast = scenePoints.back();
136
137 if (!segment->isFirstPointJunction())
138 vertices.push_back(sceneFirst);
139 if (!segment->isLastPointJunction())
140 vertices.push_back(sceneLast);
141 }
142
143 return vertices;
144}
145
146QPainterPath GraphicalWire::shape() const
147{
148 QPainterPath combinedPath;
149
150 for (const auto segment : segments)
151 combinedPath.addPath(segment->mapToScene(segment->centerlineShape()).simplified());
152
153 return combinedPath;
154}
155
156// --- GraphicalWireSegment --------------------------------------------------------------
157
160{
161 setFlag(QGraphicsItem::ItemSendsGeometryChanges);
162 setFlag(QGraphicsItem::ItemIsSelectable, true);
163 setAcceptHoverEvents(true);
164
165 // Convert scene coordinate to local coordinate if we have a parent
166 if (parent)
167 firstPoint = mapFromScene(firstPoint);
168
169 points.push_back(firstPoint);
170 updatePath();
171}
172
174{
175 if (graphicalWire && graphicalWire->getManager()) {
176 graphicalWire->getManager()->updateSegmentTopology(this);
177 }
178}
179
181{
182 if (graphicalWire == newWire)
183 return;
184
185 // Keep a reference to the old wire before we overwrite it
186 GraphicalWire* oldWire = graphicalWire;
187
188 if (oldWire)
189 oldWire->removeSegment(this);
190
191 // Assign the new wire, or create a brand new one using the old wire's manager
192 if (newWire) {
193 graphicalWire = newWire;
194 } else {
195 // Because of the early return at the top, oldWire is guaranteed to be non-null here
196 if (!oldWire)
197 throw std::logic_error("setGraphicalWire: oldWire is null unexpectedly");
198
199 auto* oldManager = oldWire->getManager();
200 if (!oldManager)
201 throw std::logic_error("setGraphicalWire: old wire has no manager");
202
203 graphicalWire = oldManager->createWire(1).get();
204 }
205
206 if (!graphicalWire)
207 throw std::logic_error("setGraphicalWire: failed to create wire");
208 graphicalWire->addSegment(this);
209
210}
211
212void GraphicalWireSegment::setShowPoints(const std::vector<QPointF>& newShowPoints)
213{
214 std::vector<QPointF> localPoints;
215 localPoints.reserve(newShowPoints.size());
216 for (const auto& pt : newShowPoints)
217 localPoints.push_back(mapFromScene(pt));
218
219 this->showPoints = localPoints;
220 updatePath();
221}
222
224{
225 if (points.empty()) {
226 points = std::move(showPoints);
227 this->showPoints = {};
228 updatePath();
229 return;
230 }
231
232 std::vector<QPointF> proposed = points;
233 proposed.insert(proposed.end(), showPoints.begin(), showPoints.end());
234 proposed = canonicalizeOrthogonalRoute(std::move(proposed));
235 if (!isOrthogonalRoute(proposed) || orthogonalRouteSelfIntersects(proposed)) {
236 qDebug() << "[GraphicalWireSegment] addPoints: invalid or self-intersecting route, "
237 "points NOT added";
238 return;
239 }
240
241 points = std::move(proposed);
242 showPoints.clear();
243 updatePath();
244}
245
247{
248 const auto previousBounds = boundingRect();
249 prepareGeometryChange();
251 path.clear();
252 showPath.clear();
253
254 path.moveTo(this->points[0]);
255
256 for (unsigned int i = 1; i < this->points.size(); i++)
257 path.lineTo(this->points[i]);
258
259 if (!this->showPoints.empty()) {
260 showPath.moveTo(this->lastPoint());
261 for (auto showPoint : this->showPoints)
262 showPath.lineTo(showPoint);
263 }
264 if (boundingRect() == previousBounds)
265 return;
266 if (auto* diagram = qobject_cast<DiagramScene*>(scene()))
267 diagram->expandSceneBounds(sceneBoundingRect());
268}
269
270// --- Painting --------------------------------------------------------------------------
271
272void GraphicalWireSegment::paint(QPainter* painter,
273 const QStyleOptionGraphicsItem* option, QWidget* widget)
274{
275 const int size = graphicalWire ? graphicalWire->getBus().size() : 1;
276 const QColor color = GraphicalWire::getColor(graphicalWire);
277
278 // Draw main path and showPath
279 painter->setPen(QPen(color, 3));
280 painter->drawPath(path);
281
282 painter->setPen(QPen(ThemeEngine::getColor(theme::ColorToken::Error), 3));
283 painter->drawPath(showPath);
284
285 // Draw junction ellipses independently: a segment may connect two junctions.
286 if (firstJunction) {
287 painter->setPen(QPen(color, 3));
288 painter->drawEllipse(points.front(), 3, 3);
289 }
290 if (lastJunction) {
291 painter->setPen(QPen(color, 3));
292 painter->drawEllipse(points.back(), 3, 3);
293 }
294
295 // Draw hovered / selected points
296 if (isSelected()) {
297 painter->setPen(Qt::NoPen);
298 for (size_t i = 0; i < points.size(); ++i) {
299 const bool hovered = hoveredPointIndex && i == *hoveredPointIndex;
300 QColor pointColor = ThemeEngine::getColor(hovered ? theme::ColorToken::ErrorHover
302 if (!hovered)
303 pointColor.setAlpha(160);
304 painter->setBrush(pointColor);
305 painter->drawEllipse(points[i], POINT_RADIUS, POINT_RADIUS);
306 }
307 }
308
309 /* Bus decorations (slashes and size boxes) *
310 * 0 1 2 3 4 5 6 *
311 * | [ ] | | [ ] | */
312
313 const qreal totalLength = path.length();
314 const bool drawDecorations = (size > 1) && (totalLength >= 2 * INTERVAL);
315
316 if (!drawDecorations)
317 return;
318
319 painter->setPen(QPen(color, 2.0));
320 QFont font("NovaMono");
321 // Resolve pixel-sized application fonts before scaling the bus label.
322 font.setPointSizeF(QFontInfo(painter->font()).pointSizeF() * 0.8);
323 painter->setFont(font);
324
325 const QString sizeText = QString::number(size);
326 const QRectF boxRect(-BOX_WIDTH / 2.0, -BOX_HEIGHT / 2.0, BOX_WIDTH, BOX_HEIGHT);
327 constexpr qreal HALF_LEN = SLASH_LENGTH / 2.0;
328
329 int counter = 0;
330 for (qreal dist = INTERVAL; dist < totalLength; dist += INTERVAL, ++counter) {
331 const bool drawSlash = (counter % 2 == 0);
332 const bool drawBox = ((counter - 1) % 4 == 0);
333
334 // Skip expensive path math if we aren't drawing anything this iteration
335 if (!drawSlash && !drawBox)
336 continue;
337
338 const qreal percent = path.percentAtLength(dist);
339 const qreal pathAngle = path.angleAtPercent(percent);
340
341 painter->save();
342
343 // Move the coordinate system's origin to the center of our slash
344 painter->translate(path.pointAtPercent(percent));
345
346 // Rotate the coordinate system. `angleAtPercent()` is counter-clockwise whilst
347 // `rotate()` is clockwise, we use a negative angle to align.
348 painter->rotate(-pathAngle);
349
350 if (drawSlash) {
351 // Now that the coordinate system is aligned with the path we can draw a simple
352 // rotated line.
353 painter->rotate(SLASH_ANGLE);
354 painter->drawLine(QPointF(-HALF_LEN, 0), QPointF(HALF_LEN, 0));
355 } else if (drawBox) {
356 // Rotate the coordinate system back to the original position in order not to
357 // write the size upside down
358 if (pathAngle == 180.0)
359 painter->rotate(180.0);
360
362 painter->drawRoundedRect(boxRect, 5, 5);
364 painter->drawText(boxRect, sizeText, QTextOption(Qt::AlignCenter));
365 }
366
367 painter->restore();
368 }
369}
370
372{
373 return this->path.boundingRect()
374 .united(this->showPath.boundingRect())
375 .adjusted(-5, -5, 5, 5)
376 .adjusted(-BOX_HEIGHT / 2, -BOX_HEIGHT / 2, BOX_HEIGHT / 2, BOX_HEIGHT / 2);
377}
378
379QPainterPath GraphicalWireSegment::shape() const
380{
381 QPainterPathStroker stroker;
382 stroker.setWidth(2 * GRAB_RADIUS);
383 return stroker.createStroke(this->path);
384}
385
387{
388 return QPainterPathStroker().createStroke(path);
389}
390
391bool GraphicalWireSegment::isPointOnPath(const QPointF point) const
392{
393 constexpr qreal HIT_WIDTH = 10.0;
394 if (points.size() == 1)
395 return QLineF(point, points.front()).length() <= HIT_WIDTH / 2.0;
396
397 QPainterPathStroker stroker;
398 stroker.setWidth(HIT_WIDTH);
399 return stroker.createStroke(path).contains(point);
400}
401
402std::vector<QPointF> GraphicalWireSegment::getScenePoints() const
403{
404 return points | std::views::transform([this](const QPointF& point) {
405 return mapToScene(point);
406 })
407 | std::ranges::to<std::vector>();
408}
409void GraphicalWireSegment::setPoints(std::vector<QPointF> newPoints)
410{
411 if (newPoints.empty())
412 throw std::invalid_argument("setPoints: points must not be empty");
413 prepareGeometryChange();
414 points = std::move(newPoints);
415 updatePath();
416}
417
418std::optional<size_t> GraphicalWireSegment::pointIndexAt(const QPointF localPos) const
419{
420 for (size_t i = 0; i < points.size(); ++i) {
421 if (QLineF(localPos, points[i]).length() <= GRAB_RADIUS)
422 return i;
423 }
424 return std::nullopt;
425}
426
427
428std::optional<size_t> GraphicalWireSegment::edgeIndexAt(const QPointF localPos) const
429{
430 constexpr qreal radiusSq = GRAB_RADIUS * GRAB_RADIUS;
431
432 for (auto [i, segment] : points | SILICON::views::adjacent<2> | SILICON::views::enumerate) {
433 auto [p1, p2] = segment;
434
435 const QPointF dir = p2 - p1;
436 const qreal dirSq = QPointF::dotProduct(dir, dir);
437
438 if (qFuzzyIsNull(dirSq)) // Safer and faster than length() == 0
439 continue;
440
441 const qreal t = QPointF::dotProduct(localPos - p1, dir) / dirSq;
442
443 // Only check distance if the projection falls on the segment bounds
444 if (t >= 0.0 && t <= 1.0) {
445 const QPointF diff = localPos - (p1 + dir * t);
446 if (QPointF::dotProduct(diff, diff) <= radiusSq)
447 return static_cast<size_t>(i);
448 }
449 }
450
451 return std::nullopt;
452}
453
455{
456 if (firstJunction == v)
457 return;
458
459 firstJunction = v;
460 update();
461}
462
464{
465 if (lastJunction == v)
466 return;
467
468 lastJunction = v;
469 update();
470}
471
473{
474 if (!other)
475 throw std::invalid_argument("isAlignedWith: other is null");
476 if (other == this)
477 throw std::logic_error("isAlignedWith: cannot compare segment with itself");
478 if (points.size() < 2 || other->points.size() < 2)
479 throw std::logic_error("isAlignedWith: segments must have at least 2 points");
480 if (!scene())
481 throw std::logic_error("isAlignedWith: segment not in a scene");
482
483 struct Endpoint {
484 QPointF point;
485 QPointF inwardDirection;
486 };
487
488 const std::array endpoints = {
489 Endpoint{mapToScene(points.front()),
490 mapToScene(points[1]) - mapToScene(points.front())},
491 Endpoint{mapToScene(points.back()),
492 mapToScene(points[points.size() - 2]) - mapToScene(points.back())},
493 };
494 const std::array otherEndpoints = {
495 Endpoint{other->mapToScene(other->points.front()),
496 other->mapToScene(other->points[1])
497 - other->mapToScene(other->points.front())},
498 Endpoint{other->mapToScene(other->points.back()),
499 other->mapToScene(other->points[other->points.size() - 2])
500 - other->mapToScene(other->points.back())},
501 };
502
503 for (const Endpoint& endpoint : endpoints) {
504 for (const Endpoint& otherEndpoint : otherEndpoints) {
505 if (endpoint.point != otherEndpoint.point)
506 continue;
507
508 const QPointF& a = endpoint.inwardDirection;
509 const QPointF& b = otherEndpoint.inwardDirection;
510 const qreal cross = a.x() * b.y() - a.y() * b.x();
511 const qreal dot = a.x() * b.x() + a.y() * b.y();
512
513 // Sharing an endpoint is not enough: at a junction only the two opposite,
514 // collinear arms form the trunk. Perpendicular arms must remain branches.
515 if (qFuzzyIsNull(cross) && dot < 0.0)
516 return true;
517 }
518 }
519 return false;
520}
521
522void GraphicalWireSegment::mousePressEvent(QGraphicsSceneMouseEvent* event)
523{
524 if (event->button() == Qt::LeftButton) {
525 auto* ds = qobject_cast<DiagramScene*>(scene());
526 const bool selecting = event->modifiers() & (Qt::ControlModifier | Qt::ShiftModifier);
527 if (ds && !selecting && !(isSelected() && ds->hasWireGroupSelection())
528 && ds->beginWireDrag(this, event->scenePos(), event->pos())) {
529 if (!isSelected())
530 ds->clearSelection();
531 setSelected(true);
532 event->accept();
533 return;
534 }
535 }
537}
538
539void GraphicalWireSegment::mouseMoveEvent(QGraphicsSceneMouseEvent* event)
540{
541 auto* ds = qobject_cast<DiagramScene*>(scene());
542 if (ds && ds->isDraggingWire(this)) {
543 ds->updateWireDrag(this, event->scenePos());
544 event->accept();
545 return;
546 }
547 GraphicalItem::mouseMoveEvent(event);
548}
549
550void GraphicalWireSegment::mouseReleaseEvent(QGraphicsSceneMouseEvent* event)
551{
552 auto* ds = qobject_cast<DiagramScene*>(scene());
553 if (!ds || !ds->isDraggingWire(this)) {
555 return;
556 }
557 if (event->button() != Qt::LeftButton)
558 return;
559 ds->finishWireDrag(this);
560 event->accept();
561}
562
563void GraphicalWireSegment::hoverMoveEvent(QGraphicsSceneHoverEvent* event)
564{
565 auto* ds = qobject_cast<DiagramScene*>(scene());
566 if (!ds || ds->getInteractionMode() != InteractionMode::NORMAL_MODE) {
567 GraphicalItem::hoverMoveEvent(event);
568 return;
569 }
570
571 auto newHovered = pointIndexAt(event->pos());
572 if (newHovered != hoveredPointIndex) {
573 hoveredPointIndex = newHovered;
574 update();
575 }
576
577 const auto edgeIndex = edgeIndexAt(event->pos());
578 if (newHovered)
579 setCursor(Qt::SizeAllCursor);
580 else if (edgeIndex)
581 setCursor(points[*edgeIndex].y() == points[*edgeIndex + 1].y()
582 ? Qt::SizeVerCursor : Qt::SizeHorCursor);
583 else
584 unsetCursor();
585
586 GraphicalItem::hoverMoveEvent(event);
587}
588
590{
592 unsetCursor();
593 if (mode != InteractionMode::NORMAL_MODE && hoveredPointIndex.has_value()) {
594 hoveredPointIndex = std::nullopt;
595 update();
596 }
597}
598
600{
601 if (auto* ds = qobject_cast<DiagramScene*>(scene()); ds && ds->isDraggingWire(this))
602 ds->cancelWireDrag();
603 if (!graphicalWire)
604 return;
605
606 // Cache the manager as removing the segment from the wire might trigger a clean-up
607 auto* manager = graphicalWire->getManager();
608
609 // Extract the segment from the wire so the manager sees the accurate segment count
610 graphicalWire->removeSegment(this);
611
612 if (manager)
613 manager->removeSegment(this);
614}
615
616nlohmann::ordered_json GraphicalWireSegment::serialize() const
617{
618 nlohmann::ordered_json j;
619 j["uiId"] = getUiId();
620
621 // Persist scene coordinates; the loader reconstructs segments at the scene origin.
622 auto jsonPoints = getScenePoints() | std::views::transform([](const QPointF& p) {
623 return nlohmann::ordered_json{{"x", p.x()}, {"y", p.y()}};
624 })
625 | std::ranges::to<std::vector>();
626
627 j["points"] = jsonPoints;
628
629 if (graphicalWire) {
630 const auto& bus = graphicalWire->getBus();
631 if (bus.size() > 0 && bus[0])
632 j["wireId"] = bus[0]->getId();
633 }
634
635 return j;
636}
637
638} // namespace SILICON::ui
virtual void modeChanged(InteractionMode mode)
Called when the interaction mode changes.
GraphicalItem(ItemCategory category=ItemCategory::GraphicalItem, QGraphicsItem *parent=nullptr)
void mouseReleaseEvent(QGraphicsSceneMouseEvent *event) override
void mousePressEvent(QGraphicsSceneMouseEvent *event) override
The visible, selectable polyline wire on the diagram scene.
std::vector< QPointF > showPoints
Temporary points while drawing.
void setLastPointJunction(bool v)
Sets last endpoint junction status.
void setPoints(std::vector< QPointF > newPoints)
Replaces all points at once.
void updatePath()
Updates the internal path shapes.
QPainterPath shape() const override
Gets the shape for hit testing.
QPainterPath showPath
The temporary path while drawing.
QPainterPath centerlineShape() const
Narrow painted centerline used by component collision checks.
bool lastJunction
Junction flag for last endpoint.
void setFirstPointJunction(bool v)
Sets first endpoint junction status.
static constexpr int BOX_WIDTH
Width of bus size label box.
QPointF firstPoint() const
Gets the first point.
nlohmann::ordered_json serialize() const
Serializes the wire segment to JSON.
static constexpr int SLASH_ANGLE
Angle for slash decorations.
std::optional< size_t > edgeIndexAt(QPointF localPos) const
Finds the first edge within the grab radius of a local position.
static constexpr int INTERVAL
Interval for bus size decorations.
static constexpr int BOX_HEIGHT
Height of bus size label box.
static constexpr double POINT_RADIUS
Radius of draggable points.
void setGraphicalWire(GraphicalWire *newWire)
Sets the logical wire, optionally propagating to touching siblings.
GraphicalWireSegment(QPointF firstPoint, QGraphicsItem *parent=nullptr)
Constructs a segment starting at the given point.
std::vector< QPointF > points
The segment points.
void hoverMoveEvent(QGraphicsSceneHoverEvent *event) override
Handles hover for point highlighting.
QPointF lastPoint() const
Gets the last point.
static constexpr int SLASH_LENGTH
Length of slash decorations.
GraphicalWire * graphicalWire
The logical wire this segment belongs to.
std::optional< size_t > hoveredPointIndex
Currently hovered point index.
std::vector< QPointF > getScenePoints() const
Gets all points mapped into scene coordinates.
std::optional< size_t > pointIndexAt(QPointF localPos) const
Gets the index of the point nearest to localPos.
void mouseReleaseEvent(QGraphicsSceneMouseEvent *event) override
Handles mouse release.
void modeChanged(InteractionMode mode) override
Clears the drag cursor and resets hover highlighting outside normal mode.
void setShowPoints(const std::vector< QPointF > &newShowPoints)
Sets temporary points shown while drawing.
bool isPointOnPath(QPointF point) const
Checks if a point is on the wire path.
void mousePressEvent(QGraphicsSceneMouseEvent *event) override
Handles mouse press for point dragging.
void addPoints()
Confirms the show points as actual wire points.
static constexpr double GRAB_RADIUS
Grab radius for point selection.
QRectF boundingRect() const override
Gets the bounding rectangle.
bool firstJunction
Junction flag for first endpoint.
void paint(QPainter *painter, const QStyleOptionGraphicsItem *option, QWidget *widget) override
Paints the wire segment.
bool isAlignedWith(const GraphicalWireSegment *other) const
Checks whether another segment is a straight continuation.
QPainterPath path
The main path.
void mouseMoveEvent(QGraphicsSceneMouseEvent *event) override
Handles mouse move for point dragging.
Logical wire entity that groups segments sharing the same bus.
void addSegment(GraphicalWireSegment *segment)
Adds a segment to this wire.
QColor getColor() const
Gets the color for this wire based on bus size.
void removeSegment(GraphicalWireSegment *segment)
Removes a segment from this wire.
WireManager * getManager() const
Gets the wire manager.
GraphicalWire()
Creates a wire with a unique route identifier.
void restoreRouteId(uint64_t id)
Restores a saved identifier and advances the identifier allocator.
QPainterPath shape() const
Gets the combined shape of all segments.
const std::unordered_set< GraphicalWireSegment * > & getSegments() const
Gets all segments belonging to this wire.
void setBusSize(unsigned int size)
Sets the bus size.
std::optional< QString > connectionError
void setConnectionError(std::optional< QString > reason)
Updates the connection error and refreshes segment tooltips and painting.
void clearBusState()
Clears the state of all wires in the bus.
std::vector< QPointF > getVertices() const
Gets vertices at wire endpoints that are not junctions.
std::unordered_set< GraphicalWireSegment * > segments
Set of segments belonging to this wire.
static const QColor & getColor(theme::ColorToken token)
Definition theme.hpp:92
std::vector< QPointF > canonicalizeOrthogonalRoute(std::vector< QPointF > points)
Removes consecutive duplicates and redundant collinear interior points.
bool orthogonalRouteSelfIntersects(const std::span< const QPointF > points)
Detects crossings, touches, or retraced portions within one route.
bool isOrthogonalRoute(const std::span< const QPointF > points)
Returns whether every consecutive route segment is axis-aligned.
DiagramScene::InteractionMode InteractionMode
Alias for DiagramScene::InteractionMode.
constexpr auto adjacent