50 #include <QApplication>
51 #include <QColorDialog>
53 #include <QInputDialog>
58 #include <QMessageBox>
62 #include <QStyleOptionGraphicsItem>
63 #include <QWheelEvent>
64 #include <QWidgetAction>
72 const QString GraphGraphicsView::sAssignToGrouping(
"Assign to grouping ");
76 mMinimapEnabled(false), mGridEnabled(true), mGridClustersEnabled(true),
79 mDragModifier(
Qt::KeyboardModifier::AltModifier),
80 mPanModifier(
Qt::KeyboardModifier::ShiftModifier),
81 mZoomModifier(
Qt::NoModifier),
82 mZoomFactorBase(1.0015)
95 void GraphGraphicsView::conditionalUpdate()
126 void GraphGraphicsView::handleIsolationViewAction()
134 if (selected_modules.size() == 1 && selected_gates.empty())
136 u32 module_id = *selected_modules.
begin();
145 UserActionCompound* act =
new UserActionCompound;
146 act->setUseCreatedObject();
149 act->addAction(
new ActionAddItemsToObject(selected_modules, selected_gates));
153 context->setExclusiveModuleId(module_id);
159 UserActionCompound* act =
new UserActionCompound;
160 act->setUseCreatedObject();
162 act->addAction(
new ActionAddItemsToObject(selected_modules, selected_gates));
168 void GraphGraphicsView::adjustMinScale()
175 void GraphGraphicsView::handleAddCommentAction()
180 auto node = action->
data().
value<Node>();
181 CommentDialog commentDialog(
"New Comment");
184 commentDialog.close();
235 #ifdef GUI_DEBUG_GRID
237 debugDrawLayouterGridpos(painter);
240 if (!mMinimapEnabled)
248 #ifdef GUI_DEBUG_GRID
249 void GraphGraphicsView::debugDrawLayouterGridpos(
QPainter* painter)
268 mMovePosition =
event->pos();
273 if (item && itemDraggable(item))
275 mDragController->
set(item,
event->pos());
279 mDragController->
clear();
283 mousePressEventNotItemDrag(
event);
286 mousePressEventNotItemDrag(
event);
289 void GraphGraphicsView::mousePressEventNotItemDrag(
QMouseEvent *event)
309 QPointF delta = mTargetViewportPos -
event->pos();
311 if (qAbs(delta.
x()) > 5 || qAbs(delta.
y()) > 5)
313 mTargetViewportPos =
event->pos();
322 QPoint delta_move =
event->pos() - mMovePosition;
323 mMovePosition =
event->pos();
324 hBar->
setValue(hBar->
value() + (isRightToLeft() ? delta_move.
x() : -delta_move.
x()));
348 #ifdef GUI_DEBUG_GRID
349 debugShowLayouterGridpos(
event->pos());
359 mDragController->
enterDrag(
event->keyboardModifiers() == mDragModifier);
360 event->acceptProposedAction();
372 mDragController->
clear();
375 void GraphGraphicsView::dragPan(
float dpx,
float dpy)
380 int hValue = hBar->
value() + 10*dpx;
381 if (hValue < hBar->minimum()) hBar->
setMinimum(hValue);
388 int vValue = vBar->
value() + 10*dpy;
389 if (vValue < vBar->minimum()) vBar->
setMinimum(vValue);
401 mDragController->
move(
event->pos(),
event->keyboardModifiers() == mDragModifier,snap.first);
409 if (rx < 10) dpx = -10+rx;
410 if (rx > 90) dpx = rx-90;
411 if (ry < 10) dpy = -10+ry;
412 if (ry > 90) dpy = ry-90;
413 if (dpx !=0 || dpy != 0)
422 event->acceptProposedAction();
428 assert(layouter->
done());
439 mDragController->
clear();
446 if (
event->angleDelta().y() != 0)
448 qreal angle =
event->angleDelta().y();
449 qreal factor = qPow(mZoomFactorBase, angle);
457 switch (
event->key())
470 switch (
event->key())
487 void GraphGraphicsView::showContextMenu(
const QPoint& pos)
494 QMenu context_menu(
this);
499 bool isModule =
false;
546 if (isGate || isModule)
548 QMenu* preSucMenu = context_menu.
addMenu(
"Successor/Predecessor …");
549 recursionLevelMenu(preSucMenu->
addMenu(
"Add successors to view …"),
true, &GraphGraphicsView::handleAddSuccessorToView);
551 recursionLevelMenu(preSucMenu->
addMenu(
"Add common successors to view …"),
true, &GraphGraphicsView::handleAddCommonSuccessorToView);
554 action = preSucMenu->
addAction(
"Add path to successor gate to view …");
555 action->
setData(SuccessorGate);
557 action = preSucMenu->
addAction(
"Add path to successor module to view …");
558 action->
setData(SuccessorModule);
561 recursionLevelMenu(preSucMenu->
addMenu(
"Highlight successors …"),
true, &GraphGraphicsView::handleHighlightSuccessor,
true);
562 recursionLevelMenu(preSucMenu->
addMenu(
"Highlight successors by distance …"),
true, &GraphGraphicsView::handleSuccessorDistance);
565 action = preSucMenu->
addAction(
"Highlight path to successor gate …");
566 action->
setData(SuccessorGate);
568 action = preSucMenu->
addAction(
"Highlight path to successor module …");
569 action->
setData(SuccessorModule);
574 recursionLevelMenu(preSucMenu->
addMenu(
"Add predecessors to view …"),
false, &GraphGraphicsView::handleAddPredecessorToView);
576 recursionLevelMenu(preSucMenu->
addMenu(
"Add common predecessors to view …"),
false, &GraphGraphicsView::handleAddCommonPredecessorToView);
579 action = preSucMenu->
addAction(
"Add path to predecessor gate to view …");
580 action->
setData(PredecessorGate);
582 action = preSucMenu->
addAction(
"Add path to predecessor module to view …");
583 action->
setData(PredecessorModule);
586 recursionLevelMenu(preSucMenu->
addMenu(
"Highlight predecessors …"),
false, &GraphGraphicsView::handleHighlightPredecessor,
true);
587 recursionLevelMenu(preSucMenu->
addMenu(
"Highlight predecessors by distance …"),
false, &GraphGraphicsView::handlePredecessorDistance);
590 action = preSucMenu->
addAction(
"Highlight path to predecessor gate …");
591 action->
setData(PredecessorGate);
593 action = preSucMenu->
addAction(
"Highlight path to predecessor module …");
594 action->
setData(PredecessorModule);
599 action = context_menu.addAction(
"Remove selected items from view");
604 action = context_menu.addAction(
"Cancel pick-item mode");
616 if(isGate || isModule)
618 action = context_menu.addAction(
" Fold parent module");
623 action = context_menu.addAction(
" Unfold module");
632 action = context_menu.addAction(
" Fold all parent modules");
634 action = context_menu.addAction(
" Isolate all in new view");
636 action = context_menu.addAction(
" Unfold all selected modules");
639 action = context_menu.addAction(
" Add comment");
641 data.setValue(Node(mItem->
id(), isGate ? Node::NodeType::Gate : Node::NodeType::Module));
648 context_menu.addAction(
"This view:")->setEnabled(
false);
650 action = context_menu.addAction(
" Add module to view");
653 int selectable_modules_count = 0;
654 QSet<u32> not_selectable_modules = getNotSelectableModules();
657 if (!not_selectable_modules.
contains(m->get_id()))
658 selectable_modules_count++;
660 if (selectable_modules_count == 0)
663 action = context_menu.addAction(
" Add gate to view");
665 if (getSelectableGates().empty())
690 void GraphGraphicsView::handlePluginContextContributionTriggered()
694 ContextMenuContribution* cmc =
static_cast<ContextMenuContribution*
>(act->
data().
value<
void*>());
696 Q_ASSERT(cmc->mContributer);
697 cmc->mContributer->execute_function(cmc->mTagname,
gNetlist,
705 void GraphGraphicsView::toggleAntialiasing()
710 bool GraphGraphicsView::itemDraggable(GraphicsItem* item)
718 scale(factor, factor);
728 scale(factor, factor);
732 void GraphGraphicsView::handleCancelPickMode()
737 namespace ShortestPath
763 void GraphGraphicsView::handleAddModuleToView()
765 GraphContext* context = mGraphWidget->
getContext();
834 ModuleDialog module_dialog(getNotSelectableModules(),
"Add module to view",
true,
nullptr,
this);
838 module_to_add.
insert(module_dialog.selectedId());
839 ActionAddItemsToObject* act =
new ActionAddItemsToObject(module_to_add, {});
846 QSet<u32> GraphGraphicsView::getNotSelectableModules()
848 GraphContext* context = mGraphWidget->
getContext();
851 QSet<u32> modules_in_context = context->modules();
852 QSet<u32> gates_in_context = context->gates();
856 bool module_in_context =
false;
859 if (modules_in_context.
contains(submodule->get_id()))
861 module_in_context =
true;
867 if (gates_in_context.
contains(subgate->get_id()))
869 module_in_context =
true;
873 if (module_in_context)
879 not_selectable_modules += modules_in_context;
882 for (
u32 id : modules_in_context)
890 if (!cur_module->is_top_module())
892 direct_par_modules.
insert(cur_module->get_parent_module()->get_id());
896 if (!gates_in_context.
empty())
898 for (
u32 id : gates_in_context)
904 for (
u32 id : direct_par_modules)
906 not_selectable_modules.
insert(
id);
909 while (!tmp_module->is_top_module())
911 Module* par_module = tmp_module->get_parent_module();
912 tmp_module = par_module;
913 not_selectable_modules.
insert(par_module->get_id());
917 return not_selectable_modules;
920 QSet<u32> GraphGraphicsView::getSelectableGates()
922 GraphContext* context = mGraphWidget->
getContext();
924 QSet<u32> not_selectable_gates = context->gates();
925 QSet<u32> modules_in_context = context->modules();
927 for (
u32 module_id : modules_in_context)
931 not_selectable_gates.
insert(gate->get_id());
938 if (!not_selectable_gates.
contains(gate->get_id()))
940 selectable_gates.
insert(gate->get_id());
944 return selectable_gates;
947 void GraphGraphicsView::handleAddGateToView()
949 QSet<u32> selectable_gates = getSelectableGates();
951 GraphContext* context = mGraphWidget->
getContext();
953 GateDialog gate_dialog(selectable_gates,
"Add gate to view",
nullptr,
this);
957 gate_to_add.
insert(gate_dialog.selectedId());
958 ActionAddItemsToObject* act =
new ActionAddItemsToObject({}, gate_to_add);
965 void GraphGraphicsView::handleAddSuccessorToView()
970 addSuccessorToView(level,
true);
973 void GraphGraphicsView::handleAddPredecessorToView()
978 addSuccessorToView(level,
false);
981 void GraphGraphicsView::handleAddCommonSuccessorToView()
986 addCommonSuccessorToView(level,
true);
989 void GraphGraphicsView::handleAddCommonPredecessorToView()
994 addCommonSuccessorToView(level,
false);
997 void GraphGraphicsView::addSuccessorToView(
int maxLevel,
bool succ)
1021 Q_ASSERT(startList.
size());
1023 for (
const Gate* g : startList)
1027 const NodeBox* box = boxes.
boxForNode(startNode);
1029 int xOrigin = box->x();
1030 int yOrigin = box->y();
1031 int xDir = succ ? 1 : -1;
1035 for (
int loop = 0; !maxLevel || loop<maxLevel; loop++)
1040 for (
const Gate* gOrigin : startList)
1044 if (gatsHandled.
contains(g))
continue;
1046 if (boxes.boxForGate(g))
continue;
1051 if (foundList.
isEmpty())
break;
1052 for (
const Gate* g: foundList)
1054 gatsNew.
insert(g->get_id());
1055 QPoint point(xOrigin + (loop+1) * xDir, yOrigin +
y);
1056 y =
y > 0 ? -
y : -
y+1;
1058 if (!boxes.boxForPoint(point))
1062 plc.addGridPosition(nd,point);
1065 startList = foundList;
1068 ActionAddItemsToObject* act =
new ActionAddItemsToObject({}, gatsNew);
1070 act->setPlacementHint(plc);
1075 void GraphGraphicsView::addCommonSuccessorToView(
int maxLevel,
bool succ)
1081 for (
const Gate* g : csp.result())
1083 if (boxes.boxForGate(g))
continue;
1084 gatsNew.
insert(g->get_id());
1086 ActionAddItemsToObject* act =
new ActionAddItemsToObject({}, gatsNew);
1091 void GraphGraphicsView::handleHighlightSuccessor()
1099 void GraphGraphicsView::handleHighlightPredecessor()
1107 void GraphGraphicsView::handleSuccessorDistance()
1115 void GraphGraphicsView::handlePredecessorDistance()
1123 void GraphGraphicsView::handleShortestPathToView()
1129 bool succ = (param == SuccessorModule || param == SuccessorGate);
1130 bool isMod = (param == SuccessorModule || param == PredecessorModule);
1131 std::vector<Gate*> spath;
1133 Q_ASSERT(startGate);
1138 const Module* parMod = startGate->get_module();
1141 excludeModules.
insert(parMod->get_id());
1142 parMod = parMod->get_parent_module();
1145 ModuleDialog md(excludeModules,
"Shortest path to module",
true,
nullptr,
this);
1150 Q_ASSERT(endModule);
1160 selectableGates.
insert(g->get_id());
1164 GateDialog gd(selectableGates,
QString(
"Shortest path %1 gate").arg(succ?
"to":
"from"),
nullptr,
this);
1178 if (spath.empty())
return;
1179 if (!succ) std::reverse(spath.begin(), spath.end());
1182 const NodeBox* originBox = boxes.
boxForGate(startGate);
1183 Q_ASSERT(originBox);
1184 QPoint point(originBox->x(),originBox->y());
1185 QPoint deltaX(succ ? 1 : -1, 0);
1190 for (Gate* g : spath)
1192 if (boxes.boxForGate(g))
continue;
1195 }
while (boxes.boxForPoint(point));
1196 gats.
insert(g->get_id());
1200 plc.addGridPosition(nd,point);
1203 ActionAddItemsToObject* act =
new ActionAddItemsToObject({},gats);
1205 act->setPlacementHint(plc);
1209 void GraphGraphicsView::handleQueryShortestPathModule()
1213 bool succ = send->
data().
toInt() == SuccessorGate;
1218 Module* par = g->get_module();
1221 excludeModules.
insert(par->get_id());
1222 par = par->get_parent_module();
1224 ModuleDialog md(excludeModules,
"Shortest path to module",
true,
nullptr,
this);
1231 void GraphGraphicsView::handleQueryShortestPathGate()
1235 bool succ = send->
data().
toInt() == SuccessorGate;
1239 selectableGates.
insert(g->get_id());
1241 GraphGraphicsViewNeighborSelector* ggvns =
new GraphGraphicsViewNeighborSelector(mItem->
id(), succ,
this);
1242 GateDialog gd(selectableGates,
QString(
"Shortest path %1 gate").arg(succ?
"to":
"from"),ggvns,
this);
1246 u32 targetId = gd.selectedId();
1247 if (!targetId)
return;
1257 std::vector<Gate*> spath;
1261 Q_ASSERT(!nodeTo.
isNull());
1269 spath = forwardDirection ?
1287 Gate* previousGate =
nullptr;
1288 for (
Gate* g : spath)
1292 gats.
insert(g->get_id());
1304 QString(
"Path from '%1'[%2] to %3")
1312 void GraphGraphicsView::handleSelectOutputs()
1322 for (
auto net : gate->get_fan_out_nets())
1324 for (
const auto& suc :
net->get_destinations())
1327 for (
const auto&
id : context->modules())
1330 if (m->contains_gate(suc->get_gate(),
true))
1338 gates.
insert(suc->get_gate()->get_id());
1348 for (
const auto& suc :
net->get_destinations())
1351 for (
const auto&
id : context->modules())
1354 if (m->contains_gate(suc->get_gate(),
true))
1362 gates.
insert(suc->get_gate()->get_id());
1368 gates = context->getLayouter()->boxes().filterNotInView(gates);
1369 ActionAddItemsToObject* act =
new ActionAddItemsToObject({},gates);
1381 void GraphGraphicsView::handleSelectInputs()
1391 for (
auto net : gate->get_fan_in_nets())
1393 if (!
net->get_sources().empty() &&
net->get_sources().at(0)->get_gate() !=
nullptr)
1396 for (
const auto&
id : context->modules())
1399 if (m->contains_gate(
net->get_sources().at(0)->get_gate(),
true))
1407 gates.
insert(
net->get_sources().at(0)->get_gate()->get_id());
1417 if (!
net->get_sources().empty() &&
net->get_sources().at(0)->get_gate() !=
nullptr)
1420 for (
const auto&
id : context->modules())
1423 if (m->contains_gate(
net->get_sources().at(0)->get_gate(),
true))
1431 gates.
insert(
net->get_sources().at(0)->get_gate()->get_id());
1437 gates = context->getLayouter()->boxes().filterNotInView(gates);
1438 ActionAddItemsToObject* act =
new ActionAddItemsToObject({},gates);
1451 void GraphGraphicsView::selectedNodeToItem()
1454 NodeBox* box =
nullptr;
1466 mItem = box->item();
1471 selectedNodeToItem();
1473 handleFoldParentSingle();
1478 selectedNodeToItem();
1480 handleUnfoldSingleAction();
1483 void GraphGraphicsView::handleFoldParentSingle()
1485 const Module* parentModule =
nullptr;
1487 u32 id = mItem->
id();
1509 ActionFoldModule* act =
new ActionFoldModule(parentModule->
get_id());
1510 act->setContextId(context->
id());
1511 act->setPlacementHint(plc);
1515 void GraphGraphicsView::handleUnfoldSingleAction()
1517 GraphContext* context = mGraphWidget->
getContext();
1519 if (m->get_gates().empty() && m->get_submodules().empty())
1522 msg.
setText(
"This module is empty.\nYou can't unfold it.");
1529 ActionUnfoldModule* act =
new ActionUnfoldModule(mItem->
id());
1530 act->setContextId(context->id());
1534 void GraphGraphicsView::handleFoldParentAll()
1536 GraphContext* context = mGraphWidget->
getContext();
1542 if (!context->getLayouter()->boxes().boxForNode(nd))
continue;
1557 for (
const Module* m : modSet)
1558 if (m) modDepth.
insertMulti(m->get_submodule_depth(),m);
1560 if (!modDepth.
empty())
1566 const Module* m = it.value();
1567 ActionFoldModule* act =
new ActionFoldModule(m->get_id());
1568 act->setContextId(context->id());
1576 void GraphGraphicsView::handleUnfoldAllAction()
1581 UserActionCompound* act =
new UserActionCompound;
1584 ActionUnfoldModule* ufo =
new ActionUnfoldModule(
id);
1585 ufo->setContextId(context->id());
1586 act->addAction(ufo);
1589 context->endChange();
1592 #ifdef GUI_DEBUG_GRID
1593 void GraphGraphicsView::debugShowLayouterGridpos(
const QPoint& mouse_pos)
1599 const GraphLayouter* layouter = context->
getLayouter();
1600 if (!(layouter->done()))
1604 QPoint layouter_pos = closestLayouterPos(scene_mouse_pos).first;
1605 m_debug_gridpos = layouter_pos;
1614 const GraphLayouter* layouter = context->getLayouter();
1615 assert(layouter->done());
1617 int default_width = layouter->defaultGridWidth();
1618 int default_height = layouter->defaultGridHeight();
1619 int min_x = layouter->minXIndex();
1620 int min_y = layouter->minYIndex();
1623 LayouterPoint x_point = closestLayouterPoint(scene_pos.
x(), default_width, min_x, x_vals);
1624 LayouterPoint y_point = closestLayouterPoint(scene_pos.
y(), default_height, min_y, y_vals);
1625 return qMakePair(
QPoint(x_point.mIndex, y_point.mIndex),
QPointF(x_point.mPos, y_point.mPos));
1628 GraphGraphicsView::LayouterPoint GraphGraphicsView::closestLayouterPoint(qreal scene_pos,
int default_spacing,
int min_index,
QVector<qreal> sections)
const
1630 int index = min_index;
1632 if (sections.
first() > scene_pos)
1634 int distance = sections.
first() - scene_pos;
1635 int nSections = distance / default_spacing;
1636 index -= (nSections + 1);
1639 else if (sections.
last() <= scene_pos)
1641 int distance = scene_pos - sections.
last();
1642 int nSections = distance / default_spacing;
1643 index += (sections.
size() + nSections -1);
1644 pos = sections.
last() + nSections * default_spacing;
1653 if (scene_pos < *jt)
break;
1676 return mDragModifier;
1686 return mPanModifier;
Adds an item to a module or grouping.
Removes an item from a Module or Grouping.
Set the selection and focus.
GraphTabWidget * getGraphTabWidget()
Get hal's graph tab widget.
GroupingManagerWidget * getGroupingManagerWidget()
ContextManagerWidget * getContextManagerWidget()
void selectViewContext(GraphContext *context)
GraphContext * getCurrentContext()
void handleOpenContextClicked()
GridPlacement * finalGridPlacement() const
void move(const QPoint &eventPos, bool wantSwap, const QPoint &gridPos)
bool hasDragged(const QPoint &eventPos)
void set(GraphicsNode *drgItem, const QPoint &eventPos)
bool isDropAllowed() const
void enterDrag(bool wantSwap)
const std::vector< Net * > & get_fan_in_nets() const
const std::string & get_name() const
Module * get_module() const
const std::vector< Net * > & get_fan_out_nets() const
Logical container for modules, gates, and nets.
const QSet< u32 > & gates() const
const QSet< u32 > & modules() const
GraphLayouter * getLayouter() const
QString nextViewName(const QString &prefix) const
GraphContext * getContextById(u32 id) const
GraphContext * getContextByExclusiveModuleId(u32 module_id) const
static SettingsItemCheckbox * sSettingPanOnMiddleButton
A view to display the rendered graph (needs a GraphicsScene).
void handleRemoveFromView()
void keyPressEvent(QKeyEvent *event) override
void dragLeaveEvent(QDragLeaveEvent *event) override
void setGridType(GraphicsScene::GridType gridType)
void dropEvent(QDropEvent *event) override
void wheelEvent(QWheelEvent *event) override
void setPanModifier(Qt::KeyboardModifier panModifier)
Qt::KeyboardModifier panModifier()
void keyReleaseEvent(QKeyEvent *event) override
void viewportCenterZoom(const qreal factor)
void handleShortestPathToGrouping(u32 idFrom, Node nodeTo, bool forwardDirection)
void setDragModifier(Qt::KeyboardModifier dragModifier)
GraphGraphicsView(GraphWidget *parent)
void paintEvent(QPaintEvent *event) override
void moduleDoubleClicked(u32 id)
void mouseMoveEvent(QMouseEvent *event) override
Qt::KeyboardModifier dragModifier()
void resizeEvent(QResizeEvent *event) override
void handleFoldModuleShortcut()
GraphicsScene::GridType gridType()
void dragEnterEvent(QDragEnterEvent *event) override
void mouseDoubleClickEvent(QMouseEvent *event) override
void mouseReleaseEvent(QMouseEvent *event) override
void mousePressEvent(QMouseEvent *event) override
void handleUnfoldModuleShortcut()
void drawForeground(QPainter *painter, const QRectF &rect) override
void gentleZoom(const qreal factor)
void dragMoveEvent(QDragMoveEvent *event) override
void handleGatesPicked(const QSet< u32 > &gats) override
Base class for all specific layouters.
const NodeBoxes & boxes() const
Superclass for all graphic items used ins the GraphicsScene. It contains information about the underl...
static void setLod(const qreal lod)
ItemType itemType() const
Abstract base class for nodes (e.g. gates, modules)
Container for a GraphGraphicsView containing gates, nets, and modules.
static void setLod(const qreal &lod)
void setMousePressed(bool isPressed)
static void setGridEnabled(const bool &value)
static void setGridType(const GridType &gridType)
static void setGridClustersEnabled(const bool &value)
static void addPluginSubmenus(QMenu *contextMenu, Netlist *netlist, const std::vector< u32 > &modules, const std::vector< u32 > &gates, const std::vector< u32 > &nets)
Module * get_parent_module() const
const std::vector< Gate * > & get_gates() const
std::string get_name() const
const std::unordered_set< Net * > & get_input_nets() const
std::vector< Module * > get_submodules(const std::function< bool(Module *)> &filter=nullptr, bool recursive=false) const
const std::unordered_set< Net * > & get_output_nets() const
const std::vector< Gate * > & get_gates() const
Gate * get_gate_by_id(const u32 gate_id) const
const std::vector< Module * > & get_modules() const
Module * get_module_by_id(u32 module_id) const
The NodeBoxes class owns all NodeBox'es from hal view.
NodeBox * boxForNode(const Node &n) const
boxForNode find NodeBox by node
NodeBox * boxForGate(const Gate *g) const
boxForGate find NodeBox by Gate pointer.
static void setLod(const qreal lod)
The Node class object represents a module or a gate.
NodeType type() const
type getter for type information
bool isGate() const
isGate test whether node is a gate
bool isNull() const
isNull test for null-Node object typically returned from functions
u32 id() const
id getter for ID information
PythonThread * pythonThread() const
int numberSelectedGates() const
int numberSelectedItems() const
bool containsGate(u32 id) const
void setFocus(ItemType ftype, u32 fid, Subfocus sfoc=Subfocus::None, u32 sfinx=0)
const QSet< u32 > & selectedNets() const
void relaySelectionChanged(void *sender)
QList< Node > selectedNodesList() const
QList< u32 > selectedModulesList() const
const QSet< u32 > & selectedGates() const
const QSet< u32 > & selectedModules() const
std::vector< u32 > selectedGatesVector() const
int numberSelectedModules() const
bool containsModule(u32 id) const
std::vector< u32 > selectedNetsVector() const
bool containsNet(u32 id) const
QList< u32 > selectedGatesList() const
std::vector< u32 > selectedModulesVector() const
void subfocusChanged(void *sender)
int numberSelectedNodes() const
static void updateAlpha()
virtual QVariant value() const override
static void updateAlpha()
static void updateAlpha()
static void updateAlpha()
void addAction(UserAction *act)
void setUseCreatedObject()
virtual void setObject(const UserActionObject &obj)
void setObjectLock(bool lock)
The UserActionObject class represents a single object used in UserAction.
ItemType
The ItemType enum provides the enum type to classify graphic items into Modules, Gates or Nets....
const Module * module(const Gate *g, const NodeBoxes &boxes)
const Net * net(const Gate *g0, const Gate *g1)
std::vector< Gate * > get_next_gates(const Gate *gate, bool get_successors, int depth=0, const std::function< bool(const Gate *)> &filter=nullptr)
std::vector< Gate * > get_shortest_path(Gate *start_gate, Gate *end_gate, bool search_both_directions=false)
PythonContext * gPythonContext
ContentManager * gContentManager
GraphContextManager * gGraphContextManager
SelectionRelay * gSelectionRelay
CommentManager * gCommentManager
QVariant data() const const
void setData(const QVariant &userData)
void triggered(bool checked)
Qt::DropAction exec(Qt::DropActions supportedActions)
void setMimeData(QMimeData *data)
void setPixmap(const QPixmap &pixmap)
void centerOn(const QPointF &pos)
virtual void dropEvent(QDropEvent *event) override
virtual bool event(QEvent *event) override
QGraphicsItem * itemAt(const QPoint &pos) const const
QPoint mapFromScene(const QPointF &point) const const
QPointF mapToScene(const QPoint &point) const const
virtual void mouseMoveEvent(QMouseEvent *event) override
virtual void mousePressEvent(QMouseEvent *event) override
virtual void mouseReleaseEvent(QMouseEvent *event) override
void setOptimizationFlags(QGraphicsView::OptimizationFlags flags)
virtual void paintEvent(QPaintEvent *event) override
virtual void resizeEvent(QResizeEvent *event) override
void scale(qreal sx, qreal sy)
QGraphicsScene * scene() const const
void setRenderHint(QPainter::RenderHint hint, bool enabled)
void setViewportUpdateMode(QGraphicsView::ViewportUpdateMode mode)
Qt::KeyboardModifiers keyboardModifiers()
void append(const T &value)
const T & at(int i) const const
bool isEmpty() const const
QMap::iterator insertMulti(const Key &key, const T &value)
QMap::const_iterator constBegin() const const
QMap::const_iterator constEnd() const const
virtual int exec() override
void setWindowTitle(const QString &title)
void setText(const QString &text)
void setData(const QString &mimeType, const QByteArray &data)
QMetaObject::Connection connect(const QObject *sender, const char *signal, const QObject *receiver, const char *method, Qt::ConnectionType type)
QObject * parent() const const
QObject * sender() const const
void drawText(const QPointF &position, const QString &text)
void fillRect(const QRectF &rectangle, const QBrush &brush)
void setPen(const QColor &color)
void fill(const QColor &color)
QPoint toPoint() const const
QSet::const_iterator constBegin() const const
bool contains(const T &value) const const
QSet::iterator insert(const T &value)
bool isEmpty() const const
QString arg(qlonglong a, int fieldWidth, int base, QChar fillChar) const const
QString fromStdString(const std::string &str)
QString number(int n, int base)
bool toBool() const const
int toInt(bool *ok) const const
QVector::const_iterator constBegin() const const
QVector::const_iterator constEnd() const const