2 * Copyright (C) 2013 HERE Global B.V. All rights reserved.
3 * This software, including documentation, is protected by copyright controlled by
4 * HERE Global B.V. (“Software”). All rights are reserved. Copying, including reproducing,
5 * storing, adapting or translating, any or all of this material requires the prior
6 * written consent of HERE Global B.V. You may use this
7 * Software in accordance with the terms and conditions defined in the
8 * HERE Location Platform Services Terms and Conditions, available at
9 * http://developer.here.com/terms-conditions-base
11 * As an additional permission to the above, you may distribute Software,
12 * in object code format as part of an Application, according to, and subject to, terms and
13 * conditions defined in the Tizen Software Development kit (“SDK”) License Agreement.
14 * You may distribute such object code format Application under terms of your choice,
15 * provided that the header and source files of the Software have not been modified.
18 #ifndef ROUTESEGMENT_H
19 #define ROUTESEGMENT_H
21 #include "common/HereMaps_global.h"
22 #include "common/GeoCoordinates.h"
23 #include "routes/Maneuver.h"
25 HERE_MAPS_BEGIN_NAMESPACE
28 class RouteSegmentImpl;
33 * This typedef defines a vector of instances of <code>RouteSegment</code> as a
38 typedef std::vector<RouteSegment> RouteSegmentList;
42 * This class encapsulates a route segment which is a section of a route between
43 * two waypoints. A number of properties define a route segment, including the
44 * time required to travel it, its length, path (geometry), and maneuvers.
48 class EXPORT_API RouteSegment
53 * This method is the default constructor. It creates an invalid object,
54 * with both travel time and distance set to zero.
59 * This method is a copy constructor that initializes a new instance of the
60 * class, using the property values from the object supplied by the caller.
62 * @param rRhs A constant reference to an object whose property values are to
63 * be used to initialize a new instance of <code>RouteSegment</code>.
65 RouteSegment(const RouteSegment& rRhs);
68 * This method is the destructor.
73 * This is the assignment operator.
75 * @param rRhs A constant reference to an object whose property values are to
76 * be copied to the given instance of <code>RouteSegment</code>.
78 * @return A reference to the given instance of the class after the
81 RouteSegment& operator = (const RouteSegment& rRhs);
85 * This method checks if the given instance of the class is valid. A segment
86 * is valid if, at a minimum, its path property is defined.
88 * @return <code>true</code> if the object is valid, otherwise
94 * This method sets the route segment travel time.
96 * @param aSecs A value indicating the length of time required to travel the
97 * length of the route segment in seconds.
99 void SetTravelTime(int aSecs);
102 * This method retrieves the route segment travel time.
104 * @return A value indicating time required to travel the
105 * length of the route segment in seconds.
107 int GetTravelTime() const;
110 * This method sets the route segment length.
112 * @param aDistance A value indicating the length of the
113 * the route segment in meters.
115 void SetDistance(double aDistance);
118 * This method retrieves the length of the route segment.
120 * @return A value indicating the length of the
121 * the route segment in meters.
123 double GetDistance() const;
126 * This method sets the path (geometry) of the route segment.
128 * @param rPath A constant reference to a vector of instances of
129 * <code>GeoCoordinates</code> which defines the path (geometry) of
132 void SetPath(const GeoCoordinateList& rPath);
135 * This method retrieves the path (geometry) of the route segment.
137 * @return A vector of instances of <code>GeoCoordinates</code> which
138 * defines the path (geometry) of the route segment.
140 GeoCoordinateList GetPath() const;
143 * This method adds a maneuver to the given route segment.
145 * @param rManeuver A constant reference to an object that defines a route
148 void addManeuver(const Maneuver& rManeuver);
151 * This method associates a list of maneuvers with the given route segment.
153 * @param vManeuverList A constant reference to a vector of route maneuver
156 void SetManeuverList(const ManeuverList& vManeuverList);
159 * This method retrieves a list of maneuvers associated with the given route
162 * @return A vector of route maneuver objects.
164 ManeuverList GetManeuverList() const;
167 RouteSegmentImpl* m_pImpl;
169 friend class RouteSegmentImpl;
172 HERE_MAPS_END_NAMESPACE
174 #endif /* ROUTESEGMENT_H */