SILICON
Loading...
Searching...
No Matches
InteractiveWireRouter Class Reference

#include <interactiveWireRouter.hpp>

Classes

struct  Request

Public Member Functions

 InteractiveWireRouter (std::vector< RoutingComponent > components, std::vector< RoutingSegment > segments, qreal gridSize)
 Owns a snapshot used as the starting geometry for every routing preview.
RoutePreview routeComponents (std::span< const ComponentRouteMove > moves) const
 Routes wires around moved components while preserving their connections.
RoutePreview routeWireBend (uint64_t segmentId, std::size_t bendIndex, QPointF position) const
 Moves an interior bend and routes electrically attached branches.
RoutePreview routeWireEndpoint (uint64_t segmentId, std::size_t endpointIndex, QPointF position) const
 Routes a wire with one endpoint moved to a new position.
RoutePreview routeWireEdge (uint64_t segmentId, std::size_t edgeIndex, QPointF displacement) const
 Moves an edge perpendicular to its original direction.

Private Types

enum class  Handle { None , Bend , Edge , Endpoint }

Private Member Functions

RoutePreview routeWithLibavoid (Request request) const
 Routes a validated request with libavoid and checks the resulting geometry.

Private Attributes

std::vector< RoutingComponent > components
std::vector< RoutingSegment > segments
qreal gridSize

Detailed Description

A gesture-local snapshot. Each preview is routed from the same original geometry.

Definition at line 44 of file interactiveWireRouter.hpp.

Member Enumeration Documentation

◆ Handle

enum class Handle
strongprivate
Enumerator
None 
Bend 
Edge 
Endpoint 

Definition at line 95 of file interactiveWireRouter.hpp.

Constructor & Destructor Documentation

◆ InteractiveWireRouter()

InteractiveWireRouter ( std::vector< RoutingComponent > components,
std::vector< RoutingSegment > segments,
qreal gridSize )

Owns a snapshot used as the starting geometry for every routing preview.

Parameters
componentsComponent obstacles and ports in scene coordinates.
segmentsOriginal wire routes and electrical contacts in scene coordinates.
gridSizeGrid spacing used to align routed geometry.

Definition at line 187 of file interactiveWireRouter.cpp.

Member Function Documentation

◆ routeComponents()

RoutePreview routeComponents ( std::span< const ComponentRouteMove > moves) const
nodiscard

Routes wires around moved components while preserving their connections.

Parameters
movesComponent identifiers and destination bounds in scene coordinates.
Returns
Snapshot routes for the preview, or no value if routing fails.

Definition at line 194 of file interactiveWireRouter.cpp.

◆ routeWireBend()

RoutePreview routeWireBend ( uint64_t segmentId,
std::size_t bendIndex,
QPointF position ) const
nodiscard

Moves an interior bend and routes electrically attached branches.

Parameters
segmentIdIdentifier of the segment to edit.
bendIndexInterior point index in the original route.
positionDestination in scene coordinates.
Returns
Snapshot routes for the preview, or no value if routing fails.

Definition at line 204 of file interactiveWireRouter.cpp.

◆ routeWireEdge()

RoutePreview routeWireEdge ( uint64_t segmentId,
std::size_t edgeIndex,
QPointF displacement ) const
nodiscard

Moves an edge perpendicular to its original direction.

Parameters
segmentIdIdentifier of the segment to edit.
edgeIndexIndex of the edge's first point in the original route.
displacementOffset in scene coordinates; the parallel component is ignored.
Returns
Snapshot routes for the preview, or no value if routing fails.

Definition at line 232 of file interactiveWireRouter.cpp.

◆ routeWireEndpoint()

RoutePreview routeWireEndpoint ( uint64_t segmentId,
std::size_t endpointIndex,
QPointF position ) const
nodiscard

Routes a wire with one endpoint moved to a new position.

Parameters
segmentIdIdentifier of the segment to edit.
endpointIndexZero for the first point, or the last point index.
positionDestination in scene coordinates.
Returns
Snapshot routes for the preview, or no value if routing fails.

Definition at line 219 of file interactiveWireRouter.cpp.

◆ routeWithLibavoid()

RoutePreview routeWithLibavoid ( Request request) const
nodiscardprivate

Routes a validated request with libavoid and checks the resulting geometry.

Parameters
requestComponent moves or a wire handle edit relative to the snapshot.
Returns
Preview routes, or no value for an invalid request or route.

Definition at line 248 of file interactiveWireRouter.cpp.

Member Data Documentation

◆ components

std::vector<RoutingComponent> components
private

Definition at line 112 of file interactiveWireRouter.hpp.

◆ gridSize

qreal gridSize
private

Definition at line 114 of file interactiveWireRouter.hpp.

◆ segments

std::vector<RoutingSegment> segments
private

Definition at line 113 of file interactiveWireRouter.hpp.


The documentation for this class was generated from the following files: