package layoutgraph

import 

// RoutingCostState is the cached routing-cost state that an atomic routing
// stage must restore on failure.
type RoutingCostState struct {
	Crossing      float64
	Turn          float64
	NonCenterPort float64
}

func ( *Graph) () RoutingCostState {
	.costMu.RLock()
	defer .costMu.RUnlock()
	return RoutingCostState{
		Crossing:      .crossingCost,
		Turn:          .turnCost,
		NonCenterPort: .nonCenterPortCost,
	}
}

func ( *Graph) ( RoutingCostState) {
	.costMu.Lock()
	defer .costMu.Unlock()
	.crossingCost = .Crossing
	.turnCost = .Turn
	.nonCenterPortCost = .NonCenterPort
}

func ( *EdgeSegment) () *Edge { return .edge }

func ( *Graph) () float64      { return .crossingCostValue() }
func ( *Graph) () float64 { return .nonCenterPortCostValue() }

func ( *Edge) () EntityID                           { return .entityID() }
func ( *Edge) ( *Edge) bool              { return .isDuplicateOf() }
func ( *Edge) ( []*Edge) bool           { return .hasDuplicateIn() }
func ( *Edge) ( *Edge) bool         { return .hasMatchingArrowheads() }
func ( *Edge) () bool                    { return .ownArrowheadsMatch() }
func ( *Edge) () bool                            { return .isStraight() }
func ( *Edge) () bool                     { return .hasOverlappingEnd() }
func ( *Edge) () float64                  { return .euclideanDistance() }
func ( *Edge) () bool                            { return .isTreeEdge() }
func ( Edges) ( *Node) map[geo.Point][]*Edge { return .portEdges() }

func ( *Node) ( *geo.Point,  float64) bool {
	return .containsPoint(, )
}

func ( *Node) ( geo.Orientation) []geo.Point {
	return .portsByOrientation()
}

func ( *Node) () []geo.Point                 { return .centerPorts() }
func ( *Node) ( *geo.Point) bool { return .isPointOnNode() }
func ( *Node) ( *geo.Point) bool        { return .isPointNear() }
func ( *Node) (,  *geo.Point) bool {
	return .isWithinBounds(, )
}
func ( *Node) ( *geo.Point) geo.Orientation {
	return .pointToPortOrientation()
}
func ( *Node) () map[geo.Point]geo.Point { return .mirroredPorts() }
func ( *Node) ( *Node) map[geo.Point]bool {
	return .overlappingPorts()
}
func ( *Node) ( *Node,  bool) float64 {
	return .distanceTo(, )
}
func ( Nodes) ( *Edge) bool { return .intersectsNode() }