![]() |
HAL
|
Container for a GraphGraphicsView containing gates, nets, and modules. More...
#include <graphics_scene.h>
Public Types | |
enum | GridType { None , Dots , Lines } |
![]() | |
enum | ItemIndexMethod |
enum | SceneLayer |
Public Slots | |
void | handleInternSelectionChanged () |
void | handleExternSelectionChanged (void *sender) |
void | handleExternSubfocusChanged (void *sender) |
void | handleHighlight (const QVector< const ModuleItem * > &highlightItems) |
void | handleGroupingAssignModule (Grouping *grp, u32 id) |
void | handleGroupingAssignGate (Grouping *grp, u32 id) |
void | handleGroupingAssignNet (Grouping *grp, u32 id) |
void | handleGroupingColorChanged (Grouping *grp) |
void | updateAllItems () |
void | setDragController (DragController *dc) |
Public Member Functions | |
Q_ENUM (GridType) | |
GraphicsScene (QObject *parent=nullptr) | |
~GraphicsScene () | |
QPointF | dropTarget () |
void | addGraphItem (GraphicsItem *item) |
void | removeGraphItem (GraphicsItem *item) |
void | deleteAllItems () |
void | connectAll () |
void | disconnectAll () |
void | updateVisuals (const GraphShader::Shading &s) |
void | moveNetsToBackground () |
const GraphicsGate * | getGateItem (const u32 id) const |
const GraphicsNet * | getNetItem (const u32 id) const |
const GraphicsModule * | getModuleItem (const u32 id) const |
void | setMousePressed (bool isPressed) |
![]() | |
QGraphicsScene (QObject *parent) | |
QGraphicsScene (const QRectF &sceneRect, QObject *parent) | |
QGraphicsScene (qreal x, qreal y, qreal width, qreal height, QObject *parent) | |
virtual | ~QGraphicsScene () |
QRectF | sceneRect () const const |
qreal | width () const const |
qreal | height () const const |
void | setSceneRect (const QRectF &rect) |
void | setSceneRect (qreal x, qreal y, qreal w, qreal h) |
void | render (QPainter *painter, const QRectF &target, const QRectF &source, Qt::AspectRatioMode aspectRatioMode) |
QGraphicsScene::ItemIndexMethod | itemIndexMethod () const const |
void | setItemIndexMethod (QGraphicsScene::ItemIndexMethod method) |
bool | isSortCacheEnabled () const const |
void | setSortCacheEnabled (bool enabled) |
int | bspTreeDepth () const const |
void | setBspTreeDepth (int depth) |
QRectF | itemsBoundingRect () const const |
QList< QGraphicsItem * > | items (Qt::SortOrder order) const const |
QList< QGraphicsItem * > | items (const QPointF &pos, Qt::ItemSelectionMode mode, Qt::SortOrder order, const QTransform &deviceTransform) const const |
QList< QGraphicsItem * > | items (const QRectF &rect, Qt::ItemSelectionMode mode, Qt::SortOrder order, const QTransform &deviceTransform) const const |
QList< QGraphicsItem * > | items (const QPolygonF &polygon, Qt::ItemSelectionMode mode, Qt::SortOrder order, const QTransform &deviceTransform) const const |
QList< QGraphicsItem * > | items (const QPainterPath &path, Qt::ItemSelectionMode mode, Qt::SortOrder order, const QTransform &deviceTransform) const const |
QList< QGraphicsItem * > | collidingItems (const QGraphicsItem *item, Qt::ItemSelectionMode mode) const const |
QGraphicsItem * | itemAt (const QPointF &position) const const |
QGraphicsItem * | itemAt (const QPointF &position, const QTransform &deviceTransform) const const |
QList< QGraphicsItem * > | items (qreal x, qreal y, qreal w, qreal h, Qt::ItemSelectionMode mode) const const |
QList< QGraphicsItem * > | items (qreal x, qreal y, qreal w, qreal h, Qt::ItemSelectionMode mode, Qt::SortOrder order, const QTransform &deviceTransform) const const |
QGraphicsItem * | itemAt (qreal x, qreal y) const const |
QGraphicsItem * | itemAt (qreal x, qreal y, const QTransform &deviceTransform) const const |
QList< QGraphicsItem * > | selectedItems () const const |
QPainterPath | selectionArea () const const |
void | setSelectionArea (const QPainterPath &path, const QTransform &deviceTransform) |
void | setSelectionArea (const QPainterPath &path, Qt::ItemSelectionMode mode, const QTransform &deviceTransform) |
void | setSelectionArea (const QPainterPath &path, Qt::ItemSelectionOperation selectionOperation, Qt::ItemSelectionMode mode, const QTransform &deviceTransform) |
QGraphicsItemGroup * | createItemGroup (const QList< QGraphicsItem * > &items) |
void | destroyItemGroup (QGraphicsItemGroup *group) |
void | addItem (QGraphicsItem *item) |
QGraphicsEllipseItem * | addEllipse (const QRectF &rect, const QPen &pen, const QBrush &brush) |
QGraphicsLineItem * | addLine (const QLineF &line, const QPen &pen) |
QGraphicsPathItem * | addPath (const QPainterPath &path, const QPen &pen, const QBrush &brush) |
QGraphicsPixmapItem * | addPixmap (const QPixmap &pixmap) |
QGraphicsPolygonItem * | addPolygon (const QPolygonF &polygon, const QPen &pen, const QBrush &brush) |
QGraphicsRectItem * | addRect (const QRectF &rect, const QPen &pen, const QBrush &brush) |
QGraphicsTextItem * | addText (const QString &text, const QFont &font) |
QGraphicsSimpleTextItem * | addSimpleText (const QString &text, const QFont &font) |
QGraphicsProxyWidget * | addWidget (QWidget *widget, Qt::WindowFlags wFlags) |
QGraphicsEllipseItem * | addEllipse (qreal x, qreal y, qreal w, qreal h, const QPen &pen, const QBrush &brush) |
QGraphicsLineItem * | addLine (qreal x1, qreal y1, qreal x2, qreal y2, const QPen &pen) |
QGraphicsRectItem * | addRect (qreal x, qreal y, qreal w, qreal h, const QPen &pen, const QBrush &brush) |
void | removeItem (QGraphicsItem *item) |
QGraphicsItem * | focusItem () const const |
void | setFocusItem (QGraphicsItem *item, Qt::FocusReason focusReason) |
bool | hasFocus () const const |
void | setFocus (Qt::FocusReason focusReason) |
void | clearFocus () |
void | setStickyFocus (bool enabled) |
bool | stickyFocus () const const |
QGraphicsItem * | mouseGrabberItem () const const |
QBrush | backgroundBrush () const const |
void | setBackgroundBrush (const QBrush &brush) |
QBrush | foregroundBrush () const const |
void | setForegroundBrush (const QBrush &brush) |
virtual QVariant | inputMethodQuery (Qt::InputMethodQuery query) const const |
QList< QGraphicsView * > | views () const const |
void | update (qreal x, qreal y, qreal w, qreal h) |
void | invalidate (qreal x, qreal y, qreal w, qreal h, QGraphicsScene::SceneLayers layers) |
QStyle * | style () const const |
void | setStyle (QStyle *style) |
QFont | font () const const |
void | setFont (const QFont &font) |
QPalette | palette () const const |
void | setPalette (const QPalette &palette) |
bool | isActive () const const |
QGraphicsItem * | activePanel () const const |
void | setActivePanel (QGraphicsItem *item) |
QGraphicsWidget * | activeWindow () const const |
void | setActiveWindow (QGraphicsWidget *widget) |
bool | sendEvent (QGraphicsItem *item, QEvent *event) |
qreal | minimumRenderSize () const const |
void | setMinimumRenderSize (qreal minSize) |
bool | focusOnTouch () const const |
void | setFocusOnTouch (bool enabled) |
void | update (const QRectF &rect) |
void | invalidate (const QRectF &rect, QGraphicsScene::SceneLayers layers) |
void | advance () |
void | clearSelection () |
void | clear () |
void | changed (const QList< QRectF > ®ion) |
void | sceneRectChanged (const QRectF &rect) |
void | selectionChanged () |
void | focusItemChanged (QGraphicsItem *newFocusItem, QGraphicsItem *oldFocusItem, Qt::FocusReason reason) |
![]() | |
virtual const QMetaObject * | metaObject () const const |
QObject (QObject *parent) | |
virtual | ~QObject () |
QString | objectName () const const |
void | setObjectName (const QString &name) |
bool | isWidgetType () const const |
bool | isWindowType () const const |
bool | signalsBlocked () const const |
bool | blockSignals (bool block) |
QThread * | thread () const const |
void | moveToThread (QThread *targetThread) |
int | startTimer (int interval, Qt::TimerType timerType) |
int | startTimer (std::chrono::milliseconds time, Qt::TimerType timerType) |
void | killTimer (int id) |
T | findChild (const QString &name, Qt::FindChildOptions options) const const |
QList< T > | findChildren (const QString &name, Qt::FindChildOptions options) const const |
QList< T > | findChildren (const QRegExp ®Exp, Qt::FindChildOptions options) const const |
QList< T > | findChildren (const QRegularExpression &re, Qt::FindChildOptions options) const const |
const QObjectList & | children () const const |
void | setParent (QObject *parent) |
void | installEventFilter (QObject *filterObj) |
void | removeEventFilter (QObject *obj) |
QMetaObject::Connection | connect (const QObject *sender, const char *signal, const char *method, Qt::ConnectionType type) const const |
bool | disconnect (const char *signal, const QObject *receiver, const char *method) const const |
bool | disconnect (const QObject *receiver, const char *method) const const |
void | dumpObjectTree () |
void | dumpObjectInfo () |
void | dumpObjectTree () const const |
void | dumpObjectInfo () const const |
bool | setProperty (const char *name, const QVariant &value) |
QVariant | property (const char *name) const const |
QList< QByteArray > | dynamicPropertyNames () const const |
void | destroyed (QObject *obj) |
void | objectNameChanged (const QString &objectName) |
QObject * | parent () const const |
bool | inherits (const char *className) const const |
void | deleteLater () |
Q_DISABLE_COPY (Class) | |
Q_DISABLE_MOVE (Class) | |
Q_DISABLE_COPY_MOVE (Class) | |
T | qobject_cast (QObject *object) |
T | qobject_cast (const QObject *object) |
T | qFindChild (const QObject *obj, const QString &name) |
QList< T > | qFindChildren (const QObject *obj, const QString &name) |
QList< T > | qFindChildren (const QObject *obj, const QRegExp ®Exp) |
Q_CLASSINFO (Name, Value) | |
Q_INTERFACES (...) | |
Q_PROPERTY (...) | |
Q_ENUMS (...) | |
Q_FLAGS (...) | |
Q_ENUM (...) | |
Q_FLAG (...) | |
Q_ENUM_NS (...) | |
Q_FLAG_NS (...) | |
Q_OBJECT Q_OBJECT | |
Q_GADGET Q_GADGET | |
Q_NAMESPACE Q_NAMESPACE | |
Q_NAMESPACE_EXPORT (EXPORT_MACRO) | |
Q_SIGNALS Q_SIGNALS | |
Q_SIGNAL Q_SIGNAL | |
Q_SLOTS Q_SLOTS | |
Q_SLOT Q_SLOT | |
Q_EMIT Q_EMIT | |
Q_INVOKABLE Q_INVOKABLE | |
Q_REVISION Q_REVISION | |
Q_SET_OBJECT_NAME (Object) | |
QT_NO_NARROWING_CONVERSIONS_IN_CONNECT QT_NO_NARROWING_CONVERSIONS_IN_CONNECT | |
Static Public Member Functions | |
static void | setLod (const qreal &lod) |
static void | setGridEnabled (const bool &value) |
static void | setGridClustersEnabled (const bool &value) |
static void | setGridType (const GridType &gridType) |
static QPointF | snapToGrid (const QPointF &pos) Q_DECL_DEPRECATED |
![]() | |
QString | tr (const char *sourceText, const char *disambiguation, int n) |
QString | trUtf8 (const char *sourceText, const char *disambiguation, int n) |
QMetaObject::Connection | connect (const QObject *sender, const char *signal, const QObject *receiver, const char *method, Qt::ConnectionType type) |
QMetaObject::Connection | connect (const QObject *sender, const QMetaMethod &signal, const QObject *receiver, const QMetaMethod &method, Qt::ConnectionType type) |
QMetaObject::Connection | connect (const QObject *sender, PointerToMemberFunction signal, const QObject *receiver, PointerToMemberFunction method, Qt::ConnectionType type) |
QMetaObject::Connection | connect (const QObject *sender, PointerToMemberFunction signal, Functor functor) |
QMetaObject::Connection | connect (const QObject *sender, PointerToMemberFunction signal, const QObject *context, Functor functor, Qt::ConnectionType type) |
bool | disconnect (const QObject *sender, const char *signal, const QObject *receiver, const char *method) |
bool | disconnect (const QObject *sender, const QMetaMethod &signal, const QObject *receiver, const QMetaMethod &method) |
bool | disconnect (const QMetaObject::Connection &connection) |
bool | disconnect (const QObject *sender, PointerToMemberFunction signal, const QObject *receiver, PointerToMemberFunction method) |
Protected Member Functions | |
void | mousePressEvent (QGraphicsSceneMouseEvent *event) override |
![]() | |
virtual bool | event (QEvent *event) override |
virtual bool | eventFilter (QObject *watched, QEvent *event) override |
virtual void | contextMenuEvent (QGraphicsSceneContextMenuEvent *contextMenuEvent) |
virtual void | dragEnterEvent (QGraphicsSceneDragDropEvent *event) |
virtual void | dragMoveEvent (QGraphicsSceneDragDropEvent *event) |
virtual void | dragLeaveEvent (QGraphicsSceneDragDropEvent *event) |
virtual void | dropEvent (QGraphicsSceneDragDropEvent *event) |
virtual void | focusInEvent (QFocusEvent *focusEvent) |
virtual void | focusOutEvent (QFocusEvent *focusEvent) |
virtual void | helpEvent (QGraphicsSceneHelpEvent *helpEvent) |
virtual void | keyPressEvent (QKeyEvent *keyEvent) |
virtual void | keyReleaseEvent (QKeyEvent *keyEvent) |
virtual void | mouseMoveEvent (QGraphicsSceneMouseEvent *mouseEvent) |
virtual void | mouseReleaseEvent (QGraphicsSceneMouseEvent *mouseEvent) |
virtual void | mouseDoubleClickEvent (QGraphicsSceneMouseEvent *mouseEvent) |
virtual void | wheelEvent (QGraphicsSceneWheelEvent *wheelEvent) |
virtual void | inputMethodEvent (QInputMethodEvent *event) |
virtual void | drawForeground (QPainter *painter, const QRectF &rect) |
virtual void | drawItems (QPainter *painter, int numItems, QGraphicsItem *[] items, const QStyleOptionGraphicsItem[] options, QWidget *widget) |
bool | focusNextPrevChild (bool next) |
![]() | |
QObject * | sender () const const |
int | senderSignalIndex () const const |
int | receivers (const char *signal) const const |
bool | isSignalConnected (const QMetaMethod &signal) const const |
virtual void | timerEvent (QTimerEvent *event) |
virtual void | childEvent (QChildEvent *event) |
virtual void | customEvent (QEvent *event) |
virtual void | connectNotify (const QMetaMethod &signal) |
virtual void | disconnectNotify (const QMetaMethod &signal) |
Additional Inherited Members | |
![]() | |
typedef | SceneLayers |
BspTreeIndex | |
NoIndex | |
ItemLayer | |
BackgroundLayer | |
ForegroundLayer | |
AllLayers | |
![]() | |
typedef | QObjectList |
![]() | |
backgroundBrush | |
foregroundBrush | |
itemIndexMethod | |
sceneRect | |
bspTreeDepth | |
palette | |
font | |
sortCacheEnabled | |
stickyFocus | |
minimumRenderSize | |
focusOnTouch | |
![]() | |
objectName | |
Container for a GraphGraphicsView containing gates, nets, and modules.
The GraphicsScene is the scene where the GraphicsItems of the gates, nets and modules are placed in by the layouter. Besides the functions that are provided by its parent class QGraphicScene, it offers functions to work on a grid, to support drag-and-drop on the grid, to access the contained GraphicItems and to handle certain events like changed selections and groupings.
Definition at line 58 of file graphics_scene.h.
Enumerator | |
---|---|
None | |
Dots | |
Lines |
Definition at line 63 of file graphics_scene.h.
hal::GraphicsScene::GraphicsScene | ( | QObject * | parent = nullptr | ) |
Constructor.
parent | - The parent QObject |
Definition at line 77 of file graphics_scene.cpp.
References QObject::connect(), connectAll(), hal::gGraphContextManager, hal::gSelectionRelay, hal::SelectionRelay::registerSender(), hal::GraphContextManager::sSettingNetGroupingToPins, updateAllItems(), and hal::SettingsItem::valueChanged().
hal::GraphicsScene::~GraphicsScene | ( | ) |
Destructor.
Definition at line 91 of file graphics_scene.cpp.
References QObject::disconnect(), handleInternSelectionChanged(), QGraphicsScene::items(), QGraphicsScene::removeItem(), and QGraphicsScene::selectionChanged().
void hal::GraphicsScene::addGraphItem | ( | GraphicsItem * | item | ) |
Adds a GraphicsItem to the scene.
item | - The GraphicsItem to add |
Definition at line 108 of file graphics_scene.cpp.
References QGraphicsScene::addItem(), test_plugin::g, hal::Gate, hal::GraphicsItem::id(), hal::GraphicsItem::itemType(), hal::Module, test::n, and hal::Net.
void hal::GraphicsScene::connectAll | ( | ) |
Connects all necessary signals and slots.
Definition at line 284 of file graphics_scene.cpp.
References QObject::connect(), hal::gContentManager, hal::ContentManager::getGroupingManagerWidget(), hal::GroupingManagerWidget::getModel(), hal::gNetlistRelay, hal::GroupingTableModel::groupingColorChanged(), hal::NetlistRelay::groupingGateAssigned(), hal::NetlistRelay::groupingGateRemoved(), hal::NetlistRelay::groupingModuleAssigned(), hal::NetlistRelay::groupingModuleRemoved(), hal::NetlistRelay::groupingNetAssigned(), hal::NetlistRelay::groupingNetRemoved(), hal::gSelectionRelay, handleExternSelectionChanged(), handleExternSubfocusChanged(), handleGroupingAssignGate(), handleGroupingAssignModule(), handleGroupingAssignNet(), handleGroupingColorChanged(), handleInternSelectionChanged(), QGraphicsScene::selectionChanged(), hal::SelectionRelay::selectionChanged(), and hal::SelectionRelay::subfocusChanged().
Referenced by GraphicsScene().
void hal::GraphicsScene::deleteAllItems | ( | ) |
Removes all GraphicsItems from the scene.
Definition at line 316 of file graphics_scene.cpp.
References hal::GraphicsQssAdapter::instance(), QGraphicsScene::items(), QGraphicsScene::removeItem(), and hal::GraphicsQssAdapter::repolish().
Referenced by hal::GraphLayouter::layout().
void hal::GraphicsScene::disconnectAll | ( | ) |
Disconnects all connected signals and slots.
Definition at line 300 of file graphics_scene.cpp.
References QObject::disconnect(), hal::gContentManager, hal::ContentManager::getGroupingManagerWidget(), hal::GroupingManagerWidget::getModel(), hal::gNetlistRelay, hal::GroupingTableModel::groupingColorChanged(), hal::NetlistRelay::groupingGateAssigned(), hal::NetlistRelay::groupingGateRemoved(), hal::NetlistRelay::groupingModuleAssigned(), hal::NetlistRelay::groupingModuleRemoved(), hal::NetlistRelay::groupingNetAssigned(), hal::NetlistRelay::groupingNetRemoved(), hal::gSelectionRelay, handleExternSelectionChanged(), handleExternSubfocusChanged(), handleGroupingAssignGate(), handleGroupingAssignModule(), handleGroupingAssignNet(), handleGroupingColorChanged(), handleInternSelectionChanged(), QGraphicsScene::selectionChanged(), hal::SelectionRelay::selectionChanged(), and hal::SelectionRelay::subfocusChanged().
QPointF hal::GraphicsScene::dropTarget | ( | ) |
Gets the position of the drag shadow.
const GraphicsGate * hal::GraphicsScene::getGateItem | ( | const u32 | id | ) | const |
Gets the GraphicsGate for the corresponding gate. If there is no GraphicsGate for the given id, a nullptr is returned.
id | - The id of the gate in the netlist |
Definition at line 242 of file graphics_scene.cpp.
Referenced by hal::GraphWidget::ensureSelectionVisible(), hal::GraphWidget::focusGate(), and handleGroupingAssignGate().
const GraphicsModule * hal::GraphicsScene::getModuleItem | ( | const u32 | id | ) | const |
Gets the GraphicsModule for the corresponding module. If there is no GraphicsModule for the given id, a nullptr is returned.
id | - The id of the module in the netlist |
Definition at line 270 of file graphics_scene.cpp.
Referenced by hal::GraphWidget::ensureSelectionVisible(), hal::GraphWidget::focusModule(), and handleGroupingAssignModule().
const GraphicsNet * hal::GraphicsScene::getNetItem | ( | const u32 | id | ) | const |
Gets the GraphicsNet for the corresponding net. If there is no GraphicsNet for the given id, a nullptr is returned.
id | - The id of the net in the netlist |
Definition at line 256 of file graphics_scene.cpp.
Referenced by hal::GraphWidget::ensureSelectionVisible(), hal::GraphWidget::focusNet(), and handleGroupingAssignNet().
|
slot |
Q_SLOT to call whenever the selection has beed changed. It only handles selection changes outside this scene. It is used to apply extern selection changes to the scene.
sender | - The object that is responsible for the changes and called the signal. |
Definition at line 511 of file graphics_scene.cpp.
References QObject::blockSignals(), QGraphicsScene::clearSelection(), hal::gSelectionRelay, hal::SelectionRelay::isGateSelected(), hal::SelectionRelay::isModuleSelected(), hal::SelectionRelay::isNetSelected(), hal::SelectionRelay::numberSelectedGates(), hal::SelectionRelay::numberSelectedModules(), hal::SelectionRelay::numberSelectedNets(), and QObject::sender().
Referenced by connectAll(), disconnectAll(), and hal::GraphLayouter::layout().
|
slot |
Q_SLOT to call whenever the sub-focus has been changed. Currently unused.
sender |
Definition at line 562 of file graphics_scene.cpp.
References QObject::sender().
Referenced by connectAll(), and disconnectAll().
Q_SLOT to call whenever a gate was assigned to or removed from a grouping. It is used to update the corresponding GraphicsGate accordingly.
grp | - The grouping that has been changed |
id | - The id of the gate that was assigned/removed to/from the grouping |
Definition at line 462 of file graphics_scene.cpp.
References getGateItem(), and QGraphicsItem::update().
Referenced by connectAll(), and disconnectAll().
Q_SLOT to call whenever a module was assigned to or removed from a grouping. It is used to update the corresponding GraphicsModule accordingly.
grp | - The grouping that has been changed |
id | - The id of the module that was assigned/removed to/from the grouping |
Definition at line 454 of file graphics_scene.cpp.
References getModuleItem(), and QGraphicsItem::update().
Referenced by connectAll(), and disconnectAll().
Q_SLOT to call whenever a net was assigned to or removed from a grouping. It is used to update the corresponding GraphicsNet accordingly.
grp | - The grouping that has been changed |
id | - The id of the net that was assigned/removed to/from the grouping |
Definition at line 470 of file graphics_scene.cpp.
References getNetItem(), and QGraphicsItem::update().
Referenced by connectAll(), and disconnectAll().
|
slot |
Q_SLOT to call whenever the color of a grouping has been changed. It is used to update the affected GraphicsItems accordingly.
grp | - The grouping that has been changed |
Definition at line 478 of file graphics_scene.cpp.
References updateAllItems().
Referenced by connectAll(), and disconnectAll().
|
slot |
Q_SLOT used to highlight the selected graphics items.
highlightItems | - The selection tree items to highlight |
Definition at line 495 of file graphics_scene.cpp.
References QSet::contains(), hal::ModuleItem::Gate, QSet::insert(), hal::ModuleItem::Module, and hal::ModuleItem::Net.
Referenced by hal::GraphLayouter::GraphLayouter().
|
slot |
Q_SLOT to call when the selection has been changed. Used to keep track of the selected modules, gates and nets.
Definition at line 376 of file graphics_scene.cpp.
References QSet::begin(), hal::SelectionRelay::clear(), hal::Gate, hal::SelectionRelay::Gate, hal::gSelectionRelay, QSet::insert(), QSet::isEmpty(), hal::Module, hal::SelectionRelay::Module, hal::Net, hal::SelectionRelay::Net, hal::SelectionRelay::None, hal::SelectionRelay::relaySelectionChanged(), QGraphicsScene::selectedItems(), hal::SelectionRelay::setFocus(), hal::SelectionRelay::setSelectedGates(), hal::SelectionRelay::setSelectedModules(), hal::SelectionRelay::setSelectedNets(), and QSet::size().
Referenced by connectAll(), disconnectAll(), setMousePressed(), and ~GraphicsScene().
|
overrideprotectedvirtual |
Handles the mouse event. Used to intercept and ignore right-clicks.
event | - The mouse event in the graphics scene |
Reimplemented from QGraphicsScene.
Definition at line 567 of file graphics_scene.cpp.
References QGraphicsScene::event(), QGraphicsScene::mousePressEvent(), and Qt::RightButton.
void hal::GraphicsScene::moveNetsToBackground | ( | ) |
Moves all GraphicsNets to the background so that they do not overlap GraphicsGates. Helper function that can be used by the layouters.
Definition at line 349 of file graphics_scene.cpp.
Referenced by hal::GraphLayouter::layout().
hal::GraphicsScene::Q_ENUM | ( | GridType | ) |
void hal::GraphicsScene::removeGraphItem | ( | GraphicsItem * | item | ) |
Removes a GraphicsItem from the scene.
item | - The GraphicsItem to remove |
Definition at line 166 of file graphics_scene.cpp.
References test_plugin::g, hal::Gate, hal::GraphicsItem::id(), id, hal::GraphicsItem::itemType(), hal::Module, test::n, hal::Net, and QGraphicsScene::removeItem().
|
slot |
Set reference pointer to drag controller on start drag, nullptr when drag ended
dc | - Reference to drag controller |
Definition at line 103 of file graphics_scene.cpp.
Referenced by hal::DragController::clearShadows().
|
static |
Enables/Disables the grid clusters. The grid clusters are the darker lines in the grid that indicate 8 steps in the main grid.
value | - true to enable the grid clusters. false to disable the grid clusters. |
Definition at line 60 of file graphics_scene.cpp.
Referenced by hal::GraphGraphicsView::paintEvent().
|
static |
Enables/Disables the grid in the background.
value | - true to enable the grid. false to disable the grid. |
Definition at line 55 of file graphics_scene.cpp.
Referenced by hal::GraphGraphicsView::paintEvent().
|
static |
Sets the type of the grid. The following grid types are supported: None, Lines, Dots
gridType | - enumerated grid type |
Definition at line 65 of file graphics_scene.cpp.
Referenced by hal::GraphGraphicsView::paintEvent().
|
static |
Sets the Level of Detail (LOD) of the scene. If the LOD falls below a certain threshold, the grid in the background won't be drawn anymore.
lod | - The Level of Detail to draw |
Definition at line 37 of file graphics_scene.cpp.
References hal::GraphicsQssAdapter::instance(), hal::GraphicsQssAdapter::setGridAlpha(), and hal::GraphicsQssAdapter::setGridAlphaF().
Referenced by hal::GraphGraphicsView::paintEvent().
void hal::GraphicsScene::setMousePressed | ( | bool | isPressed | ) |
Keep track on mouse pressed status to avoid premature actions during rubber band selection
isPressed | true=mouse pressed, false=mouse released. |
Definition at line 355 of file graphics_scene.cpp.
References handleInternSelectionChanged().
Referenced by hal::GraphGraphicsView::mouseReleaseEvent().
Given any position, this function returns a position on the grid that is next to it.
pos | - The position to snap to the grid |
Definition at line 70 of file graphics_scene.cpp.
References QPointF::x(), and QPointF::y().
|
slot |
All items update
Definition at line 485 of file graphics_scene.cpp.
Referenced by GraphicsScene(), and handleGroupingColorChanged().
void hal::GraphicsScene::updateVisuals | ( | const GraphShader::Shading & | s | ) |
Updates all visuals using a certain GraphShader.
s | - The used GraphShader |
Definition at line 331 of file graphics_scene.cpp.
References hal::GraphShader::Shading::mGateVisuals, hal::GraphShader::Shading::mNetVisuals, and hal::GraphShader::Shading::mOduleVisuals.