Exemplo n.º 1
0
        public typRoute(Route pathpoints)
        {
            arr_legs = new List <typLegSector>();


            DPoint[] points = pathpoints.Points.ToArray <DPoint>();

            for (int i = 0; i < points.Length - 1; i++)
            {
                typLegSector leg = new typLegSector();
                leg.FromLongn   = points[i].x;
                leg.FromLatn    = points[i].y;
                leg.ToLongn     = points[i + 1].x;
                leg.ToLatn      = points[i + 1].y;
                leg.LegDistance = (float)TerrainService.MathEngine.CalcDistance(leg.FromLongn, leg.FromLatn, leg.ToLongn, leg.ToLatn) / 1000f;
                if (leg.LegDistance == 0.0)
                {
                    continue;
                }
                arr_legs.Add(leg);
            }
        }
Exemplo n.º 2
0
        public typRoute(Route pathpoints)
        {
            arr_legs = new List<typLegSector>();

            
            DPoint[] points = pathpoints.Points.ToArray<DPoint>();

            for (int i = 0; i < points.Length-1; i++)
            {
                typLegSector leg = new typLegSector();
                leg.FromLongn = points[i].x;
                leg.FromLatn = points[i].y;
                leg.ToLongn = points[i+1].x;
                leg.ToLatn = points[i+1].y;
                leg.LegDistance = (float)TerrainService.MathEngine.CalcDistance(leg.FromLongn, leg.FromLatn, leg.ToLongn, leg.ToLatn) / 1000f;
                if (leg.LegDistance == 0.0)
                {
                    continue;
                }
                arr_legs.Add(leg);
            }
        }