#include <localWireEditor.hpp>
|
| | LocalWireEditor (std::span< const RoutingComponent > components, std::span< const RoutingSegment > segments, qreal gridSize) |
| | Borrows the original geometry for local wire edits.
|
| RoutePreview | moveComponents (std::span< const ComponentRouteMove > moves) const |
| | Adjusts wire endpoints attached to moved component ports.
|
| RoutePreview | moveBend (uint64_t segmentId, std::size_t index, QPointF position) const |
| | Moves an interior bend and adjusts electrically attached branches.
|
| RoutePreview | moveEdge (uint64_t segmentId, std::size_t index, QPointF displacement) const |
| | Offsets an edge perpendicular to its direction, preserving endpoints.
|
| bool | valid (std::span< const RoutedSegment > routes, uint64_t editedSegment) const |
| | Checks route geometry, obstacles, and preservation of electrical contacts.
|
|
| QPointF | snap (QPointF point) const |
| | Snaps a scene point to the grid when the grid spacing is positive.
|
| const RoutingSegment * | find (uint64_t id) const |
| | Returns the borrowed segment with the given identifier, or nullptr.
|
| RoutePreview | finish (uint64_t editedId, std::vector< RoutedSegment > routes) const |
| | Canonicalizes and validates edits, then fills in unchanged snapshot routes.
|
|
| static std::optional< std::vector< QPointF > > | moveAttachedEndpoint (const RoutingSegment &segment, bool first, QPointF destination) |
| | Adjusts one endpoint while keeping its route orthogonal.
|
Applies predictable, grid-aligned edits to an existing wire polyline.
Definition at line 30 of file localWireEditor.hpp.
◆ LocalWireEditor()
Borrows the original geometry for local wire edits.
- Parameters
-
| components | Component obstacles and ports in scene coordinates. |
| segments | Wire routes and electrical contacts in scene coordinates. |
| gridSize | Grid spacing; nonpositive values disable snapping. |
- Note
- The referenced component and segment storage must outlive this editor.
Definition at line 40 of file localWireEditor.cpp.
◆ find()
Returns the borrowed segment with the given identifier, or nullptr.
Definition at line 55 of file localWireEditor.cpp.
◆ finish()
Canonicalizes and validates edits, then fills in unchanged snapshot routes.
- Parameters
-
| editedId | Edited segment identifier, or zero for component moves. |
| routes | Candidate route changes. |
- Returns
- Complete snapshot routes, or no value if validation fails.
Definition at line 244 of file localWireEditor.cpp.
◆ moveAttachedEndpoint()
| std::optional< std::vector< QPointF > > moveAttachedEndpoint |
( |
const RoutingSegment & | segment, |
|
|
bool | first, |
|
|
QPointF | destination ) |
|
staticnodiscardprivate |
Adjusts one endpoint while keeping its route orthogonal.
- Parameters
-
| segment | Original route to edit. |
| first | Whether to move the first endpoint instead of the last. |
| destination | New endpoint position in scene coordinates. |
- Returns
- Adjusted points, or no value if the original route has fewer than two points.
Definition at line 126 of file localWireEditor.cpp.
◆ moveBend()
| RoutePreview moveBend |
( |
uint64_t | segmentId, |
|
|
std::size_t | index, |
|
|
QPointF | position ) const |
|
nodiscard |
Moves an interior bend and adjusts electrically attached branches.
- Parameters
-
| segmentId | Identifier of the segment to edit. |
| index | Interior point index in the original route. |
| position | Destination in scene coordinates, snapped to the grid. |
- Returns
- Complete snapshot routes, or no value if the local edit is invalid.
Definition at line 150 of file localWireEditor.cpp.
◆ moveComponents()
Adjusts wire endpoints attached to moved component ports.
- Parameters
-
| moves | Component identifiers and destination bounds in scene coordinates. |
- Returns
- Complete snapshot routes, or no value if the local edit is invalid.
Definition at line 61 of file localWireEditor.cpp.
◆ moveEdge()
| RoutePreview moveEdge |
( |
uint64_t | segmentId, |
|
|
std::size_t | index, |
|
|
QPointF | displacement ) const |
|
nodiscard |
Offsets an edge perpendicular to its direction, preserving endpoints.
- Parameters
-
| segmentId | Identifier of the segment to edit. |
| index | Index of the edge's first point. |
| displacement | Offset in scene coordinates, snapped to the grid. |
- Returns
- Complete snapshot routes, or no value if the local edit is invalid.
Definition at line 189 of file localWireEditor.cpp.
◆ snap()
| QPointF snap |
( |
QPointF | point | ) |
const |
|
nodiscardprivate |
Snaps a scene point to the grid when the grid spacing is positive.
Definition at line 46 of file localWireEditor.cpp.
◆ valid()
| bool valid |
( |
std::span< const RoutedSegment > | routes, |
|
|
uint64_t | editedSegment ) const |
|
nodiscard |
Checks route geometry, obstacles, and preservation of electrical contacts.
- Parameters
-
| routes | Candidate routes; omitted segments retain their original geometry. |
| editedSegment | Edited segment identifier, or zero for component moves. |
- Returns
- Whether the candidates satisfy the shared local and automatic routing checks.
Definition at line 261 of file localWireEditor.cpp.
◆ components
◆ gridSize
◆ segments
The documentation for this class was generated from the following files: