|
wiRedPanda
Logic Circuit Simulator
|
Owns the interactive editing state of a Scene — element dragging, the rubber-band selection rectangle, and the last cursor position — and implements the press/move/release/double-click gestures. More...
#include <SceneInteraction.h>
Public Member Functions | |
| void | applyTheme (const ThemeAttributes &theme) |
| Applies the theme's selection-rectangle brush and pen. | |
| void | attachToScene () |
| bool | isDraggingElement () const |
true while an element drag is in progress (drives Scene::resizeScene's expand-only mode). | |
| QPointF | lastMousePos () const |
| Last known cursor position in scene coordinates. | |
| bool | mouseDoubleClick (QGraphicsSceneMouseEvent *event) |
| bool | mouseMove (QGraphicsSceneMouseEvent *event) |
| bool | mousePress (QGraphicsSceneMouseEvent *event) |
| bool | mouseRelease (QGraphicsSceneMouseEvent *event) |
| SceneInteraction (Scene *scene) | |
Owns the interactive editing state of a Scene — element dragging, the rubber-band selection rectangle, and the last cursor position — and implements the press/move/release/double-click gestures.
Extracted from Scene via ownership inversion, mirroring ConnectionManager: it holds the drag snapshot, selection-box state and the selection-rect item, and calls back to the Scene only for genuine scene operations (itemAt, selectedElements, receiveCommand, resizeScene, contextMenu, the connection manager). The gesture methods return true when the event is fully handled so Scene skips the base-class call. (The mouse-move re-entrancy guard stays on Scene because it must wrap Scene's own base-event call.)
Definition at line 37 of file SceneInteraction.h.
|
explicit |
Definition at line 23 of file SceneInteraction.cpp.
| void SceneInteraction::applyTheme | ( | const ThemeAttributes & | theme | ) |
Applies the theme's selection-rectangle brush and pen.
Definition at line 39 of file SceneInteraction.cpp.
References ThemeAttributes::m_selectionBrush, and ThemeAttributes::m_selectionPen.
| void SceneInteraction::attachToScene | ( | ) |
Adds the selection rectangle to the scene and starts the drag throttle timer. Called from the Scene constructor body to preserve the original init order.
Definition at line 28 of file SceneInteraction.cpp.
|
inlinenodiscard |
true while an element drag is in progress (drives Scene::resizeScene's expand-only mode).
Definition at line 59 of file SceneInteraction.h.
|
inlinenodiscard |
Last known cursor position in scene coordinates.
Definition at line 56 of file SceneInteraction.h.
| bool SceneInteraction::mouseDoubleClick | ( | QGraphicsSceneMouseEvent * | event | ) |
true if the double-click was fully handled (caller skips the base call). Definition at line 229 of file SceneInteraction.cpp.
| bool SceneInteraction::mouseMove | ( | QGraphicsSceneMouseEvent * | event | ) |
true if the move was fully handled (caller skips the base call). Definition at line 133 of file SceneInteraction.cpp.
| bool SceneInteraction::mousePress | ( | QGraphicsSceneMouseEvent * | event | ) |
true if the press was fully handled (caller skips the base call). Definition at line 54 of file SceneInteraction.cpp.
References sentryBreadcrumb(), GraphicElement::Type, and Port::Type.
| bool SceneInteraction::mouseRelease | ( | QGraphicsSceneMouseEvent * | event | ) |
true if the release was fully handled (caller skips the base call). Definition at line 170 of file SceneInteraction.cpp.
References sentryBreadcrumb().