Logical wire entity that groups segments sharing the same bus.
More...
#include <graphicalWire.hpp>
Logical wire entity that groups segments sharing the same bus.
GraphicalWire is an abstract logical entity representing a single logical bus in the circuit diagram. It manages one or more GraphicalWireSegment objects that are visually connected and share the same logical Bus and bus size.
This class is not a QGraphicsItem itself - it is managed by WireManager and tracks the logical connectivity independent of the visual representation.
- See also
- GraphicalWireSegment
-
WireManager
Definition at line 58 of file graphicalWire.hpp.
◆ GraphicalWire() [1/2]
Creates a wire with a unique route identifier.
Definition at line 49 of file graphicalWire.cpp.
◆ ~GraphicalWire()
◆ GraphicalWire() [2/2]
| GraphicalWire |
( |
unsigned int | busSize | ) |
|
|
explicit |
Constructs a wire with a specified bus size.
- Parameters
-
| busSize | The number of wires in the bus |
Definition at line 59 of file graphicalWire.cpp.
◆ addSegment()
Adds a segment to this wire.
- Parameters
-
| segment | The segment to add |
Definition at line 65 of file graphicalWire.cpp.
◆ clearBusState()
Clears the state of all wires in the bus.
Sets all wires to UNKNOWN state, used during simulation initialization.
Definition at line 83 of file graphicalWire.cpp.
◆ empty()
Checks if this wire has no segments.
- Returns
- True if empty
Definition at line 111 of file graphicalWire.hpp.
◆ getBus()
◆ getBusSize()
| size_t getBusSize |
( |
| ) |
const |
|
inlinenodiscard |
Gets the bus size.
- Returns
- Number of wires in the bus
Definition at line 135 of file graphicalWire.hpp.
◆ getColor() [1/2]
| QColor getColor |
( |
| ) |
const |
Gets the color for this wire based on bus size.
- Returns
- QColor for rendering
Definition at line 102 of file graphicalWire.cpp.
◆ getColor() [2/2]
Gets the color for a wire pointer (null-safe).
- Parameters
-
- Returns
- QColor for rendering
Definition at line 121 of file graphicalWire.cpp.
◆ getConnectionError()
| std::optional< QString > getConnectionError |
( |
| ) |
const |
|
inlinenodiscard |
Returns the connection error, or no value when the net has no error.
Definition at line 84 of file graphicalWire.hpp.
◆ getManager()
Gets the wire manager.
- Returns
- Pointer to the manager
Definition at line 188 of file graphicalWire.hpp.
◆ getRouteId()
| uint64_t getRouteId |
( |
| ) |
const |
|
inlinenodiscard |
Returns the persistent identifier of this logical wire group.
Definition at line 70 of file graphicalWire.hpp.
◆ getSegments()
Gets all segments belonging to this wire.
- Returns
- Set of segment pointers
Definition at line 103 of file graphicalWire.hpp.
◆ getVertices()
| std::vector< QPointF > getVertices |
( |
| ) |
const |
|
nodiscard |
Gets vertices at wire endpoints that are not junctions.
Returns segment endpoints that are free tips (not connected to other wires), representing connection points to components.
- Returns
- Vector of endpoint positions in scene coordinates
Definition at line 128 of file graphicalWire.cpp.
◆ removeSegment()
Removes a segment from this wire.
- Parameters
-
| segment | The segment to remove |
Definition at line 73 of file graphicalWire.cpp.
◆ restoreRouteId()
| void restoreRouteId |
( |
uint64_t | id | ) |
|
Restores a saved identifier and advances the identifier allocator.
- Parameters
-
| id | Route identifier from serialization or an undo snapshot. |
Definition at line 51 of file graphicalWire.cpp.
◆ setBus()
◆ setBusSize()
| void setBusSize |
( |
unsigned int | size | ) |
|
◆ setConnectionError()
| void setConnectionError |
( |
std::optional< QString > | reason | ) |
|
Updates the connection error and refreshes segment tooltips and painting.
- Parameters
-
| reason | Error message, or no value to clear the error. |
Definition at line 90 of file graphicalWire.cpp.
◆ setManager()
Sets the wire manager.
- Parameters
-
| manager | The manager instance |
Definition at line 182 of file graphicalWire.hpp.
◆ shape()
| QPainterPath shape |
( |
| ) |
const |
|
nodiscard |
Gets the combined shape of all segments.
- Returns
- Painter path in scene coordinates
Definition at line 146 of file graphicalWire.cpp.
◆ bus
◆ connectionError
| std::optional<QString> connectionError |
|
private |
◆ manager
◆ routeId
◆ segments
The documentation for this class was generated from the following files: