|
SILICON
|
Base class for all graphical items in the diagram. More...
#include <graphicalItem.hpp>
Public Slots | |
| virtual void | modeChanged (InteractionMode mode) |
| Called when the interaction mode changes. | |
Public Member Functions | |
| GraphicalItem (ItemCategory category=ItemCategory::GraphicalItem, QGraphicsItem *parent=nullptr) | |
| ~GraphicalItem () override | |
| void | setCollidingStatus (CollidingStatus newStatus) |
| Sets the collision status. | |
| QVariant | itemChange (GraphicsItemChange change, const QVariant &value) override |
| Handles item change events. | |
| int | type () const override |
| Returns the item type identifier. | |
| bool | isColliding () const |
| Checks if the item is colliding. | |
| QPointF | getInitialPosition () const |
| Gets the original position of the item before it started moving. | |
| qreal | getInitialRotation () const |
| uint64_t | getUiId () const |
| void | setInitialPosition () |
| Sets the initialPosition of the item to its current position (should be used when placed). | |
| void | setInitialRotation () |
| void | setUiId (uint64_t newUiId) |
| void | setOwningScene (DiagramScene *scene) |
| void | setGeometryPosition (QPointF position) |
| virtual void | updateTopology () |
Static Public Member Functions | |
| static uint64_t | generateUiId () |
Protected Member Functions | |
| virtual QRectF | getCollisionRect () const =0 |
| Gets the rectangle used for collision detection. | |
| virtual bool | canRotate () const |
| Whether the item can be rotated. | |
| virtual void | onPositionChanged (QPointF offset) |
| Called when the item position changes. | |
| CollidingStatus | getCollidingStatus () const |
| Gets the current collision status. | |
| void | mouseReleaseEvent (QGraphicsSceneMouseEvent *event) override |
| void | mousePressEvent (QGraphicsSceneMouseEvent *event) override |
Private Attributes | |
| CollidingStatus | collidingStatus = NOT_COLLIDING |
| Current collision status. | |
| QPointF | initialPosition |
| Initial position before a move action starts. | |
| qreal | initialRotation = 0 |
| Initial rotation before a rotate action starts. | |
| uint64_t | uiId = 0 |
| Stable runtime identifier used by DiagramScene payloads. | |
| DiagramScene * | owningScene = nullptr |
| Scene used for uiId registration bookkeeping during destruction. | |
| bool | settingGeometryPosition = false |
Base class for all graphical items in the diagram.
GraphicalItem extends QGraphicsObject to provide common functionality for circuit diagram elements including collision detection, rotation support, and interaction mode handling.
Definition at line 62 of file graphicalItem.hpp.
|
explicit |
Definition at line 60 of file graphicalItem.cpp.
|
override |
Definition at line 67 of file graphicalItem.cpp.
|
inlinenodiscardprotectedvirtual |
Whether the item can be rotated.
Reimplemented in GraphicalComponent.
Definition at line 136 of file graphicalItem.hpp.
|
staticnodiscard |
Definition at line 73 of file graphicalItem.cpp.
|
inlinenodiscardprotected |
Gets the current collision status.
Definition at line 148 of file graphicalItem.hpp.
|
nodiscardprotectedpure virtual |
Gets the rectangle used for collision detection.
Implemented in GraphicalComponent, and GraphicalWireSegment.
|
inlinenodiscard |
Gets the original position of the item before it started moving.
Definition at line 95 of file graphicalItem.hpp.
|
inlinenodiscard |
Definition at line 97 of file graphicalItem.hpp.
|
inlinenodiscard |
Definition at line 98 of file graphicalItem.hpp.
|
inlinenodiscard |
Checks if the item is colliding.
Definition at line 87 of file graphicalItem.hpp.
|
override |
Handles item change events.
Definition at line 147 of file graphicalItem.cpp.
|
virtualslot |
Called when the interaction mode changes.
| mode | The new interaction mode |
Reimplemented in GraphicalComponent, and GraphicalWireSegment.
Definition at line 325 of file graphicalItem.cpp.
|
overrideprotected |
Definition at line 93 of file graphicalItem.cpp.
|
overrideprotected |
Definition at line 106 of file graphicalItem.cpp.
|
inlineprotectedvirtual |
Called when the item position changes.
| offset | The position change offset |
Definition at line 142 of file graphicalItem.hpp.
| void setCollidingStatus | ( | CollidingStatus | newStatus | ) |
Sets the collision status.
| newStatus | The new collision status |
Definition at line 85 of file graphicalItem.cpp.
| void setGeometryPosition | ( | QPointF | position | ) |
Restore a geometry edit exactly, without movement snapping or collision rejection.
Definition at line 78 of file graphicalItem.cpp.
|
inline |
Sets the initialPosition of the item to its current position (should be used when placed).
Definition at line 104 of file graphicalItem.hpp.
|
inline |
Definition at line 106 of file graphicalItem.hpp.
|
inline |
Definition at line 108 of file graphicalItem.hpp.
|
inline |
Definition at line 107 of file graphicalItem.hpp.
|
inlinenodiscardoverride |
Returns the item type identifier.
Definition at line 81 of file graphicalItem.hpp.
|
inlinevirtual |
Reimplemented in GraphicalWireSegment.
Definition at line 116 of file graphicalItem.hpp.
|
private |
Current collision status.
Definition at line 155 of file graphicalItem.hpp.
|
private |
Initial position before a move action starts.
Definition at line 158 of file graphicalItem.hpp.
|
private |
Initial rotation before a rotate action starts.
Definition at line 161 of file graphicalItem.hpp.
|
private |
Scene used for uiId registration bookkeeping during destruction.
Definition at line 167 of file graphicalItem.hpp.
|
private |
Definition at line 168 of file graphicalItem.hpp.
|
private |
Stable runtime identifier used by DiagramScene payloads.
Definition at line 164 of file graphicalItem.hpp.