namespace StellaOps.ElkSharp; internal static partial class ElkEdgeRouterIterative { private static ElkRoutedEdge[] ApplyBoundaryFirstVerification( ElkRoutedEdge[] edges, ElkRoutedEdge[] originalEdges, ElkPositionedNode[] nodes, ElkLayoutDirection direction, double minLineClearance) { // Minimal structural safety only — the hybrid winner refinement // handles remaining violations after boundary-first is promoted. var result = ElkEdgePostProcessor.AvoidNodeCrossings(edges, nodes, direction); result = ElkEdgePostProcessor.EliminateDiagonalSegments(result, nodes); result = ElkEdgePostProcessorSimplify.SimplifyEdgePaths(result, nodes); result = ElkEdgePostProcessorSimplify.TightenOuterCorridors(result, nodes); if (HighwayProcessingEnabled) { result = ElkEdgeRouterHighway.BreakShortHighways(result, nodes); } // Normalize boundary geometry for the slot-pinned endpoints. result = ElkEdgePostProcessor.NormalizeBoundaryAngles(result, nodes); result = ElkEdgePostProcessor.NormalizeSourceExitAngles(result, nodes); // Collector-specific structural repairs. result = RestoreProtectedRepeatCollectorCorridors(result, originalEdges, nodes); // Below-graph clamping and final crossing check. result = ClampBelowGraphEdges(result, nodes); result = ElkEdgePostProcessor.AvoidNodeCrossings(result, nodes, direction); return result; } }