2 * Copyright (c) 2016 Samsung Electronics Co., Ltd All Rights Reserved
4 * Licensed under the Apache License, Version 2.0 (the License);
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
8 * http://www.apache.org/licenses/LICENSE-2.0
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an AS IS BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
19 using System.Collections.Generic;
24 /// Place Segment information, used in Route Search requests
26 public class RouteSegment
28 private Geocoordinates _origin;
29 private Geocoordinates _destination;
30 private double _distance;
31 private double _duration;
32 private Area _boundingBox;
34 private List<RouteManeuver> _maneuvers = new List<RouteManeuver>();
35 private List<Geocoordinates> _path = new List<Geocoordinates>();
37 internal RouteSegment(Interop.RouteSegmentHandle handle)
39 _origin = new Geocoordinates(handle.Origin);
40 _destination = new Geocoordinates(handle.Destination);
41 _distance = handle.Distance;
42 _duration = handle.Duration;
43 _boundingBox = new Area(handle.BoundingBox);
45 handle.ForeachManeuver(maneuverHandle => _maneuvers.Add(new RouteManeuver(maneuverHandle)));
46 handle.ForeachPath(pathHandle => _path.Add(new Geocoordinates(pathHandle)));
50 /// Gets an origin coordinates for this segment.
52 public Geocoordinates Origin { get { return _origin; } }
55 /// Gets a destination coordinates for this segment.
57 public Geocoordinates Destination { get { return _destination; } }
60 /// Gets total distance for this segment.
62 public double Distance { get { return _distance; } }
65 /// Gets total duration to cover this segment.
67 public double Duration { get { return _duration; } }
70 /// Gets a maneuver list for this segment.
72 public IEnumerable<RouteManeuver> Maneuvers { get { return _maneuvers; } }
75 /// Gets a coordinates list for this segment.
77 public IEnumerable<Geocoordinates> Path { get { return _path; } }
79 private Area BoundingBox { get { return _boundingBox; } }