2 Situare - A location system for Facebook
3 Copyright (C) 2010 Ixonos Plc. Authors:
5 Kaj Wallin - kaj.wallin@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,
31 * @brief Map distance scale
33 * @author Kaj Wallin - kaj.wallin (at) ixonos.com
35 class MapScale : public QWidget
43 * @param parent Parent
45 MapScale(QWidget *parent = 0);
47 /*******************************************************************************
48 * BASE CLASS INHERITED AND REIMPLEMENTED MEMBER FUNCTIONS
49 ******************************************************************************/
51 * @brief Event handler for paint events
54 * @param event Paint event
56 void paintEvent(QPaintEvent *event);
58 /******************************************************************************
59 * MEMBER FUNCTIONS AND SLOTS
60 ******************************************************************************/
63 * @brief Rounding function for distances
65 * Rounds the given value to closest 1,2,5 or 10 in the original scale
66 * @param value Value to be rounded
67 * @return qreal Rounded value
69 qreal roundToBaseScale(qreal value);
73 * @brief Slot to update the scale with latest resolution
75 * @param resolution Resolution of the map in meters/pixel
77 void updateMapResolution(const qreal &resolution);
79 /*******************************************************************************
81 ******************************************************************************/
83 qreal m_centerLineImperial; ///< Length of the imperial scale
84 qreal m_centerLineMetric; ///< Length of the metric scale
85 QString m_imperialText; ///< Text description of the imperial scale
86 QString m_metricText; ///< Text description of the metric scale