2 ******************************************************************************
4 * @file modelmapproxy.h
5 * @author The OpenPilot Team, http://www.openpilot.org Copyright (C) 2012.
6 * @addtogroup GCSPlugins GCS Plugins
8 * @addtogroup OPMapPlugin OpenPilot Map Plugin
10 * @brief The OpenPilot Map plugin
11 *****************************************************************************/
13 * This program is free software; you can redistribute it and/or modify
14 * it under the terms of the GNU General Public License as published by
15 * the Free Software Foundation; either version 3 of the License, or
16 * (at your option) any later version.
18 * This program is distributed in the hope that it will be useful, but
19 * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
20 * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
23 * You should have received a copy of the GNU General Public License along
24 * with this program; if not, write to the Free Software Foundation, Inc.,
25 * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
27 #ifndef MODELMAPPROXY_H
28 #define MODELMAPPROXY_H
30 #include "opmapcontrol/opmapcontrol.h"
31 #include "pathaction.h"
33 #include "QMutexLocker"
35 #include "flightdatamodel.h"
36 #include <QItemSelectionModel>
37 #include <widgetdelegates.h>
40 using namespace mapcontrol
;
41 class modelMapProxy
: public QObject
{
42 typedef enum { OVERLAY_LINE
, OVERLAY_CIRCLE_RIGHT
, OVERLAY_CIRCLE_LEFT
} overlayType
;
45 explicit modelMapProxy(QObject
*parent
, OPMapWidget
*map
, flightDataModel
*model
, QItemSelectionModel
*selectionModel
);
46 WayPointItem
*findWayPointNumber(int number
);
47 void createWayPoint(internals::PointLatLng coord
);
48 void deleteWayPoint(int number
);
51 void dataChanged(const QModelIndex
& topLeft
, const QModelIndex
& bottomRight
);
52 void rowsInserted(const QModelIndex
& parent
, int first
, int last
);
53 void rowsRemoved(const QModelIndex
& parent
, int first
, int last
);
54 void WPValuesChanged(WayPointItem
*wp
);
55 void currentRowChanged(QModelIndex
, QModelIndex
);
56 void selectedWPChanged(QList
<WayPointItem
*>);
58 overlayType
overlayTranslate(int type
);
59 void createOverlay(WayPointItem
*from
, WayPointItem
*to
, overlayType type
, QColor color
, bool dashed
= false, int width
= -1);
60 void createOverlay(WayPointItem
*from
, HomeItem
*to
, modelMapProxy::overlayType type
, QColor color
, bool dashed
= false, int width
= -1);
62 flightDataModel
*model
;
63 void refreshOverlays();
64 QItemSelectionModel
*selection
;
67 #endif // MODELMAPPROXY_H