HAL
hal::GraphicsScene Class Reference

Container for a GraphGraphicsView containing gates, nets, and modules. More...

#include <graphics_scene.h>

Inheritance diagram for hal::GraphicsScene:
Inheritance graph
Collaboration diagram for hal::GraphicsScene:
Collaboration graph

Public Types

enum  GridType { None , Dots , Lines }
 
- Public Types inherited from QGraphicsScene
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 GraphicsGategetGateItem (const u32 id) const
 
const GraphicsNetgetNetItem (const u32 id) const
 
const GraphicsModulegetModuleItem (const u32 id) const
 
void setMousePressed (bool isPressed)
 
- Public Member Functions inherited from QGraphicsScene
 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
 
QGraphicsItemitemAt (const QPointF &position) const const
 
QGraphicsItemitemAt (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
 
QGraphicsItemitemAt (qreal x, qreal y) const const
 
QGraphicsItemitemAt (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)
 
QGraphicsItemGroupcreateItemGroup (const QList< QGraphicsItem * > &items)
 
void destroyItemGroup (QGraphicsItemGroup *group)
 
void addItem (QGraphicsItem *item)
 
QGraphicsEllipseItemaddEllipse (const QRectF &rect, const QPen &pen, const QBrush &brush)
 
QGraphicsLineItemaddLine (const QLineF &line, const QPen &pen)
 
QGraphicsPathItemaddPath (const QPainterPath &path, const QPen &pen, const QBrush &brush)
 
QGraphicsPixmapItemaddPixmap (const QPixmap &pixmap)
 
QGraphicsPolygonItemaddPolygon (const QPolygonF &polygon, const QPen &pen, const QBrush &brush)
 
QGraphicsRectItemaddRect (const QRectF &rect, const QPen &pen, const QBrush &brush)
 
QGraphicsTextItemaddText (const QString &text, const QFont &font)
 
QGraphicsSimpleTextItemaddSimpleText (const QString &text, const QFont &font)
 
QGraphicsProxyWidgetaddWidget (QWidget *widget, Qt::WindowFlags wFlags)
 
QGraphicsEllipseItemaddEllipse (qreal x, qreal y, qreal w, qreal h, const QPen &pen, const QBrush &brush)
 
QGraphicsLineItemaddLine (qreal x1, qreal y1, qreal x2, qreal y2, const QPen &pen)
 
QGraphicsRectItemaddRect (qreal x, qreal y, qreal w, qreal h, const QPen &pen, const QBrush &brush)
 
void removeItem (QGraphicsItem *item)
 
QGraphicsItemfocusItem () 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
 
QGraphicsItemmouseGrabberItem () 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)
 
QStylestyle () 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
 
QGraphicsItemactivePanel () const const
 
void setActivePanel (QGraphicsItem *item)
 
QGraphicsWidgetactiveWindow () 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 > &region)
 
void sceneRectChanged (const QRectF &rect)
 
void selectionChanged ()
 
void focusItemChanged (QGraphicsItem *newFocusItem, QGraphicsItem *oldFocusItem, Qt::FocusReason reason)
 
- Public Member Functions inherited from QObject
virtual const QMetaObjectmetaObject () 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)
 
QThreadthread () 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)
 
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 &regExp, Qt::FindChildOptions options) const const
 
QList< T > findChildren (const QRegularExpression &re, Qt::FindChildOptions options) const const
 
const QObjectListchildren () 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< QByteArraydynamicPropertyNames () const const
 
void destroyed (QObject *obj)
 
void objectNameChanged (const QString &objectName)
 
QObjectparent () const const
 
bool inherits (const char *className) const const
 
void deleteLater ()
 
 Q_DISABLE_COPY (Class)
 
 Q_DISABLE_MOVE (Class)
 
 Q_DISABLE_COPY_MOVE (Class)
 
qobject_cast (QObject *object)
 
qobject_cast (const QObject *object)
 
qFindChild (const QObject *obj, const QString &name)
 
QList< T > qFindChildren (const QObject *obj, const QString &name)
 
QList< T > qFindChildren (const QObject *obj, const QRegExp &regExp)
 
 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
 
- Static Public Member Functions inherited from QObject
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
 
- Protected Member Functions inherited from QGraphicsScene
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)
 
- Protected Member Functions inherited from QObject
QObjectsender () 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

- Public Attributes inherited from QGraphicsScene
typedef SceneLayers
 
 BspTreeIndex
 
 NoIndex
 
 ItemLayer
 
 BackgroundLayer
 
 ForegroundLayer
 
 AllLayers
 
- Public Attributes inherited from QObject
typedef QObjectList
 
- Properties inherited from QGraphicsScene
 backgroundBrush
 
 foregroundBrush
 
 itemIndexMethod
 
 sceneRect
 
 bspTreeDepth
 
 palette
 
 font
 
 sortCacheEnabled
 
 stickyFocus
 
 minimumRenderSize
 
 focusOnTouch
 
- Properties inherited from QObject
 objectName
 

Detailed Description

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.

Member Enumeration Documentation

◆ GridType

Enumerator
None 
Dots 
Lines 

Definition at line 63 of file graphics_scene.h.

Constructor & Destructor Documentation

◆ GraphicsScene()

hal::GraphicsScene::GraphicsScene ( QObject parent = nullptr)

◆ ~GraphicsScene()

hal::GraphicsScene::~GraphicsScene ( )

Member Function Documentation

◆ addGraphItem()

void hal::GraphicsScene::addGraphItem ( GraphicsItem item)

◆ connectAll()

◆ deleteAllItems()

void hal::GraphicsScene::deleteAllItems ( )

◆ disconnectAll()

◆ dropTarget()

QPointF hal::GraphicsScene::dropTarget ( )

Gets the position of the drag shadow.

Returns
the position of the drag shadow.

◆ getGateItem()

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.

Parameters
id- The id of the gate in the netlist
Returns
the GraphicsGate.

Definition at line 242 of file graphics_scene.cpp.

Referenced by hal::GraphWidget::ensureSelectionVisible(), hal::GraphWidget::focusGate(), and handleGroupingAssignGate().

◆ getModuleItem()

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.

Parameters
id- The id of the module in the netlist
Returns
the GraphicsModule.

Definition at line 270 of file graphics_scene.cpp.

Referenced by hal::GraphWidget::ensureSelectionVisible(), hal::GraphWidget::focusModule(), and handleGroupingAssignModule().

◆ getNetItem()

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.

Parameters
id- The id of the net in the netlist
Returns
the GraphicsNet.

Definition at line 256 of file graphics_scene.cpp.

Referenced by hal::GraphWidget::ensureSelectionVisible(), hal::GraphWidget::focusNet(), and handleGroupingAssignNet().

◆ handleExternSelectionChanged

void hal::GraphicsScene::handleExternSelectionChanged ( void *  sender)
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.

Parameters
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().

◆ handleExternSubfocusChanged

void hal::GraphicsScene::handleExternSubfocusChanged ( void *  sender)
slot

Q_SLOT to call whenever the sub-focus has been changed. Currently unused.

Parameters
sender

Definition at line 562 of file graphics_scene.cpp.

References QObject::sender().

Referenced by connectAll(), and disconnectAll().

◆ handleGroupingAssignGate

void hal::GraphicsScene::handleGroupingAssignGate ( Grouping grp,
u32  id 
)
slot

Q_SLOT to call whenever a gate was assigned to or removed from a grouping. It is used to update the corresponding GraphicsGate accordingly.

Parameters
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().

◆ handleGroupingAssignModule

void hal::GraphicsScene::handleGroupingAssignModule ( Grouping grp,
u32  id 
)
slot

Q_SLOT to call whenever a module was assigned to or removed from a grouping. It is used to update the corresponding GraphicsModule accordingly.

Parameters
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().

◆ handleGroupingAssignNet

void hal::GraphicsScene::handleGroupingAssignNet ( Grouping grp,
u32  id 
)
slot

Q_SLOT to call whenever a net was assigned to or removed from a grouping. It is used to update the corresponding GraphicsNet accordingly.

Parameters
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().

◆ handleGroupingColorChanged

void hal::GraphicsScene::handleGroupingColorChanged ( Grouping grp)
slot

Q_SLOT to call whenever the color of a grouping has been changed. It is used to update the affected GraphicsItems accordingly.

Parameters
grp- The grouping that has been changed

Definition at line 478 of file graphics_scene.cpp.

References updateAllItems().

Referenced by connectAll(), and disconnectAll().

◆ handleHighlight

void hal::GraphicsScene::handleHighlight ( const QVector< const ModuleItem * > &  highlightItems)
slot

Q_SLOT used to highlight the selected graphics items.

Parameters
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().

◆ handleInternSelectionChanged

◆ mousePressEvent()

void hal::GraphicsScene::mousePressEvent ( QGraphicsSceneMouseEvent event)
overrideprotectedvirtual

Handles the mouse event. Used to intercept and ignore right-clicks.

Parameters
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.

◆ moveNetsToBackground()

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().

◆ Q_ENUM()

hal::GraphicsScene::Q_ENUM ( GridType  )

◆ removeGraphItem()

void hal::GraphicsScene::removeGraphItem ( GraphicsItem item)

Removes a GraphicsItem from the scene.

Parameters
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().

◆ setDragController

void hal::GraphicsScene::setDragController ( DragController dc)
slot

Set reference pointer to drag controller on start drag, nullptr when drag ended

Parameters
dc- Reference to drag controller

Definition at line 103 of file graphics_scene.cpp.

Referenced by hal::DragController::clearShadows().

◆ setGridClustersEnabled()

void hal::GraphicsScene::setGridClustersEnabled ( const bool &  value)
static

Enables/Disables the grid clusters. The grid clusters are the darker lines in the grid that indicate 8 steps in the main grid.

Parameters
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().

◆ setGridEnabled()

void hal::GraphicsScene::setGridEnabled ( const bool &  value)
static

Enables/Disables the grid in the background.

Parameters
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().

◆ setGridType()

void hal::GraphicsScene::setGridType ( const GridType gridType)
static

Sets the type of the grid. The following grid types are supported: None, Lines, Dots

Parameters
gridType- enumerated grid type

Definition at line 65 of file graphics_scene.cpp.

Referenced by hal::GraphGraphicsView::paintEvent().

◆ setLod()

void hal::GraphicsScene::setLod ( const qreal &  lod)
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.

Parameters
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().

◆ setMousePressed()

void hal::GraphicsScene::setMousePressed ( bool  isPressed)

Keep track on mouse pressed status to avoid premature actions during rubber band selection

Parameters
isPressedtrue=mouse pressed, false=mouse released.

Definition at line 355 of file graphics_scene.cpp.

References handleInternSelectionChanged().

Referenced by hal::GraphGraphicsView::mouseReleaseEvent().

◆ snapToGrid()

QPointF hal::GraphicsScene::snapToGrid ( const QPointF pos)
static

Given any position, this function returns a position on the grid that is next to it.

Deprecated:
Please use GraphGraphicsView::closestLayouterPos instead.
Parameters
pos- The position to snap to the grid
Returns
the closest position on the grid

Definition at line 70 of file graphics_scene.cpp.

References QPointF::x(), and QPointF::y().

◆ updateAllItems

void hal::GraphicsScene::updateAllItems ( )
slot

All items update

Definition at line 485 of file graphics_scene.cpp.

Referenced by GraphicsScene(), and handleGroupingColorChanged().

◆ updateVisuals()

void hal::GraphicsScene::updateVisuals ( const GraphShader::Shading s)

Updates all visuals using a certain GraphShader.

Parameters
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.


The documentation for this class was generated from the following files: