Skip to main content

Module route_tool

Module route_tool 

Source

Structsยง

PreviewCache ๐Ÿ”’
Everything cached across frames of one route gesture while only the cursor moves. The graph (obstacles + existing routes + start + waypoints) and the fixed start โ†’ โ€ฆ โ†’ last waypoint legs are both invariant until a waypoint is added, so both are computed once. Keyed by start + waypoint count.
PreviewRequest ๐Ÿ”’
The in-progress route a preview frame lays out: where it starts, the waypoints committed so far, and the cursor it currently reaches to.
RouteTool

Enumsยง

FinishTarget ๐Ÿ”’
Where an in-progress route proposes to end. An existing pin resolves to its anchor directly; a free slotโ€™s marker names the block and slot where the pin will be reconstructed at commit time, along with its prospective connection point.
RouteToolState ๐Ÿ”’

Functionsยง

route_in_progress ๐Ÿ”’
Route an in-progress route (start โ†’ each waypoint โ†’ end) against a freshly built closed router, seeding the endpoints and waypoints so they are graph nodes. Used at commit time, where the exact final geometry (and the routeโ€™s own occupancy) matters. The live preview instead routes against a cached router (see RouteTool::preview_route).
waypoint_nodes ๐Ÿ”’
The in-progress corners as the router speaks them: waypoints are positional, so a cornerโ€™s identity is its index in the list.
waypoint_point ๐Ÿ”’