SILICON
Loading...
Searching...
No Matches
componentShapeEditor.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
19
20#include <algorithm>
21#include <functional>
22#include <memory>
23#include <stdexcept>
24#include <utility>
25#include <vector>
26
27#include <nlohmann/json.hpp>
28
29#include <QDialog>
30#include <QDialogButtonBox>
31#include <QFormLayout>
32#include <QFrame>
33#include <QGraphicsScene>
34#include <QGraphicsView>
35#include <QHBoxLayout>
36#include <QHeaderView>
37#include <QLabel>
38#include <QResizeEvent>
39#include <QScopedValueRollback>
40#include <QSignalBlocker>
41#include <QSpinBox>
42#include <QTableWidget>
43#include <QTableWidgetItem>
44#include <QUndoStack>
45#include <QVBoxLayout>
46
51#include <core/subcircuit.hpp>
59#include <ui/shell/theme.hpp>
60
61namespace SILICON::ui {
62 using namespace SILICON::core;
63
64 namespace {
65
66 [[nodiscard]] std::vector<Bus>
67 previewBuses(const std::vector<GraphicalSubcircuitPortMetadata>& ports)
68 {
69 std::vector<Bus> buses;
70 buses.reserve(ports.size());
71 for (const auto& port : ports)
72 buses.emplace_back(static_cast<unsigned short>(std::max(1U, port.busSize)));
73 return buses;
74 }
75
76 void sanitizePortPositions(GraphicalSubcircuitMetadata& metadata)
77 {
78 const QRect rect = shapeRect(metadata.widthHeight);
79 const auto positionPorts = [&](auto& ports, bool input) {
80 for (std::size_t i = 0; i < ports.size(); ++i) {
81 auto& port = ports[i];
82 const QPoint position =
83 metadata.positioning == PortPositioning::Automatic
84 ? automaticPortPosition(metadata.widthHeight, input, i, ports.size())
85 : port.position;
86 port.position = sanitizePortPosition(position, rect);
87 }
88 };
89 positionPorts(metadata.inputs, true);
90 positionPorts(metadata.outputs, false);
91 }
92
93 class PreviewSubcircuitComponent : public Component {
94 public:
95 explicit PreviewSubcircuitComponent(const GraphicalSubcircuitMetadata& metadata)
96 : Component(previewBuses(metadata.inputs), previewBuses(metadata.outputs))
97 {
98 }
99
100 std::string_view typeName() const override { return SubcircuitComponent::Type; }
101 };
102
103 class PreviewPortItem : public QGraphicsItem {
104 public:
105 PreviewPortItem(QString label, bool inputPort, QSize shapeSize,
106 QGraphicsItem* parent = nullptr)
107 : QGraphicsItem(parent),
108 label(std::move(label)),
109 inputPort(inputPort),
110 m_shapeSize(shapeSize)
111 {
112 setFlag(QGraphicsItem::ItemIsMovable);
113 setFlag(QGraphicsItem::ItemSendsGeometryChanges);
114 setAcceptHoverEvents(true);
115 setCursor(Qt::OpenHandCursor);
116 setZValue(2);
117 }
118
119 void setConstrainPosition(std::function<QPointF(const QPointF&)> callback)
120 {
121 constrainPosition = std::move(callback);
122 }
123
124 void setPositionChanged(std::function<void(const QPointF&)> callback)
125 {
126 positionChanged = std::move(callback);
127 }
128
129 QRectF boundingRect() const override
130 {
131 return markerRect().united(labelRect()).adjusted(-4, -4, 4, 4);
132 }
133
134 void paint(QPainter* painter, const QStyleOptionGraphicsItem* option,
135 QWidget* widget) override
136 {
137 Q_UNUSED(option);
138 Q_UNUSED(widget);
139
140 const QColor portColor = inputPort
142 : ThemeEngine::getColor(theme::ColorToken::Orange);
143 painter->setRenderHint(QPainter::Antialiasing);
144 painter->setPen(
145 QPen(ThemeEngine::getColor(theme::ColorToken::Ink), hovered ? 3 : 2));
146 painter->setBrush(hovered ? portColor.lighter(125) : portColor);
147 painter->drawEllipse(markerRect());
148
150 painter->setFont(QFont("NovaMono", 9));
151 painter->drawText(labelRect(), Qt::AlignCenter, label);
152 }
153
154 protected:
155 QVariant itemChange(GraphicsItemChange change, const QVariant& value) override
156 {
157 if (change == QGraphicsItem::ItemPositionChange && constrainPosition)
158 return constrainPosition(value.toPointF());
159 if (change == QGraphicsItem::ItemPositionHasChanged && positionChanged)
160 positionChanged(pos());
161 return QGraphicsItem::itemChange(change, value);
162 }
163
164 void hoverEnterEvent(QGraphicsSceneHoverEvent* event) override
165 {
166 hovered = true;
167 update();
168 QGraphicsItem::hoverEnterEvent(event);
169 }
170
171 void hoverLeaveEvent(QGraphicsSceneHoverEvent* event) override
172 {
173 hovered = false;
174 update();
175 QGraphicsItem::hoverLeaveEvent(event);
176 }
177
178 void mousePressEvent(QGraphicsSceneMouseEvent* event) override
179 {
180 setCursor(Qt::ClosedHandCursor);
181 QGraphicsItem::mousePressEvent(event);
182 }
183
184 void mouseReleaseEvent(QGraphicsSceneMouseEvent* event) override
185 {
186 setCursor(Qt::OpenHandCursor);
187 QGraphicsItem::mouseReleaseEvent(event);
188 }
189
190 private:
191 [[nodiscard]] PortSide currentSide() const
192 {
193 return nearestPortSide(DiagramScene::snapToGrid(pos()), shapeRect(m_shapeSize))
194 .first;
195 }
196
197 [[nodiscard]] QRectF markerRect() const
198 {
199 constexpr qreal RADIUS = 6.0;
200 return {-RADIUS, -RADIUS, RADIUS * 2.0, RADIUS * 2.0};
201 }
202
203 [[nodiscard]] QRectF labelRect() const
204 {
205 const QFontMetricsF metrics(QFont("NovaMono", 9));
206 const QRectF text = metrics.boundingRect(label).adjusted(-6, -3, 6, 3);
207 constexpr qreal GAP = 8.0;
208
209 switch (currentSide()) {
210 case PortSide::LEFT:
211 return {-GAP - text.width(), -text.height() / 2.0, text.width(),
212 text.height()};
213 case PortSide::RIGHT:
214 return {GAP, -text.height() / 2.0, text.width(), text.height()};
215 case PortSide::UP:
216 return {-text.width() / 2.0, -GAP - text.height(), text.width(),
217 text.height()};
218 case PortSide::DOWN:
219 return {-text.width() / 2.0, GAP, text.width(), text.height()};
220 }
221 std::unreachable();
222 }
223
224 QString label;
225 bool inputPort = true;
226 QSize m_shapeSize;
227 bool hovered = false;
228 std::function<QPointF(const QPointF&)> constrainPosition;
229 std::function<void(const QPointF&)> positionChanged;
230 };
231
232 class ShapePreviewWidget : public QGraphicsView {
233 public:
234 explicit ShapePreviewWidget(QWidget* parent = nullptr)
235 : QGraphicsView(parent), scene(new QGraphicsScene(this))
236 {
237 setScene(scene);
238 setMinimumSize(460, 320);
239 setRenderHint(QPainter::Antialiasing);
240 setDragMode(QGraphicsView::NoDrag);
241 setFrameShape(QFrame::StyledPanel);
242 }
243
244 void setPortMovedCallback(
245 std::function<void(bool inputPort, std::size_t index, QPoint position)>
246 callback)
247 {
248 portMovedCallback = std::move(callback);
249 }
250
251 void setMetadata(const GraphicalSubcircuitMetadata& metadata)
252 {
253 shapeSize = metadata.widthHeight;
254 rebuild(metadata);
255 }
256
257 void setPortPosition(bool inputPort, std::size_t index, const QPoint& position)
258 {
259 auto& visuals = inputPort ? inputVisuals : outputVisuals;
260 if (index >= visuals.size())
261 return;
262
263 const QScopedValueRollback guard(suppressCallbacks, true);
264 visuals[index]->setPos(sanitizePortPosition(position, shapeRect(shapeSize)));
265 }
266
267 protected:
268 void resizeEvent(QResizeEvent* event) override
269 {
270 QGraphicsView::resizeEvent(event);
271 fitPreview();
272 }
273
274 void drawBackground(QPainter* painter, const QRectF& rect) override
275 {
276 QGraphicsView::drawBackground(painter, rect);
277 // Paint with the current theme instead of storing colors in scene items.
278 const QRectF sceneBounds = scene->sceneRect();
279 const QPen gridPen(ThemeEngine::getColor(theme::ColorToken::Grid), 1);
280 painter->setPen(gridPen);
281 for (qreal x = sceneBounds.left(); x <= sceneBounds.right();
283 painter->drawLine(QLineF(x, sceneBounds.top(), x, sceneBounds.bottom()));
284 }
285 for (qreal y = sceneBounds.top(); y <= sceneBounds.bottom();
287 painter->drawLine(QLineF(sceneBounds.left(), y, sceneBounds.right(), y));
288 }
289 }
290
291 private:
292 void rebuild(const GraphicalSubcircuitMetadata& metadata)
293 {
294 scene->clear();
295 component = nullptr;
296 inputVisuals.clear();
297 outputVisuals.clear();
298
299 const int gridMargin = gridToPixels(EXTERNAL_PORT_MARGIN_GRID + 3);
300 scene->setSceneRect(-gridMargin, -gridMargin, shapeSize.width() + gridMargin * 2,
301 shapeSize.height() + gridMargin * 2);
302 addComponent(metadata);
303
304 addPorts(metadata.inputs, true);
305 addPorts(metadata.outputs, false);
306 updateComponentPorts();
307 fitPreview();
308 }
309
310 void addComponent(const GraphicalSubcircuitMetadata& metadata)
311 {
312 component = new GraphicalLogicComponent(
313 std::make_shared<PreviewSubcircuitComponent>(metadata),
314 new SubcircuitRectShape(shapeSize), nullptr, false);
315 component->setZValue(1);
316 scene->addItem(component);
317 }
318
319 void addPorts(const std::vector<GraphicalSubcircuitPortMetadata>& ports,
320 bool inputPort)
321 {
322 auto& visuals = inputPort ? inputVisuals : outputVisuals;
323 visuals.reserve(ports.size());
324
325 for (std::size_t index = 0; index < ports.size(); ++index) {
326 const auto& port = ports[index];
327 QString label = QString::fromStdString(port.name);
328
329 auto* item = new PreviewPortItem(label, inputPort, shapeSize);
330 item->setToolTip(QString::fromStdString(port.name));
331 item->setPos(sanitizePortPosition(port.position, shapeRect(shapeSize)));
332 item->setConstrainPosition([this](const QPointF& position) {
333 return sanitizePortPosition(position, shapeRect(shapeSize));
334 });
335 item->setPositionChanged([this, inputPort, index](const QPointF& position) {
336 auto& visuals = inputPort ? inputVisuals : outputVisuals;
337 if (index >= visuals.size())
338 return;
339 updateComponentPorts();
340 if (!suppressCallbacks && portMovedCallback)
341 portMovedCallback(inputPort, index, position.toPoint());
342 });
343 scene->addItem(item);
344
345 visuals.push_back(item);
346 }
347 }
348
349 std::vector<PortPair> previewPortPairs(const std::vector<PreviewPortItem*>& visuals,
350 bool inputPort) const
351 {
352 std::vector<PortPair> pairs;
353 pairs.reserve(visuals.size());
354 for (const auto* item : visuals) {
355 pairs.emplace_back(item->toolTip().isEmpty()
356 ? QString(inputPort ? "input" : "output")
357 : item->toolTip(),
358 item->pos().toPoint());
359 }
360 return pairs;
361 }
362
363 void updateComponentPorts()
364 {
365 if (!component)
366 return;
367
368 component->setPorts(previewPortPairs(inputVisuals, true),
369 previewPortPairs(outputVisuals, false));
370 }
371
372 void fitPreview()
373 {
374 if (!scene || scene->sceneRect().isEmpty())
375 return;
376 fitInView(scene->sceneRect(), Qt::KeepAspectRatio);
377 }
378
379 QGraphicsScene* scene = nullptr;
380 GraphicalLogicComponent* component = nullptr;
381 QSize shapeSize;
382 std::vector<PreviewPortItem*> inputVisuals;
383 std::vector<PreviewPortItem*> outputVisuals;
384 bool suppressCallbacks = false;
385 std::function<void(bool, std::size_t, QPoint)> portMovedCallback;
386 };
387
388 QTableWidget*
389 makePortPositionTable(const std::vector<GraphicalSubcircuitPortMetadata>& ports,
390 QWidget* parent)
391 {
392 auto* table = new QTableWidget(parent);
393 table->setColumnCount(4);
394 table->setHorizontalHeaderLabels(
395 {QObject::tr("Name"), QObject::tr("X"), QObject::tr("Y"), QObject::tr("Bus")});
396 table->setRowCount(static_cast<int>(ports.size()));
397
398 for (int row = 0; row < static_cast<int>(ports.size()); ++row) {
399 const auto& port = ports[static_cast<std::size_t>(row)];
400 auto* name = new QTableWidgetItem(QString::fromStdString(port.name));
401 name->setFlags(name->flags() & ~Qt::ItemIsEditable);
402 table->setItem(row, 0, name);
403 const auto gridPosition = pixelsToGrid(port.position);
404 table->setItem(row, 1, new QTableWidgetItem(QString::number(gridPosition.x())));
405 table->setItem(row, 2, new QTableWidgetItem(QString::number(gridPosition.y())));
406 auto* bus = new QTableWidgetItem(QString::number(port.busSize));
407 bus->setFlags(bus->flags() & ~Qt::ItemIsEditable);
408 table->setItem(row, 3, bus);
409 }
410 table->horizontalHeader()->setSectionResizeMode(0, QHeaderView::Stretch);
411 table->horizontalHeader()->setSectionResizeMode(1, QHeaderView::ResizeToContents);
412 table->horizontalHeader()->setSectionResizeMode(2, QHeaderView::ResizeToContents);
413 table->horizontalHeader()->setSectionResizeMode(3, QHeaderView::ResizeToContents);
414 return table;
415 }
416
417 void setPortTablePosition(QTableWidget* table, int row, const QPoint& position)
418 {
419 if (row < 0 || row >= table->rowCount())
420 return;
421
422 const QSignalBlocker blocker(table);
423 Q_UNUSED(blocker);
424 const auto gridPosition = pixelsToGrid(position);
425 table->item(row, 1)->setText(QString::number(gridPosition.x()));
426 table->item(row, 2)->setText(QString::number(gridPosition.y()));
427 }
428
429 void setPortTablePositions(QTableWidget* table,
430 const std::vector<GraphicalSubcircuitPortMetadata>& ports)
431 {
432 const int rowCount = std::min(table->rowCount(), static_cast<int>(ports.size()));
433 for (int row = 0; row < rowCount; ++row)
434 setPortTablePosition(table, row, ports[static_cast<std::size_t>(row)].position);
435 }
436
437 } // namespace
438
439 void editGraphicalSubcircuitShape(const std::string& slug,
441 QUndoStack* undoStack, QWidget* parent)
442 {
443 if (slug.empty())
444 return;
445
448 const auto* document = project.documents().find(path);
449 if (!document)
450 return;
451
452 const auto json = nlohmann::json::parse(document->getContents(), nullptr, false);
453 auto metadata = parseGraphicalSubcircuitMetadata(json);
454 if (!metadata)
455 return;
458 metadata = synchronizeGraphicalSubcircuitMetadata(json, *metadata, &resolver);
459 auto draft = std::make_shared<GraphicalSubcircuitMetadata>(*metadata);
460 sanitizePortPositions(*draft);
461
462 auto* dialog = new QDialog(parent);
463 dialog->setWindowTitle(QObject::tr("Edit shape"));
464 dialog->resize(860, 560);
465 auto* layout = new QVBoxLayout(dialog);
466 auto* body = new QHBoxLayout();
467 layout->addLayout(body);
468
469 auto* preview = new ShapePreviewWidget(dialog);
470 preview->setMetadata(*draft);
471 body->addWidget(preview, 1);
472
473 auto* controls = new QVBoxLayout();
474 body->addLayout(controls);
475
476 auto* form = new QFormLayout();
477 controls->addLayout(form);
478
479 auto* width = new QSpinBox(dialog);
480 width->setRange(1, 100);
481 width->setValue(pixelsToGrid(draft->widthHeight.width()));
482 auto* height = new QSpinBox(dialog);
483 height->setRange(1, 100);
484 height->setValue(pixelsToGrid(draft->widthHeight.height()));
485 form->addRow(QObject::tr("Width"), width);
486 form->addRow(QObject::tr("Height"), height);
487
488 auto* inputTable = makePortPositionTable(draft->inputs, dialog);
489 auto* outputTable = makePortPositionTable(draft->outputs, dialog);
490 controls->addWidget(new QLabel(QObject::tr("Inputs"), dialog));
491 controls->addWidget(inputTable);
492 controls->addWidget(new QLabel(QObject::tr("Outputs"), dialog));
493 controls->addWidget(outputTable);
494
495 auto updatePortTables = [draft, inputTable, outputTable] {
496 setPortTablePositions(inputTable, draft->inputs);
497 setPortTablePositions(outputTable, draft->outputs);
498 };
499
500 const auto markManual = [draft] { draft->positioning = PortPositioning::Manual; };
501
502 auto applySize = [draft, preview, updatePortTables](int widthGrid, int heightGrid) {
503 draft->autoSize = false;
504 draft->widthHeight = QSize(gridToPixels(widthGrid), gridToPixels(heightGrid));
505 sanitizePortPositions(*draft);
506 updatePortTables();
507 preview->setMetadata(*draft);
508 };
509
510 QObject::connect(
511 width, &QSpinBox::valueChanged, dialog,
512 [height, applySize](int value) { applySize(value, height->value()); });
513 QObject::connect(height, &QSpinBox::valueChanged, dialog,
514 [width, applySize](int value) { applySize(width->value(), value); });
515
516 auto applyTableEdit = [draft, preview, markManual](QTableWidget* table,
517 bool inputPort,
518 QTableWidgetItem* item) {
519 if (!item || (item->column() != 1 && item->column() != 2))
520 return;
521
522 auto& ports = inputPort ? draft->inputs : draft->outputs;
523 const int row = item->row();
524 if (row < 0 || row >= static_cast<int>(ports.size()))
525 return;
526
527 auto& port = ports[static_cast<std::size_t>(row)];
528 markManual();
529 const auto currentGridPosition = pixelsToGrid(port.position);
530 bool okX = false;
531 bool okY = false;
532 const int requestedX = table->item(row, 1)->text().toInt(&okX);
533 const int requestedY = table->item(row, 2)->text().toInt(&okY);
534 port.position = sanitizePortPosition(
535 gridToPixels(QPoint(okX ? requestedX : currentGridPosition.x(),
536 okY ? requestedY : currentGridPosition.y())),
537 shapeRect(draft->widthHeight));
538 setPortTablePosition(table, row, port.position);
539 preview->setPortPosition(inputPort, static_cast<std::size_t>(row), port.position);
540 };
541
542 QObject::connect(inputTable, &QTableWidget::itemChanged, dialog,
543 [inputTable, applyTableEdit](QTableWidgetItem* item) {
544 applyTableEdit(inputTable, true, item);
545 });
546 QObject::connect(outputTable, &QTableWidget::itemChanged, dialog,
547 [outputTable, applyTableEdit](QTableWidgetItem* item) {
548 applyTableEdit(outputTable, false, item);
549 });
550
551 preview->setPortMovedCallback([draft, inputTable, outputTable,
552 markManual](bool inputPort, std::size_t index,
553 QPoint position) {
554 auto& ports = inputPort ? draft->inputs : draft->outputs;
555 if (index >= ports.size())
556 return;
557
558 ports[index].position = position;
559 markManual();
560 setPortTablePosition(inputPort ? inputTable : outputTable, static_cast<int>(index),
561 position);
562 });
563
564 auto* buttons =
565 new QDialogButtonBox(QDialogButtonBox::Ok | QDialogButtonBox::Cancel, dialog);
566 layout->addWidget(buttons);
567 QObject::connect(buttons, &QDialogButtonBox::accepted, dialog, &QDialog::accept);
568 QObject::connect(buttons, &QDialogButtonBox::rejected, dialog, &QDialog::reject);
569 QObject::connect(
570 dialog, &QDialog::accepted, dialog, [draft, path, undoStack, parent, &project] {
571 try {
572 const auto* currentDocument = project.documents().find(path);
573 if (!currentDocument)
574 return;
575
576 const auto oldSceneJson = currentDocument->getContents();
577 auto json = nlohmann::json::parse(oldSceneJson);
578 json["graphicalComponent"] = graphicalSubcircuitMetadataToJson(*draft);
579 const auto newSceneJson = json.dump(2);
580 if (newSceneJson == oldSceneJson)
581 return;
582
583 // Shape edits are registry document edits, so route them through the window
584 // undo stack.
585 if (undoStack) {
586 auto apply = [path, &project](const std::string& sceneJson) {
587 project.upsertDocument(SILICON::project::Document(path, sceneJson));
588 };
589 undoStack->push(
590 new MetadataEditCommand(QObject::tr("Edit Subcircuit Shape"),
591 oldSceneJson, newSceneJson, std::move(apply)));
592 } else {
593 project.upsertDocument(SILICON::project::Document(path, newSceneJson));
594 }
595 } catch (const std::exception& e) {
596 SILICON::ui::inputDialog::warning(parent, QObject::tr("Edit shape"),
597 e.what());
598 }
599 });
600
601#ifdef __EMSCRIPTEN__
602 dialog->setAttribute(Qt::WA_DeleteOnClose);
603 dialog->open();
604#else
605 dialog->exec();
606 delete dialog;
607#endif
608 }
609
610} // namespace SILICON::ui
static ComponentRegistry & instance()
Base class for all digital circuit components.
static constexpr std::string_view Type
static constexpr int GRID_SIZE
Grid cell size in scene units.
static QPoint snapToGrid(QPointF point)
Snaps a point to the grid.
static const QColor & getColor(theme::ColorToken token)
Definition theme.hpp:92
RTLIL::SigSpec port(RTLIL::Module *module, RTLIL::Cell *cell, RTLIL::IdString key, int expected)
std::string documentPathForSlug(const DocumentType type, const std::string_view slug)
void warning(QWidget *parent, const QString &title, const QString &text)
QVariant value(const QSettings &settings, const Definition &setting)
Reads a setting value, falling back to its declared default when unset.
std::pair< PortSide, QPoint > nearestPortSide(const QPoint &pt, const QRect &rect)
Finds the nearest rectangle side for an interior or exterior point.
std::optional< GraphicalSubcircuitMetadata > parseGraphicalSubcircuitMetadata(const nlohmann::json &document)
Parses graphical subcircuit metadata from a scene document.
Definition metadata.cpp:224
int pixelsToGrid(int value)
Definition grid.hpp:33
nlohmann::ordered_json graphicalSubcircuitMetadataToJson(const GraphicalSubcircuitMetadata &metadata)
Serializes graphical metadata to the JSON shape/port object.
Definition metadata.cpp:324
int gridToPixels(int value)
Definition grid.hpp:29
constexpr int EXTERNAL_PORT_MARGIN_GRID
Definition geometry.hpp:27
QRect shapeRect(const QSize &size)
Definition geometry.hpp:42
QPoint sanitizePortPosition(const QPointF &position, const QRect &rect)
Definition geometry.hpp:48
GraphicalSubcircuitMetadata synchronizeGraphicalSubcircuitMetadata(const nlohmann::json &document, const GraphicalSubcircuitMetadata &fallbackMetadata, const CircuitResolver *resolver)
Reconciles saved graphical metadata with the current circuit document.
Definition metadata.cpp:276
void editGraphicalSubcircuitShape(const std::string &slug, SILICON::project::ProjectContext &project, QUndoStack *undoStack, QWidget *parent)
Opens the modal editor for a project subcircuit's graphical shape.
QPoint automaticPortPosition(const QSize &size, bool input, std::size_t index, std::size_t count)
Definition geometry.hpp:31
Visual metadata used to render a subcircuit as a reusable component.
Definition metadata.hpp:74