import { Shape } from './shape'; import { GeomEdge } from '../layout/core/geomEdge'; import { Point } from '../math/geometry/point'; import { Algorithm } from '../utils/algorithm'; import { ICurve, Polyline } from '../math/geometry'; import { PolylinePoint } from '../math/geometry/polylinePoint'; import { PointSet } from '../utils/PointSet'; import { BinaryRTree } from '../math/geometry/RTree/rTree'; import { VisibilityGraph } from './visibility/VisibilityGraph'; import { TightLooseCouple } from './TightLooseCouple'; import { VisibilityEdge } from './visibility/VisibilityEdge'; import { RectangleNode } from '../math/geometry/RTree/rectangleNode'; import { BundlingSettings } from './BundlingSettings'; import { CancelToken, GeomGraph } from '..'; import { EdgeRoutingSettings } from './EdgeRoutingSettings'; import { Port } from '../layout/core/port'; import { ShapeObstacleCalculator } from './ShapeObstacleCalculator'; import { InteractiveEdgeRouter } from './interactiveEdgeRouter'; import { PointPairMap } from '../utils/pointPairMap'; import { Cdt } from './ConstrainedDelaunayTriangulation/Cdt'; import { CdtEdge } from './ConstrainedDelaunayTriangulation/CdtEdge'; import { DebugCurve } from '../math/geometry/debugCurve'; import { Node } from '..'; /** routing edges around shapes */ export declare class SplineRouter extends Algorithm { continueOnOverlaps: boolean; obstacleCalculator: ShapeObstacleCalculator; /** each polyline points to the nodes within it, maximal with this property */ loosePolylinesToNodes: Map>; get ContinueOnOverlaps(): boolean; set ContinueOnOverlaps(value: boolean); rootShapes: Shape[]; coneAngle: number; tightPadding: number; loosePadding: number; get LoosePadding(): number; set LoosePadding(value: number); rootWasCreated: boolean; root: Shape; visGraph: VisibilityGraph; ancestorSets: Map>; shapesToTightLooseCouples: Map; portsToShapes: Map; portsToEnterableShapes: Map>; portRTree: BinaryRTree; looseRoot: Shape; BundlingSettings: BundlingSettings; enterableLoose: Map>; enterableTight: Map>; geomGraph: GeomGraph; multiEdgesSeparation: number; private routeMultiEdgesAsBundles; UseEdgeLengthMultiplier: boolean; UsePolylineEndShortcutting: boolean; UseInnerPolylingShortcutting: boolean; AllowedShootingStraightLines: boolean; get MultiEdgesSeparation(): number; set MultiEdgesSeparation(value: number); static mk2(graph: GeomGraph, edgeRoutingSettings: EdgeRoutingSettings): SplineRouter; static mk4(graph: GeomGraph, tightTightPadding: number, loosePadding: number, coneAngle: number): SplineRouter; static mk5(graph: GeomGraph, tightTightPadding: number, loosePadding: number, coneAngle: number, bundlingSettings: BundlingSettings): SplineRouter; constructor(graph: GeomGraph, edges: Array, tightPadding?: number, loosePadding?: number, coneAngle?: number, bundlingSettings?: BundlingSettings, cancelToken?: CancelToken); private edges; static mk6(graph: GeomGraph, tightPadding: number, loosePadding: number, coneAngle: number, inParentEdges: Array, outParentEdges: Array): SplineRouter; Initialize(obstacles: Array, coneAngleValue: number): void; run(): void; /** Uses the existing routes and optimizing them only to avoid 'activeNodes'. */ rerouteOnSubsetOfNodes(activeNodes: Set): void; calcLooseShapesToNodes(): void; RouteOnRoot(): void; CalculatePortsToEnterableShapes(): void; static EdgesAttachedToPortAvoidTheNode(port: Port): boolean; SetLoosePolylinesForAnywherePorts(): void; BindLooseShapes(): void; BindLooseShapesUnderShape(shape: Shape): void; CalculateShapeToBoundaries(shape: Shape): void; private _overlapsDetected; get OverlapsDetected(): boolean; set OverlapsDetected(value: boolean); get AdjustedLoosePadding(): number; GroupEdgesByPassport(): Array<{ passport: Set; edges: Array; }>; RouteOnVisGraph(): void; private rerouteOnActiveNodes; getDebugCurvesFromEdgesAndCdt(cdt: Cdt): DebugCurve[]; private RouteEdgesWithTheSamePassport; /** edgeToPolys maps edges to their original polyline routes */ private rerouteEdgesWithTheSamePassportActiveNodes; /** poly gives the polyline to reroute */ private rerouteEdge; private getCdtFromPassport; get RouteMultiEdgesAsBundles(): boolean; set RouteMultiEdgesAsBundles(value: boolean); private routeEdge; ScaleDownLooseHierarchy(interactiveEdgeRouter: InteractiveEdgeRouter, obstacleShapes: Set): void; RouteMultiEdges(multiEdges: Array, interactiveEdgeRouter: InteractiveEdgeRouter, parents: Set): void; SplitOnRegularAndMultiedges(edges: Iterable, t: { regularEdges: Array; multiEdges: Array; }): void; static RegisterInPortLocationsToEdges(eg: GeomEdge, portLocationPairsToEdges: PointPairMap>): void; static IsEdgeToParent(e: GeomEdge): boolean; CreateInteractiveEdgeRouter(obstacleShapes: Array): InteractiveEdgeRouter; GetObstaclesFromPassport(passport: Set): Set; GetAllAncestors(passport: Set): Set; GetCommonAncestorsAbovePassport(passport: Set): Set; RouteBundles(): void; CreateTheMapToParentLooseShapes(shape: Shape, loosePolylinesToLooseParentShapeMap: Map): void; FindCdtGates(cdt: Cdt): Set; CalculateEdgeEnterablePolylines(): void; GetEdgeEnterablePolylines(edge: GeomEdge, looseEnterable: Set, tightEnterable: Set): void; GetEnterablesForShape(shape: Shape, looseEnterable: Set, tightEnterable: Set): void; GetTightHierarchy(): RectangleNode; GetLooseHierarchy(): RectangleNode; ScaleLooseShapesDown(): void; /** * The set of shapes where the edge source and target ports shapes are citizens: the shapes who's interior the edge can cross * In the simple case it is the union of the target port shape parents and the sourceport shape parents. * When one end shape contains another, the passport is the set consisting of the end shape and all other shape parents. */ EdgePassport(edge: GeomEdge): Set; AllPorts(): IterableIterator; CalculatePortsToShapes(): void; RouteEdgeInternal(edge: GeomEdge, iRouter: InteractiveEdgeRouter): void; /** returns ToAncestorEnum.None if the source and the target are just siblings * ToAncestorEnum. if the source is a descendant of the target * -1 if the target is a descendant of the source */ LineSweeperPorts: Point[]; AddVisibilityEdgesFromPort(port: Port): IterableIterator; makeTransparentShapesOfEdgeAndGetTheShapes(edge: GeomEdge): Array; LooseShapeOfOriginalShape(s: Shape): Shape; LoosePolyOfOriginalShape(s: Shape): Polyline; TightPolyOfOriginalShape(s: Shape): Polyline; GetTransparentShapes(sourcePort: Port, targetPort: Port, sourceShape: Shape, targetShape: Shape): IterableIterator; static SetTransparency(shapes: Iterable, v: boolean): void; IsAncestor(possibleAncestor: Shape, possiblePredecessor: Shape): boolean; static CreateLooseObstacleHierarachy(loosePolys: Array): RectangleNode; CreateTightObstacleHierarachy(obstacles: Array): RectangleNode; CalculateVisibilityGraph(): void; private ProcessHookAnyWherePorts; FillVisibilityGraphUnderShape(shape: Shape): void; TryToCreateNewEdgeAndSetIsPassable(edge: VisibilityEdge, looseShape: Shape): void; AddBoundaryEdgesToVisGraph(boundary: Polyline): void; /** this run will split the polyline enough to route later from the inner ports */ RemoveInsidePortsAndSplitBoundaryIfNeeded(boundary: Polyline): PointSet; static FindPointOnPolylineToInsertAfter(boundary: Polyline, point: Point): PolylinePoint; GetOrCreateRoot(): void; RemoveRoot(): void; static GetAncestorSetsMap(shapes: Array): Map>; static GetAncestorSet(child: Shape, ancSets: Map>): Set; static CreatePortsIfNeeded(edges: GeomEdge[]): void; } export declare function routeSplines(gg: GeomGraph, edgesToRoute: GeomEdge[], cancelToken: CancelToken): void;