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 /// <since_tizen>3</since_tizen>
27 public class RouteSegment
29 private Geocoordinates _origin;
30 private Geocoordinates _destination;
31 private double _distance;
32 private double _duration;
33 private Area _boundingBox;
35 private List<RouteManeuver> _maneuvers = new List<RouteManeuver>();
36 private List<Geocoordinates> _path = new List<Geocoordinates>();
38 internal RouteSegment(Interop.RouteSegmentHandle handle)
40 _origin = new Geocoordinates(handle.Origin);
41 _destination = new Geocoordinates(handle.Destination);
42 _distance = handle.Distance;
43 _duration = handle.Duration;
44 _boundingBox = new Area(handle.BoundingBox);
46 handle.ForeachManeuver(maneuverHandle => _maneuvers.Add(new RouteManeuver(maneuverHandle)));
47 handle.ForeachPath(pathHandle => _path.Add(new Geocoordinates(pathHandle)));
51 /// Gets an origin coordinates for this segment.
53 /// <since_tizen>3</since_tizen>
54 public Geocoordinates Origin { get { return _origin; } }
57 /// Gets a destination coordinates for this segment.
59 /// <since_tizen>3</since_tizen>
60 public Geocoordinates Destination { get { return _destination; } }
63 /// Gets total distance for this segment.
65 /// <since_tizen>3</since_tizen>
66 public double Distance { get { return _distance; } }
69 /// Gets total duration to cover this segment.
71 /// <since_tizen>3</since_tizen>
72 public double Duration { get { return _duration; } }
75 /// Gets a maneuver list for this segment.
77 /// <since_tizen>3</since_tizen>
78 public IEnumerable<RouteManeuver> Maneuvers { get { return _maneuvers; } }
81 /// Gets a coordinates list for this segment.
83 /// <since_tizen>3</since_tizen>
84 public IEnumerable<Geocoordinates> Path { get { return _path; } }
86 private Area BoundingBox { get { return _boundingBox; } }