/// <summary>
        /// switch flips
        /// </summary>
        bool RemoveDoublePathCrossings()
        {
            bool progress = new PathFixer(metroGraphData, metroGraphData.PointIsAcceptableForEdge).Run();

            if (progress)
            {
                metroGraphData.Initialize(false);
                SimulatedAnnealing.FixRouting(metroGraphData, bundlingSettings);
            }

            return(progress);
        }
Пример #2
0
        void Swap(PolylinePoint aFirst, PolylinePoint bFirst, PolylinePoint aLast, PolylinePoint bLast, bool forwardOrderA, bool forwardOrderB)
        {
            List <PolylinePoint> intermediateAPoints = GetRangeOnPolyline(Next(aFirst, forwardOrderA), aLast, forwardOrderA);
            List <PolylinePoint> intermediateBPoints = GetRangeOnPolyline(Next(bFirst, forwardOrderB), bLast, forwardOrderB);

            //changing a
            ChangePolylineSegment(aFirst, aLast, forwardOrderA, intermediateBPoints);

            //changing b
            ChangePolylineSegment(bFirst, bLast, forwardOrderB, intermediateAPoints);

            //resulting polylines might have cycles
            PathFixer.RemoveSelfCyclesFromPolyline(aFirst.Polyline);
            Debug.Assert(PolylineIsOK(aFirst.Polyline));

            PathFixer.RemoveSelfCyclesFromPolyline(bFirst.Polyline);
            Debug.Assert(PolylineIsOK(bFirst.Polyline));
        }
        /// <summary>
        /// switch flips
        /// </summary>
        bool RemoveDoublePathCrossings() {
            bool progress = new PathFixer(metroGraphData, metroGraphData.PointIsAcceptableForEdge).Run();

            if (progress) {
                metroGraphData.Initialize(false);
                SimulatedAnnealing.FixRouting(metroGraphData, bundlingSettings);
            }

            return progress;
        }