Added comment to tab index list appending.
[situare] / src / routing / route.h
1 /*
2     Situare - A location system for Facebook
3     Copyright (C) 2010  Ixonos Plc. Authors:
4
5         Sami Rämö - sami.ramo@ixonos.com
6
7     Situare is free software; you can redistribute it and/or
8     modify it under the terms of the GNU General Public License
9     version 2 as published by the Free Software Foundation.
10
11     Situare is distributed in the hope that it will be useful,
12     but WITHOUT ANY WARRANTY; without even the implied warranty of
13     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
14     GNU General Public License for more details.
15
16     You should have received a copy of the GNU General Public License
17     along with Situare; if not, write to the Free Software
18     Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301,
19     USA.
20 */
21
22
23 #ifndef ROUTE_H
24 #define ROUTE_H
25
26 #include <QList>
27 #include <QString>
28
29 #include "coordinates/geocoordinate.h"
30 #include "routesegment.h"
31
32 /**
33  * @brief Container for a single route
34  *
35  * Contains all data for a single route including route geometry points (a.k.a track points) and
36  * route segments.
37  *
38  * @author Sami Rämö - sami.ramo@ixonos.com
39  */
40 class Route
41 {
42 public:
43     /**
44     * @brief Constructor
45     */
46     Route();
47
48 /*******************************************************************************
49  * MEMBER FUNCTIONS AND SLOTS
50  ******************************************************************************/
51     /**
52     * @brief Append geometry point (a.k.a track point) of the route
53     *
54     * Appending must be done in order starting from the beginning of the route.
55     *
56     * @param geometryPoint Geometry point
57     */
58     void appendGeometryPoint(const GeoCoordinate &geometryPoint);
59
60     /**
61     * @brief Append a route segment to the route
62     *
63     * Appending must be done in order starting from the beginning of the route.
64     *
65     * @param segment Route segment object
66     */
67     void appendSegment(const RouteSegment &segment);
68
69     /**
70     * @brief Getter for route end point name
71     *
72     * @returns Name of the end point (or empty QString)
73     */
74     const QString& endPointName() const;
75
76     /**
77     * @brief Get list of geometry points
78     *
79     * @returns Reference to list of geometry points
80     */
81     const QList<GeoCoordinate>& geometryPoints() const;
82
83     /**
84     * @brief Get list of route segments
85     *
86     * @returns Reference to list of route segments
87     */
88     const QList<RouteSegment>& segments() const;
89
90     /**
91     * @brief Set name of the route end point
92     *
93     * @param endPoint Name of the end point
94     */
95     void setEndPointName(const QString &endPoint);
96
97     /**
98     * @brief Set name of the route start point
99     *
100     * @param startPoint Name of the route start point
101     */
102     void setStartPointName(const QString &startPoint);
103
104     /**
105     * @brief Set total distance of the route
106     *
107     * @param meters Total distance of the route in meters
108     */
109     void setTotalDistance(int meters);
110
111     /**
112     * @brief Set estimated total travel time of the route
113     *
114     * @param seconds Estimated total travel time
115     */
116     void setTotalTime(int seconds);
117
118     /**
119     * @brief Getter for route start point name
120     *
121     * @returns Name of the start point (or empty QString)
122     */
123     const QString& startPointName() const;
124
125     /**
126     * @brief Getter for total route distance
127     *
128     * @returns Total route distance in meters
129     */
130     int totalDistance() const;
131
132     /**
133     * @brief Getter for estimated travel time
134     *
135     * @returns Estimated travel time in seconds
136     */
137     int totalTime() const;
138
139 /*******************************************************************************
140  * DATA MEMBERS
141  ******************************************************************************/
142 private:
143     int m_totalDistance;                ///< route total distance in meters
144     int m_totalTime;                    ///< estimated route total time in seconds
145
146     QList<GeoCoordinate> m_geometryPoints;    ///< lat/lon coordinates of the route points
147     QList<RouteSegment> m_segments;     ///< route segments
148
149     QString m_endPointName;             ///< name of the route end point
150     QString m_startPointName;           ///< name of the route starting point
151 };
152
153 #endif // ROUTE_H