|
HAL
|
The standard module to visualize netlist modules. More...
#include <standard_graphics_module.h>


Public Member Functions | |
| StandardGraphicsModule (Module *m, bool adjust_size_to_grid=true) | |
| void | paint (QPainter *painter, const QStyleOptionGraphicsItem *option, QWidget *widget=nullptr) override |
| QPointF | getInputScenePosition (const u32 mNetId, const QString &pin_type) const override |
| QPointF | getOutputScenePosition (const u32 mNetId, const QString &pin_type) const override |
| QPointF | endpointPositionByIndex (int index, bool isInput) const override |
| float | yEndpointDistance () const override |
| float | yTopPinDistance () const override |
Public Member Functions inherited from hal::GraphicsModule | |
| GraphicsModule (Module *m) | |
| void | setModuleLabel (const Module *m, bool init=false) |
Public Member Functions inherited from hal::GraphicsNode | |
| GraphicsNode (const ItemType type, const u32 id) | |
| virtual QRectF | boundingRect () const override |
| virtual QPainterPath | shape () const override |
| int | inputByNet (u32 netId) const |
| int | outputByNet (u32 netId) const |
| QList< u32 > | inputNets () const |
| QList< u32 > | outputNets () const |
| virtual void | setVisuals (const Visuals &v) |
| qreal | width () const |
| qreal | height () const |
| void | set_name (const QString &name) |
Public Member Functions inherited from hal::GraphicsItem | |
| GraphicsItem (const ItemType type, const u32 id) | |
| ItemType | itemType () const |
| u32 | id () const |
| void | setHightlight (bool hl) |
Public Member Functions inherited from QGraphicsItem | |
| QGraphicsItem (QGraphicsItem *parent) | |
| virtual | ~QGraphicsItem () |
| QGraphicsScene * | scene () const const |
| QGraphicsItem * | parentItem () const const |
| QGraphicsItem * | topLevelItem () const const |
| QGraphicsObject * | parentObject () const const |
| QGraphicsWidget * | parentWidget () const const |
| QGraphicsWidget * | topLevelWidget () const const |
| QGraphicsWidget * | window () const const |
| QGraphicsItem * | panel () const const |
| void | setParentItem (QGraphicsItem *newParent) |
| QList< QGraphicsItem * > | children () const const |
| QList< QGraphicsItem * > | childItems () const const |
| bool | isWidget () const const |
| bool | isWindow () const const |
| bool | isPanel () const const |
| QGraphicsObject * | toGraphicsObject () |
| const QGraphicsObject * | toGraphicsObject () const const |
| QGraphicsItemGroup * | group () const const |
| void | setGroup (QGraphicsItemGroup *group) |
| QGraphicsItem::GraphicsItemFlags | flags () const const |
| void | setFlag (QGraphicsItem::GraphicsItemFlag flag, bool enabled) |
| void | setFlags (QGraphicsItem::GraphicsItemFlags flags) |
| QGraphicsItem::CacheMode | cacheMode () const const |
| void | setCacheMode (QGraphicsItem::CacheMode mode, const QSize &logicalCacheSize) |
| QGraphicsItem::PanelModality | panelModality () const const |
| void | setPanelModality (QGraphicsItem::PanelModality panelModality) |
| bool | isBlockedByModalPanel (QGraphicsItem **blockingPanel) const const |
| QString | toolTip () const const |
| void | setToolTip (const QString &toolTip) |
| QCursor | cursor () const const |
| void | setCursor (const QCursor &cursor) |
| bool | hasCursor () const const |
| void | unsetCursor () |
| bool | isVisible () const const |
| bool | isVisibleTo (const QGraphicsItem *parent) const const |
| void | setVisible (bool visible) |
| void | hide () |
| void | show () |
| bool | isEnabled () const const |
| void | setEnabled (bool enabled) |
| bool | isSelected () const const |
| void | setSelected (bool selected) |
| bool | acceptDrops () const const |
| void | setAcceptDrops (bool on) |
| qreal | opacity () const const |
| qreal | effectiveOpacity () const const |
| void | setOpacity (qreal opacity) |
| QGraphicsEffect * | graphicsEffect () const const |
| void | setGraphicsEffect (QGraphicsEffect *effect) |
| Qt::MouseButtons | acceptedMouseButtons () const const |
| void | setAcceptedMouseButtons (Qt::MouseButtons buttons) |
| bool | acceptsHoverEvents () const const |
| void | setAcceptsHoverEvents (bool enabled) |
| bool | acceptHoverEvents () const const |
| void | setAcceptHoverEvents (bool enabled) |
| bool | acceptTouchEvents () const const |
| void | setAcceptTouchEvents (bool enabled) |
| bool | filtersChildEvents () const const |
| void | setFiltersChildEvents (bool enabled) |
| bool | handlesChildEvents () const const |
| void | setHandlesChildEvents (bool enabled) |
| bool | isActive () const const |
| void | setActive (bool active) |
| bool | hasFocus () const const |
| void | setFocus (Qt::FocusReason focusReason) |
| void | clearFocus () |
| QGraphicsItem * | focusProxy () const const |
| void | setFocusProxy (QGraphicsItem *item) |
| QGraphicsItem * | focusItem () const const |
| void | grabMouse () |
| void | ungrabMouse () |
| void | grabKeyboard () |
| void | ungrabKeyboard () |
| QPointF | pos () const const |
| qreal | x () const const |
| void | setX (qreal x) |
| qreal | y () const const |
| void | setY (qreal y) |
| QPointF | scenePos () const const |
| void | setPos (const QPointF &pos) |
| void | setPos (qreal x, qreal y) |
| void | moveBy (qreal dx, qreal dy) |
| void | ensureVisible (const QRectF &rect, int xmargin, int ymargin) |
| void | ensureVisible (qreal x, qreal y, qreal w, qreal h, int xmargin, int ymargin) |
| QMatrix | matrix () const const |
| QMatrix | sceneMatrix () const const |
| void | setMatrix (const QMatrix &matrix, bool combine) |
| void | resetMatrix () |
| QTransform | transform () const const |
| QTransform | sceneTransform () const const |
| QTransform | deviceTransform (const QTransform &viewportTransform) const const |
| QTransform | itemTransform (const QGraphicsItem *other, bool *ok) const const |
| void | setTransform (const QTransform &matrix, bool combine) |
| void | resetTransform () |
| void | rotate (qreal angle) |
| void | scale (qreal sx, qreal sy) |
| void | shear (qreal sh, qreal sv) |
| void | translate (qreal dx, qreal dy) |
| void | setRotation (qreal angle) |
| qreal | rotation () const const |
| void | setScale (qreal factor) |
| qreal | scale () const const |
| QList< QGraphicsTransform * > | transformations () const const |
| void | setTransformations (const QList< QGraphicsTransform * > &transformations) |
| QPointF | transformOriginPoint () const const |
| void | setTransformOriginPoint (const QPointF &origin) |
| void | setTransformOriginPoint (qreal x, qreal y) |
| virtual void | advance (int phase) |
| qreal | zValue () const const |
| void | setZValue (qreal z) |
| void | stackBefore (const QGraphicsItem *sibling) |
| QRectF | childrenBoundingRect () const const |
| QRectF | sceneBoundingRect () const const |
| bool | isClipped () const const |
| QPainterPath | clipPath () const const |
| virtual bool | contains (const QPointF &point) const const |
| virtual bool | collidesWithItem (const QGraphicsItem *other, Qt::ItemSelectionMode mode) const const |
| virtual bool | collidesWithPath (const QPainterPath &path, Qt::ItemSelectionMode mode) const const |
| QList< QGraphicsItem * > | collidingItems (Qt::ItemSelectionMode mode) const const |
| bool | isObscured (const QRectF &rect) const const |
| bool | isObscured (qreal x, qreal y, qreal w, qreal h) const const |
| virtual bool | isObscuredBy (const QGraphicsItem *item) const const |
| virtual QPainterPath | opaqueArea () const const |
| QRegion | boundingRegion (const QTransform &itemToDeviceTransform) const const |
| qreal | boundingRegionGranularity () const const |
| void | setBoundingRegionGranularity (qreal granularity) |
| void | update (const QRectF &rect) |
| void | update (qreal x, qreal y, qreal width, qreal height) |
| void | scroll (qreal dx, qreal dy, const QRectF &rect) |
| QPointF | mapToItem (const QGraphicsItem *item, const QPointF &point) const const |
| QPointF | mapToParent (const QPointF &point) const const |
| QPointF | mapToScene (const QPointF &point) const const |
| QPolygonF | mapToItem (const QGraphicsItem *item, const QRectF &rect) const const |
| QPolygonF | mapToParent (const QRectF &rect) const const |
| QPolygonF | mapToScene (const QRectF &rect) const const |
| QRectF | mapRectToItem (const QGraphicsItem *item, const QRectF &rect) const const |
| QRectF | mapRectToParent (const QRectF &rect) const const |
| QRectF | mapRectToScene (const QRectF &rect) const const |
| QPolygonF | mapToItem (const QGraphicsItem *item, const QPolygonF &polygon) const const |
| QPolygonF | mapToParent (const QPolygonF &polygon) const const |
| QPolygonF | mapToScene (const QPolygonF &polygon) const const |
| QPainterPath | mapToItem (const QGraphicsItem *item, const QPainterPath &path) const const |
| QPainterPath | mapToParent (const QPainterPath &path) const const |
| QPainterPath | mapToScene (const QPainterPath &path) const const |
| QPointF | mapFromItem (const QGraphicsItem *item, const QPointF &point) const const |
| QPointF | mapFromParent (const QPointF &point) const const |
| QPointF | mapFromScene (const QPointF &point) const const |
| QPolygonF | mapFromItem (const QGraphicsItem *item, const QRectF &rect) const const |
| QPolygonF | mapFromParent (const QRectF &rect) const const |
| QPolygonF | mapFromScene (const QRectF &rect) const const |
| QRectF | mapRectFromItem (const QGraphicsItem *item, const QRectF &rect) const const |
| QRectF | mapRectFromParent (const QRectF &rect) const const |
| QRectF | mapRectFromScene (const QRectF &rect) const const |
| QPolygonF | mapFromItem (const QGraphicsItem *item, const QPolygonF &polygon) const const |
| QPolygonF | mapFromParent (const QPolygonF &polygon) const const |
| QPolygonF | mapFromScene (const QPolygonF &polygon) const const |
| QPainterPath | mapFromItem (const QGraphicsItem *item, const QPainterPath &path) const const |
| QPainterPath | mapFromParent (const QPainterPath &path) const const |
| QPainterPath | mapFromScene (const QPainterPath &path) const const |
| QPointF | mapToItem (const QGraphicsItem *item, qreal x, qreal y) const const |
| QPointF | mapToParent (qreal x, qreal y) const const |
| QPointF | mapToScene (qreal x, qreal y) const const |
| QPolygonF | mapToItem (const QGraphicsItem *item, qreal x, qreal y, qreal w, qreal h) const const |
| QPolygonF | mapToParent (qreal x, qreal y, qreal w, qreal h) const const |
| QPolygonF | mapToScene (qreal x, qreal y, qreal w, qreal h) const const |
| QRectF | mapRectToItem (const QGraphicsItem *item, qreal x, qreal y, qreal w, qreal h) const const |
| QRectF | mapRectToParent (qreal x, qreal y, qreal w, qreal h) const const |
| QRectF | mapRectToScene (qreal x, qreal y, qreal w, qreal h) const const |
| QPointF | mapFromItem (const QGraphicsItem *item, qreal x, qreal y) const const |
| QPointF | mapFromParent (qreal x, qreal y) const const |
| QPointF | mapFromScene (qreal x, qreal y) const const |
| QPolygonF | mapFromItem (const QGraphicsItem *item, qreal x, qreal y, qreal w, qreal h) const const |
| QPolygonF | mapFromParent (qreal x, qreal y, qreal w, qreal h) const const |
| QPolygonF | mapFromScene (qreal x, qreal y, qreal w, qreal h) const const |
| QRectF | mapRectFromItem (const QGraphicsItem *item, qreal x, qreal y, qreal w, qreal h) const const |
| QRectF | mapRectFromParent (qreal x, qreal y, qreal w, qreal h) const const |
| QRectF | mapRectFromScene (qreal x, qreal y, qreal w, qreal h) const const |
| bool | isAncestorOf (const QGraphicsItem *child) const const |
| QGraphicsItem * | commonAncestorItem (const QGraphicsItem *other) const const |
| bool | isUnderMouse () const const |
| QVariant | data (int key) const const |
| void | setData (int key, const QVariant &value) |
| Qt::InputMethodHints | inputMethodHints () const const |
| void | setInputMethodHints (Qt::InputMethodHints hints) |
| virtual int | type () const const |
| void | installSceneEventFilter (QGraphicsItem *filterItem) |
| void | removeSceneEventFilter (QGraphicsItem *filterItem) |
| T | qgraphicsitem_cast (QGraphicsItem *item) |
Static Public Member Functions | |
| static void | loadSettings () |
| static void | updateAlpha () |
Static Public Member Functions inherited from hal::GraphicsNode | |
| static void | loadSettings () |
Static Public Member Functions inherited from hal::GraphicsItem | |
| static void | loadSettings () |
| static void | setLod (const qreal lod) |
The standard module to visualize netlist modules.
The GraphicsModule that is (currently) used to display modules in the scene.
Definition at line 39 of file standard_graphics_module.h.
|
explicit |
Constructor.
| m | - The underlying module of the StandardGraphicsModule |
| adjust_size_to_grid | - true if the size of the GraphicsModule should be extended so that its height and width are a multiple of the grid size. |
Definition at line 84 of file standard_graphics_module.cpp.
|
overridevirtual |
Given the index of an input/output pin, this function returns the position of this pin in the scene.
(Pins are positioned from top (idx=0) to bottom (idx=maxIdx))
| index | - The index of the pin |
| isInput | - true if the pin is an input pin
|
Implements hal::GraphicsNode.
Definition at line 224 of file standard_graphics_module.cpp.
References QGraphicsItem::mapToScene(), hal::GraphicsNode::mWidth, QGraphicsItem::y(), yEndpointDistance(), and yTopPinDistance().
Referenced by getInputScenePosition(), and getOutputScenePosition().
|
overridevirtual |
Given the id of a net and the type of the pin of one of its destinations, this function returns the position of the input pin in the scene.
| mNetId | - The net id |
| pin_type | - The input pin type |
Implements hal::GraphicsNode.
Definition at line 184 of file standard_graphics_module.cpp.
References endpointPositionByIndex(), and hal::GraphicsModule::mInputPins.
|
overridevirtual |
Given the id of a net and the type of the pin of one of its sources, this function returns the position of the output pin in the scene.
| mNetId | - The net id |
| pin_type | - The output pin type |
Implements hal::GraphicsNode.
Definition at line 199 of file standard_graphics_module.cpp.
References endpointPositionByIndex(), and hal::GraphicsModule::mOutputPins.
|
static |
Loads the cosmetic setting that will be applied to all GraphicsModules.
Definition at line 54 of file standard_graphics_module.cpp.
References QFontMetricsF::ascent(), QFontMetricsF::descent(), QFontMetricsF::height(), hal::GraphicsQssAdapter::instance(), Qt::MiterJoin, hal::GraphicsQssAdapter::nodeTextColor, QPen::setCosmetic(), QPen::setJoinStyle(), QFont::setPixelSize(), hal::GraphicsItem::sHighlightColor, hal::GraphicsItem::sSelectionColor, and hal::GraphicsNode::sTextColor.
Referenced by hal::style::debugUpdate().
|
overridevirtual |
Draws the StandardGraphicsModule in the scene.
| painter | - The used QPainter |
| option | - The styling options. Used to access the state (option->state). |
| widget | - The widget to paint on |
Implements QGraphicsItem.
Definition at line 89 of file standard_graphics_module.cpp.
References QPainter::Antialiasing, QVector::at(), hal::GraphicsNode::boundingRect(), QPainter::drawRect(), QPainter::drawText(), QPainter::fillRect(), hal::SelectionRelay::focusId(), hal::SelectionRelay::focusType(), hal::GraphicsItem::groupingColor(), hal::gSelectionRelay, hal::GraphicsQssAdapter::instance(), QColor::isValid(), hal::SelectionRelay::Left, hal::GraphicsItem::mColor, hal::GraphicsNode::mHeight, hal::GraphicsItem::mId, hal::GraphicsModule::mInputPins, hal::GraphicsNode::mNodeText, hal::SelectionRelay::Module, hal::GraphicsModule::mOutputPins, hal::GraphicsNode::mTextPosition, hal::GraphicsNode::mWidth, option(), hal::GraphicsItem::penColor(), QPainter::renderHints(), hal::SelectionRelay::Right, hal::GraphicsItem::selectionColor(), QColor::setAlphaF(), QPainter::setBrush(), QPen::setColor(), QPen::setCosmetic(), QPainter::setFont(), QPainter::setPen(), QPainter::setRenderHint(), QPointF::setY(), hal::GraphicsItem::sLod, QStyle::State_Selected, hal::GraphicsNode::sTextColor, hal::GraphicsNode::sTextFont, hal::SelectionRelay::subfocus(), hal::SelectionRelay::subfocusIndex(), and QPointF::y().
|
static |
Updates the alpha value (transparency) of the GraphicsModule based on the current level-of-detail.
Definition at line 76 of file standard_graphics_module.cpp.
References hal::GraphicsItem::sLod.
Referenced by hal::GraphGraphicsView::paintEvent().
|
overridevirtual |
Gets the vertical space between two endpoints (in scene coordinates).
Implements hal::GraphicsNode.
Definition at line 214 of file standard_graphics_module.cpp.
Referenced by endpointPositionByIndex().
|
overridevirtual |
Gets the distance between the top edge of the node and the first pin (in scene coordinates).
Implements hal::GraphicsNode.
Definition at line 219 of file standard_graphics_module.cpp.
Referenced by endpointPositionByIndex().