2 Situare - A location system for Facebook
3 Copyright (C) 2010 Ixonos Plc. Authors:
5 Sami Rämö - sami.ramo@ixonos.com
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.
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.
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,
23 #ifndef ROUTESEGMENT_H
24 #define ROUTESEGMENT_H
30 * @brief Container for a single route segment data
32 * Contains all data for a single route segment.
34 * @author Sami Rämö - sami.ramo@ixonos.com
44 /*******************************************************************************
45 * MEMBER FUNCTIONS AND SLOTS
46 ******************************************************************************/
48 * @brief Getter for azimuth
50 * @return Azimuth (in degrees)
52 qreal azimuth() const;
55 * @brief Getter for earth direction code of the start of the segment
57 * @returns Earth direction (N, NE, E, SE, S, SW, W, NW)
59 const QString& earthDirection() const;
62 * @brief Getter for text instruction
64 * e.g. Turn left at Oxford Street
66 * @returns Instruction text
68 const QString& instruction() const;
71 * @brief Getter for segment length
73 * @returns Length of the segment in meters
78 * @brief Getter for length caption text
80 * e.g. 22m, 23.4 km, 14.4 miles
82 * @returns Length of the segment text
84 const QString& lengthCaption() const;
87 * @brief Getter for the route geometry position index of the segment
89 * @returns Index of the first point of the segment in route geometry
91 int positionIndex() const;
96 * @param azimuth Azimuth (in degrees)
98 void setAzimuth(qreal azimuth);
101 * @brief Set earth direction code of the start of the segment
103 * @param direction Direction code
105 void setEarthDirection(const QString &direction);
108 * @brief Set instruction text
110 * @param instruction Instructon text
112 void setInstruction(const QString &instruction);
117 * @param meters Length in meters
119 void setLength(qreal meters);
122 * @brief Set length caption text
124 * @param length Length caption text
126 void setLengthCaption(const QString &length);
129 * @brief Set position index
131 * @param index Position index
133 void setPositionIndex(int index);
136 * @brief Set estimated travel time of the segment
138 * @param seconds Estimated travel time in seconds
140 void setTime(int seconds);
143 * @brief Set turn angle
145 * @param degrees Turn angle in degrees
147 void setTurnAngle(qreal degrees);
150 * @brief Set turn type code
152 * @param type Turn type code
154 void setTurnType(const QString &type);
157 * @brief Get street name/number parsed from the text instruction
159 * @returns Street name/number, or empty QString if value is missing
161 QString street() const;
164 * @brief Getter for estimated travel time of the segment
166 * @returns Estimated travel time of the segment in seconds
171 * @brief Getter for turn angle
173 * @returns Turn angle in degrees
175 qreal turnAngle() const;
178 * @brief Getter for turn type code
181 * C continue (go straight)
183 * TSLL turn slight left
184 * TSHL turn sharp left
186 * TSLR turn slight right
187 * TSHR turn sharp right
190 * @returns Turn type code
192 const QString& turnType() const;
194 /*******************************************************************************
196 ******************************************************************************/
198 int m_timeSeconds; ///< estimated time required to travel the segment in seconds
199 int m_positionIndex; ///< index of the first point of the segment in route geometry
201 qreal m_azimuth; ///< azimuth
202 qreal m_length; ///< length of the segment in meters
203 qreal m_turnAngle; ///< angle in degress of the turn between two segments, 0 for straight
205 QString m_earthDirection; ///< direction: N, NE, E, SE, S, SW, W, NW
206 QString m_instruction; ///< text instruction, e.g. Turn left at Oxford Street
207 QString m_lengthCaption; ///< length of the segment e.g. 22m, 23.4 km, 14.4 miles
208 QString m_turnType; ///< code of the turn type, optional, absent for the first segment
211 #endif // ROUTESEGMENT_H