52 #include <QApplication>
53 #include <QColorDialog>
55 #include <QInputDialog>
60 #include <QMessageBox>
63 #include <QStyleOptionGraphicsItem>
64 #include <QWheelEvent>
65 #include <QWidgetAction>
73 const QString GraphGraphicsView::sAssignToGrouping(
"Assign to grouping ");
77 mMinimapEnabled(false), mGridEnabled(true), mGridClustersEnabled(true),
80 mDragModifier(
Qt::KeyboardModifier::AltModifier),
81 mPanModifier(
Qt::KeyboardModifier::ShiftModifier),
82 mZoomModifier(
Qt::NoModifier),
83 mZoomFactorBase(1.0015)
96 void GraphGraphicsView::conditionalUpdate()
127 void GraphGraphicsView::handleIsolationViewAction()
135 if (selected_modules.size() == 1 && selected_gates.empty())
137 u32 module_id = *selected_modules.
begin();
146 UserActionCompound* act =
new UserActionCompound;
147 act->setUseCreatedObject();
150 act->addAction(
new ActionAddItemsToObject(selected_modules, selected_gates));
154 context->setExclusiveModuleId(module_id);
160 UserActionCompound* act =
new UserActionCompound;
161 act->setUseCreatedObject();
163 act->addAction(
new ActionAddItemsToObject(selected_modules, selected_gates));
169 void GraphGraphicsView::adjustMinScale()
176 void GraphGraphicsView::handleAddCommentAction()
181 auto node =
action->data().value<Node>();
182 CommentDialog commentDialog(
"New Comment");
185 commentDialog.close();
236 #ifdef GUI_DEBUG_GRID
238 debugDrawLayouterGridpos(painter);
241 if (!mMinimapEnabled)
249 #ifdef GUI_DEBUG_GRID
250 void GraphGraphicsView::debugDrawLayouterGridpos(
QPainter* painter)
269 mMovePosition =
event->pos();
274 if (item && itemDraggable(item))
276 mDragController->
set(item,
event->pos());
280 mDragController->
clear();
284 mousePressEventNotItemDrag(
event);
287 mousePressEventNotItemDrag(
event);
290 void GraphGraphicsView::mousePressEventNotItemDrag(
QMouseEvent *event)
310 QPointF delta = mTargetViewportPos -
event->pos();
312 if (qAbs(delta.
x()) > 5 || qAbs(delta.
y()) > 5)
314 mTargetViewportPos =
event->pos();
323 QPoint delta_move =
event->pos() - mMovePosition;
324 mMovePosition =
event->pos();
325 hBar->
setValue(hBar->
value() + (isRightToLeft() ? delta_move.
x() : -delta_move.
x()));
344 #ifdef GUI_DEBUG_GRID
345 debugShowLayouterGridpos(
event->pos());
355 mDragController->
enterDrag(
event->keyboardModifiers() == mDragModifier);
356 event->acceptProposedAction();
368 mDragController->
clear();
371 void GraphGraphicsView::dragPan(
float dpx,
float dpy)
376 int hValue = hBar->
value() + 10*dpx;
377 if (hValue < hBar->minimum()) hBar->
setMinimum(hValue);
384 int vValue = vBar->
value() + 10*dpy;
385 if (vValue < vBar->minimum()) vBar->
setMinimum(vValue);
397 mDragController->
move(
event->pos(),
event->keyboardModifiers() == mDragModifier,snap.first);
405 if (rx < 10) dpx = -10+rx;
406 if (rx > 90) dpx = rx-90;
407 if (ry < 10) dpy = -10+ry;
408 if (ry > 90) dpy = ry-90;
409 if (dpx !=0 || dpy != 0)
418 event->acceptProposedAction();
424 assert(layouter->
done());
435 mDragController->
clear();
444 qreal angle =
event->angleDelta().y();
445 qreal factor = qPow(mZoomFactorBase, angle);
453 switch (
event->key())
466 switch (
event->key())
483 void GraphGraphicsView::showContextMenu(
const QPoint& pos)
490 QMenu context_menu(
this);
495 bool isModule =
false;
542 if (isGate || isModule)
544 QMenu* preSucMenu = context_menu.
addMenu(
"Successor/Predecessor …");
545 recursionLevelMenu(preSucMenu->
addMenu(
"Add successors to view …"),
true, &GraphGraphicsView::handleAddSuccessorToView);
547 recursionLevelMenu(preSucMenu->
addMenu(
"Add common successors to view …"),
true, &GraphGraphicsView::handleAddCommonSuccessorToView);
550 action = preSucMenu->
addAction(
"Add path to successor gate to view …");
551 action->setData(SuccessorGate);
553 action = preSucMenu->
addAction(
"Add path to successor module to view …");
554 action->setData(SuccessorModule);
557 recursionLevelMenu(preSucMenu->
addMenu(
"Highlight successors …"),
true, &GraphGraphicsView::handleHighlightSuccessor,
true);
558 recursionLevelMenu(preSucMenu->
addMenu(
"Highlight successors by distance …"),
true, &GraphGraphicsView::handleSuccessorDistance);
561 action = preSucMenu->
addAction(
"Highlight path to successor gate …");
562 action->setData(SuccessorGate);
564 action = preSucMenu->
addAction(
"Highlight path to successor module …");
565 action->setData(SuccessorModule);
570 recursionLevelMenu(preSucMenu->
addMenu(
"Add predecessors to view …"),
false, &GraphGraphicsView::handleAddPredecessorToView);
572 recursionLevelMenu(preSucMenu->
addMenu(
"Add common predecessors to view …"),
false, &GraphGraphicsView::handleAddCommonPredecessorToView);
575 action = preSucMenu->
addAction(
"Add path to predecessor gate to view …");
576 action->setData(PredecessorGate);
579 recursionLevelMenu(preSucMenu->
addMenu(
"Highlight predecessors …"),
false, &GraphGraphicsView::handleHighlightPredecessor,
true);
580 recursionLevelMenu(preSucMenu->
addMenu(
"Highlight predecessors by distance …"),
false, &GraphGraphicsView::handlePredecessorDistance);
583 action = preSucMenu->
addAction(
"Highlight path to predecessor gate …");
584 action->setData(PredecessorGate);
589 action = context_menu.addAction(
"Remove selected items from view");
594 action = context_menu.addAction(
"Cancel pick-item mode");
606 if(isGate || isModule)
608 action = context_menu.addAction(
" Fold parent module");
613 action = context_menu.addAction(
" Unfold module");
622 action = context_menu.addAction(
" Fold all parent modules");
624 action = context_menu.addAction(
" Isolate all in new view");
626 action = context_menu.addAction(
" Unfold all selected modules");
629 action = context_menu.addAction(
" Add comment");
631 data.setValue(Node(mItem->
id(), isGate ? Node::NodeType::Gate : Node::NodeType::Module));
638 context_menu.addAction(
"This view:")->setEnabled(
false);
640 action = context_menu.addAction(
" Add module to view");
643 int selectable_modules_count = 0;
644 QSet<u32> not_selectable_modules = getNotSelectableModules();
647 if (!not_selectable_modules.
contains(m->get_id()))
648 selectable_modules_count++;
650 if (selectable_modules_count == 0)
651 action->setDisabled(
true);
653 action = context_menu.addAction(
" Add gate to view");
655 if (getSelectableGates().empty())
656 action->setDisabled(
true);
680 void GraphGraphicsView::handlePluginContextContributionTriggered()
684 ContextMenuContribution* cmc =
static_cast<ContextMenuContribution*
>(act->
data().
value<
void*>());
686 Q_ASSERT(cmc->mContributer);
687 cmc->mContributer->execute_function(cmc->mTagname,
gNetlist,
695 void GraphGraphicsView::updateMatrix(
const int delta)
697 qreal
scale = qPow(2.0, delta / 100.0);
704 void GraphGraphicsView::toggleAntialiasing()
709 bool GraphGraphicsView::itemDraggable(GraphicsItem* item)
717 scale(factor, factor);
727 scale(factor, factor);
731 void GraphGraphicsView::handleCancelPickMode()
736 namespace ShortestPath
749 const Module* parent =
g->get_module();
762 void GraphGraphicsView::handleAddModuleToView()
764 GraphContext* context = mGraphWidget->
getContext();
833 ModuleDialog module_dialog(getNotSelectableModules(),
"Add module to view",
true,
nullptr,
this);
837 module_to_add.
insert(module_dialog.selectedId());
838 ActionAddItemsToObject* act =
new ActionAddItemsToObject(module_to_add, {});
845 QSet<u32> GraphGraphicsView::getNotSelectableModules()
847 GraphContext* context = mGraphWidget->
getContext();
850 QSet<u32> modules_in_context = context->modules();
851 QSet<u32> gates_in_context = context->gates();
855 bool module_in_context =
false;
858 if (modules_in_context.
contains(submodule->get_id()))
860 module_in_context =
true;
866 if (gates_in_context.
contains(subgate->get_id()))
868 module_in_context =
true;
872 if (module_in_context)
878 not_selectable_modules += modules_in_context;
881 for (
u32 id : modules_in_context)
889 if (!cur_module->is_top_module())
891 direct_par_modules.
insert(cur_module->get_parent_module()->get_id());
895 if (!gates_in_context.
empty())
897 for (
u32 id : gates_in_context)
903 for (
u32 id : direct_par_modules)
905 not_selectable_modules.
insert(
id);
908 while (!tmp_module->is_top_module())
910 Module* par_module = tmp_module->get_parent_module();
911 tmp_module = par_module;
912 not_selectable_modules.
insert(par_module->get_id());
916 return not_selectable_modules;
919 QSet<u32> GraphGraphicsView::getSelectableGates()
921 GraphContext* context = mGraphWidget->
getContext();
923 QSet<u32> not_selectable_gates = context->gates();
924 QSet<u32> modules_in_context = context->modules();
926 for (
u32 module_id : modules_in_context)
930 not_selectable_gates.
insert(gate->get_id());
937 if (!not_selectable_gates.
contains(gate->get_id()))
939 selectable_gates.
insert(gate->get_id());
943 return selectable_gates;
946 void GraphGraphicsView::handleAddGateToView()
948 QSet<u32> selectable_gates = getSelectableGates();
950 GraphContext* context = mGraphWidget->
getContext();
952 GateDialog gate_dialog(selectable_gates,
"Add gate to view",
nullptr,
this);
956 gate_to_add.
insert(gate_dialog.selectedId());
957 ActionAddItemsToObject* act =
new ActionAddItemsToObject({}, gate_to_add);
964 void GraphGraphicsView::handleAddSuccessorToView()
969 addSuccessorToView(level,
true);
972 void GraphGraphicsView::handleAddPredecessorToView()
977 addSuccessorToView(level,
false);
980 void GraphGraphicsView::handleAddCommonSuccessorToView()
985 addCommonSuccessorToView(level,
true);
988 void GraphGraphicsView::handleAddCommonPredecessorToView()
993 addCommonSuccessorToView(level,
false);
996 void GraphGraphicsView::addSuccessorToView(
int maxLevel,
bool succ)
1020 Q_ASSERT(startList.
size());
1022 for (
const Gate*
g : startList)
1026 const NodeBox* box = boxes.
boxForNode(startNode);
1028 int xOrigin = box->x();
1029 int yOrigin = box->y();
1030 int xDir = succ ? 1 : -1;
1034 for (
int loop = 0; !maxLevel || loop<maxLevel; loop++)
1039 for (
const Gate* gOrigin : startList)
1045 if (boxes.boxForGate(
g))
continue;
1050 if (foundList.
isEmpty())
break;
1051 for (
const Gate*
g: foundList)
1054 QPoint point(xOrigin + (loop+1) * xDir, yOrigin +
y);
1055 y =
y > 0 ? -
y : -
y+1;
1057 if (!boxes.boxForPoint(point))
1061 plc.addGridPosition(nd,point);
1064 startList = foundList;
1067 ActionAddItemsToObject* act =
new ActionAddItemsToObject({}, gatsNew);
1069 act->setPlacementHint(plc);
1074 void GraphGraphicsView::addCommonSuccessorToView(
int maxLevel,
bool succ)
1080 for (
const Gate*
g : csp.result())
1082 if (boxes.boxForGate(
g))
continue;
1085 ActionAddItemsToObject* act =
new ActionAddItemsToObject({}, gatsNew);
1090 void GraphGraphicsView::handleHighlightSuccessor()
1098 void GraphGraphicsView::handleHighlightPredecessor()
1106 void GraphGraphicsView::handleSuccessorDistance()
1114 void GraphGraphicsView::handlePredecessorDistance()
1122 void GraphGraphicsView::handleShortestModulePathToView()
1127 void GraphGraphicsView::handleShortestPathToView()
1133 std::vector<Gate*> spath;
1135 Q_ASSERT(startGate);
1137 if (send->
data().
toInt() == SuccessorModule)
1140 const Module* parMod = startGate->get_module();
1143 excludeModules.
insert(parMod->get_id());
1144 parMod = parMod->get_parent_module();
1147 ModuleDialog md(excludeModules,
"Shortest path to module",
true,
nullptr,
this);
1152 Q_ASSERT(endModule);
1158 succ = (send->
data().
toInt() == SuccessorGate);
1164 selectableGates.
insert(
g->get_id());
1168 GateDialog gd(selectableGates,
QString(
"Shortest path %1 gate").arg(succ?
"to":
"from"),
nullptr,
this);
1180 std::reverse(spath.begin(), spath.end());
1183 if (spath.empty())
return;
1184 auto it = spath.begin() + 1;
1186 const NodeBox* lastBox = boxes.
boxForGate(startGate);
1188 QPoint point(lastBox->x(),lastBox->y());
1189 QPoint deltaX(succ ? 1 : -1, 0);
1194 while (it != spath.end())
1198 if (boxes.boxForGate(
g))
continue;
1201 if (!boxes.boxForPoint(point))
1205 plc.addGridPosition(nd,point);
1210 ActionAddItemsToObject* act =
new ActionAddItemsToObject({},gats);
1212 act->setPlacementHint(plc);
1216 void GraphGraphicsView::handleQueryShortestPathModule()
1224 Module* par =
g->get_module();
1227 excludeModules.
insert(par->get_id());
1228 par = par->get_parent_module();
1230 ModuleDialog md(excludeModules,
"Shortest path to module",
true,
nullptr,
this);
1237 void GraphGraphicsView::handleQueryShortestPathGate()
1241 bool succ = send->
data().
toInt() == SuccessorGate;
1245 selectableGates.
insert(
g->get_id());
1247 GraphGraphicsViewNeighborSelector* ggvns =
new GraphGraphicsViewNeighborSelector(mItem->
id(), succ,
this);
1248 GateDialog gd(selectableGates,
QString(
"Shortest path %1 gate").arg(succ?
"to":
"from"),ggvns,
this);
1252 u32 targetId = gd.selectedId();
1253 if (!targetId)
return;
1263 std::vector<Gate*> spath;
1267 Q_ASSERT(!nodeTo.
isNull());
1291 Gate* previousGate =
nullptr;
1292 for (
Gate*
g : spath)
1308 QString(
"Path from '%1'[%2] to %3")
1316 void GraphGraphicsView::handleSelectOutputs()
1326 for (
auto net : gate->get_fan_out_nets())
1328 for (
const auto& suc :
net->get_destinations())
1331 for (
const auto&
id : context->modules())
1334 if (m->contains_gate(suc->get_gate(),
true))
1342 gates.
insert(suc->get_gate()->get_id());
1352 for (
const auto& suc :
net->get_destinations())
1355 for (
const auto&
id : context->modules())
1358 if (m->contains_gate(suc->get_gate(),
true))
1366 gates.
insert(suc->get_gate()->get_id());
1372 gates = context->getLayouter()->boxes().filterNotInView(gates);
1373 ActionAddItemsToObject* act =
new ActionAddItemsToObject({},gates);
1385 void GraphGraphicsView::handleSelectInputs()
1395 for (
auto net : gate->get_fan_in_nets())
1397 if (!
net->get_sources().empty() &&
net->get_sources().at(0)->get_gate() !=
nullptr)
1400 for (
const auto&
id : context->modules())
1403 if (m->contains_gate(
net->get_sources().at(0)->get_gate(),
true))
1411 gates.
insert(
net->get_sources().at(0)->get_gate()->get_id());
1421 if (!
net->get_sources().empty() &&
net->get_sources().at(0)->get_gate() !=
nullptr)
1424 for (
const auto&
id : context->modules())
1427 if (m->contains_gate(
net->get_sources().at(0)->get_gate(),
true))
1435 gates.
insert(
net->get_sources().at(0)->get_gate()->get_id());
1441 gates = context->getLayouter()->boxes().filterNotInView(gates);
1442 ActionAddItemsToObject* act =
new ActionAddItemsToObject({},gates);
1455 void GraphGraphicsView::selectedNodeToItem()
1458 NodeBox* box =
nullptr;
1470 mItem = box->item();
1475 selectedNodeToItem();
1477 handleFoldParentSingle();
1482 selectedNodeToItem();
1484 handleUnfoldSingleAction();
1487 void GraphGraphicsView::handleFoldParentSingle()
1489 const Module* parentModule =
nullptr;
1491 u32 id = mItem->
id();
1513 ActionFoldModule* act =
new ActionFoldModule(parentModule->
get_id());
1514 act->setContextId(context->
id());
1515 act->setPlacementHint(plc);
1519 void GraphGraphicsView::handleUnfoldSingleAction()
1521 GraphContext* context = mGraphWidget->
getContext();
1523 if (m->get_gates().empty() && m->get_submodules().empty())
1526 msg.
setText(
"This module is empty.\nYou can't unfold it.");
1533 ActionUnfoldModule* act =
new ActionUnfoldModule(mItem->
id());
1534 act->setContextId(context->id());
1538 void GraphGraphicsView::handleFoldParentAll()
1540 GraphContext* context = mGraphWidget->
getContext();
1546 if (!context->getLayouter()->boxes().boxForNode(nd))
continue;
1561 for (
const Module* m : modSet)
1562 if (m) modDepth.
insertMulti(m->get_submodule_depth(),m);
1566 while (it.hasPrevious())
1569 const Module* m = it.value();
1570 ActionFoldModule* act =
new ActionFoldModule(m->get_id());
1571 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);
1637 pos = sections.
first() + index * default_spacing;
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;
1660 return LayouterPoint{index,
pos};
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 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 handleShortestPath(u32 idFrom, Node nodeTo)
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
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_shortest_path(Gate *start_gate, Module *end_module)
std::vector< Gate * > get_next_gates(const Gate *gate, bool get_successors, int depth, const std::function< bool(const Gate *)> &filter)
PythonContext * gPythonContext
ContentManager * gContentManager
GraphContextManager * gGraphContextManager
SelectionRelay * gSelectionRelay
CommentManager * gCommentManager
QVariant data() const const
void triggered(bool checked)
Qt::DropAction exec(Qt::DropActions supportedActions)
void setMimeData(QMimeData *data)
QMatrix matrix() const const
void setMatrix(const QMatrix &matrix, bool combine)
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)
QMatrix & scale(qreal sx, qreal sy)
virtual int exec() override
void setWindowTitle(const QString &title)
void setText(const QString &text)
void setText(const QString &text)
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)
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