|
SILICON
|
#include <wireManager.hpp>
Classes | |
| struct | PortReference |
| struct | TopologyVertex |
| struct | TopologyEdge |
| struct | SegmentTopology |
| struct | PortAnchor |
| struct | ExplicitContact |
| class | Edit |
| class | Batch |
Public Types | |
| enum class | Change : uint8_t { None = 0 , Geometry = 1 , Connectivity = 2 , Electrical = 4 } |
| enum class | VertexKind : uint8_t { FreeEndpoint , Junction , Port } |
| using | ChangeCallback = std::function<void(Change)> |
| using | TopologyVertexMap = std::map<uint64_t, TopologyVertex> |
| using | TopologyEdgeMap = std::map<uint64_t, TopologyEdge> |
| using | PortAnchorProvider = std::function<std::vector<PortAnchor>()> |
Public Member Functions | |
| const TopologyVertexMap & | topologyVertices () const |
| Borrows the topology vertex map until the topology is modified. | |
| const TopologyEdgeMap & | topologyEdges () const |
| Borrows the topology edge map until the topology is modified. | |
| const SegmentTopology & | topologyFor (uint64_t segmentId) const |
| Borrows segment topology until rebuilt; missing segments return an empty topology. | |
| void | setPortAnchors (PortAnchorProvider anchors) |
| Sets the provider of current component port anchors in scene coordinates. | |
| void | refreshPortAnchors () |
| Refreshes port references after components enter or leave the scene. | |
| void | rebuildFromGeometry () |
| Derives electrical groups, junctions, and port vertices from segment geometry. | |
| WireManager ()=default | |
| ~WireManager () | |
| WireManager (const WireManager &)=delete | |
| WireManager & | operator= (const WireManager &)=delete |
| WireManager (WireManager &&)=delete | |
| WireManager & | operator= (WireManager &&)=delete |
| std::shared_ptr< GraphicalWire > | createWire (unsigned int busSize=1) |
| void | removeWire (GraphicalWire *wire) |
| const std::vector< std::shared_ptr< GraphicalWire > > & | wires () const |
| void | addSegment (GraphicalWireSegment *segment, bool updateTopology=true) |
| void | removeSegment (GraphicalWireSegment *segment) |
| void | updateSegmentTopology (GraphicalWireSegment *segment) |
| bool | commitSegmentTranslations (std::span< const std::pair< uint64_t, QPointF > > translations) |
| Rebuilds connectivity after segment positions have been translated. | |
| void | calculateJunctions (GraphicalWireSegment *segment, bool includeNeighborhood=true) const |
| void | calculateJunctions () const |
| GraphicalWireSegment * | segmentAtPoint (QPointF scenePoint, const GraphicalWireSegment *ignoredSegment=nullptr) const |
| const std::vector< GraphicalWireSegment * > & | getSegments () const |
| void | clearSegments (QGraphicsScene &scene) |
Deletes all managed graphical wire segments from scene. | |
| void | replaceSegments (QGraphicsScene &scene, std::span< const RoutedWire > routedSegments) |
| Replaces all managed graphical wire segments with routed segments. | |
| void | setChangedCallback (ChangeCallback cb) |
| Sets the callback for geometry, connectivity, and electrical changes. | |
| void | notifyTopologyChanged () const |
| Force execute the callback natively mapped to topological splits, merges, or drags. | |
| void | notifyElectricalChanged () const |
| Notifies listeners of an electrical change, deferring delivery within a batch. | |
| void | clear () |
Static Public Member Functions | |
| static std::vector< GraphicalWireSegment * > | segmentNeighbors (GraphicalWireSegment *segment) |
| static bool | segmentsTouching (const GraphicalWireSegment *segment, const GraphicalWireSegment *other) |
Private Types | |
| using | TopologyGraph |
| using | VertexDescriptor = boost::graph_traits<TopologyGraph>::vertex_descriptor |
Private Member Functions | |
| void | calculateJunctionsFor (std::span< GraphicalWireSegment *const > segments) const |
| Updates endpoint junction flags for the supplied registered segments. | |
| void | finishBatch () |
| Finishes one batch level and flushes pending edits and changes at the outermost level. | |
| void | discardBatch () noexcept |
| Drops one batch level and clears pending work when no batch remains. | |
| void | notify (Change change) const |
| Delivers change flags to the callback or accumulates them in an active batch. | |
| GraphicalWireSegment * | registeredSegment (uint64_t id) const |
| Returns the registered segment with the given identifier, or nullptr. | |
| uint64_t | createVertex (QPointF position, VertexKind kind=VertexKind::FreeEndpoint) |
| Creates a topology vertex and attaches matching port anchors. | |
| void | rebuildTopologyEdges () |
| Rebuilds graph edges by splitting each segment route at its electrical vertices. | |
Private Attributes | |
| TopologyGraph | topologyGraph |
| std::map< uint64_t, VertexDescriptor > | vertexDescriptors |
| std::vector< std::shared_ptr< GraphicalWire > > | managedWires |
| std::vector< GraphicalWireSegment * > | allSegments |
| ChangeCallback | onChanged |
| Callback invoked when wire topology changes (splits, merges, drags). | |
| unsigned int | batchDepth = 0 |
| bool | rebuildPending = false |
| uint8_t | pendingChanges = 0 |
| std::vector< uint64_t > | pendingEdits |
| TopologyVertexMap | vertices |
| TopologyEdgeMap | edges |
| std::map< uint64_t, SegmentTopology > | segmentTopology |
| uint64_t | nextVertexId = 1 |
| uint64_t | nextEdgeId = 1 |
| PortAnchorProvider | portAnchors |
Definition at line 58 of file wireManager.hpp.
| using ChangeCallback = std::function<void(Change)> |
Definition at line 61 of file wireManager.hpp.
| using PortAnchorProvider = std::function<std::vector<PortAnchor>()> |
Definition at line 97 of file wireManager.hpp.
| using TopologyEdgeMap = std::map<uint64_t, TopologyEdge> |
Definition at line 84 of file wireManager.hpp.
|
private |
Definition at line 266 of file wireManager.hpp.
| using TopologyVertexMap = std::map<uint64_t, TopologyVertex> |
Definition at line 83 of file wireManager.hpp.
|
private |
Definition at line 268 of file wireManager.hpp.
|
strong |
| Enumerator | |
|---|---|
| None | |
| Geometry | |
| Connectivity | |
| Electrical | |
Definition at line 60 of file wireManager.hpp.
|
strong |
| Enumerator | |
|---|---|
| FreeEndpoint | |
| Junction | |
| Port | |
Definition at line 62 of file wireManager.hpp.
|
default |
|
inline |
Definition at line 176 of file wireManager.hpp.
|
delete |
|
delete |
| void addSegment | ( | GraphicalWireSegment * | segment, |
| bool | updateTopology = true ) |
Definition at line 479 of file wireManager.cpp.
| void calculateJunctions | ( | ) | const |
Definition at line 518 of file wireManager.cpp.
| void calculateJunctions | ( | GraphicalWireSegment * | segment, |
| bool | includeNeighborhood = true ) const |
Definition at line 523 of file wireManager.cpp.
|
private |
Updates endpoint junction flags for the supplied registered segments.
Definition at line 537 of file wireManager.cpp.
| void clear | ( | ) |
Definition at line 370 of file wireManager.cpp.
| void clearSegments | ( | QGraphicsScene & | scene | ) |
Deletes all managed graphical wire segments from scene.
Definition at line 395 of file wireManager.cpp.
|
nodiscard |
Rebuilds connectivity after segment positions have been translated.
| translations | Segment identifiers and applied scene displacements. |
Definition at line 360 of file wireManager.cpp.
|
private |
Creates a topology vertex and attaches matching port anchors.
Definition at line 135 of file wireManager.cpp.
| std::shared_ptr< GraphicalWire > createWire | ( | unsigned int | busSize = 1 | ) |
Definition at line 460 of file wireManager.cpp.
|
privatenoexcept |
Drops one batch level and clears pending work when no batch remains.
Definition at line 116 of file wireManager.cpp.
|
private |
Finishes one batch level and flushes pending edits and changes at the outermost level.
Definition at line 85 of file wireManager.cpp.
|
inlinenodiscard |
Borrowed until segments are registered or removed. Copy for mutation loops.
Definition at line 225 of file wireManager.hpp.
|
private |
Delivers change flags to the callback or accumulates them in an active batch.
Definition at line 104 of file wireManager.cpp.
|
inline |
Notifies listeners of an electrical change, deferring delivery within a batch.
Definition at line 260 of file wireManager.hpp.
|
inline |
Force execute the callback natively mapped to topological splits, merges, or drags.
Definition at line 254 of file wireManager.hpp.
|
delete |
|
delete |
| void rebuildFromGeometry | ( | ) |
Derives electrical groups, junctions, and port vertices from segment geometry.
Definition at line 242 of file wireManager.cpp.
|
private |
Rebuilds graph edges by splitting each segment route at its electrical vertices.
Definition at line 184 of file wireManager.cpp.
| void refreshPortAnchors | ( | ) |
Refreshes port references after components enter or leave the scene.
Definition at line 152 of file wireManager.cpp.
|
private |
Returns the registered segment with the given identifier, or nullptr.
Definition at line 127 of file wireManager.cpp.
| void removeSegment | ( | GraphicalWireSegment * | segment | ) |
Definition at line 498 of file wireManager.cpp.
| void removeWire | ( | GraphicalWire * | wire | ) |
Definition at line 468 of file wireManager.cpp.
| void replaceSegments | ( | QGraphicsScene & | scene, |
| std::span< const RoutedWire > | routedSegments ) |
Replaces all managed graphical wire segments with routed segments.
Definition at line 424 of file wireManager.cpp.
|
nodiscard |
Definition at line 554 of file wireManager.cpp.
|
static |
Definition at line 575 of file wireManager.cpp.
|
staticnodiscard |
Definition at line 597 of file wireManager.cpp.
|
inline |
Sets the callback for geometry, connectivity, and electrical changes.
| cb | Callback receiving combined change flags; an empty callback disables delivery. |
Definition at line 245 of file wireManager.hpp.
|
inline |
Sets the provider of current component port anchors in scene coordinates.
Definition at line 111 of file wireManager.hpp.
|
inlinenodiscard |
Borrows the topology edge map until the topology is modified.
Definition at line 107 of file wireManager.hpp.
|
nodiscard |
Borrows segment topology until rebuilt; missing segments return an empty topology.
Definition at line 145 of file wireManager.cpp.
|
inlinenodiscard |
Borrows the topology vertex map until the topology is modified.
Definition at line 105 of file wireManager.hpp.
| void updateSegmentTopology | ( | GraphicalWireSegment * | segment | ) |
Definition at line 510 of file wireManager.cpp.
|
inlinenodiscard |
Definition at line 185 of file wireManager.hpp.
|
private |
Definition at line 273 of file wireManager.hpp.
|
private |
Definition at line 277 of file wireManager.hpp.
|
private |
Definition at line 282 of file wireManager.hpp.
|
private |
Definition at line 272 of file wireManager.hpp.
|
private |
Definition at line 285 of file wireManager.hpp.
|
private |
Definition at line 284 of file wireManager.hpp.
|
private |
Callback invoked when wire topology changes (splits, merges, drags).
Definition at line 276 of file wireManager.hpp.
|
mutableprivate |
Definition at line 279 of file wireManager.hpp.
|
private |
Definition at line 280 of file wireManager.hpp.
|
private |
Definition at line 286 of file wireManager.hpp.
|
private |
Definition at line 278 of file wireManager.hpp.
|
private |
Definition at line 283 of file wireManager.hpp.
|
private |
Definition at line 269 of file wireManager.hpp.
|
private |
Definition at line 270 of file wireManager.hpp.
|
private |
Definition at line 281 of file wireManager.hpp.