示例#1
0
        SortedList <Double, TreePathVertice> GetVerticesInProximalOrder(PointD to)
        {
            SortedList <Double, TreePathVertice> list = new SortedList <Double, TreePathVertice>();

            foreach (TreePathVertice vertice in _vertices.Values)
            {
                Double distance = FlatGeo.GetDistance(vertice.Position, to);
                while (list.ContainsKey(distance))
                {
                    distance += .001;
                }
                list.Add(distance, vertice);
            }

            return(list);
        }
示例#2
0
        PointD FindClosestPointOnOriginalPath(PointD to)
        {
            PointD proximal = null;
            Double shortest = Double.MaxValue;

            foreach (Line line in m_Lines)
            {
                PointD point    = line.ClosestPointTo(to);
                Double distance = FlatGeo.GetDistance(point, to);
                if (distance < shortest)
                {
                    shortest = distance;
                    proximal = point;
                }
            }

            return(proximal);
        }
示例#3
0
 protected virtual Double GetNativeDistance(PointD p1, PointD p2)
 {
     return(FlatGeo.GetDistance(p1 as PointD, p2 as PointD));
 }