Subversion Repositories Projects

Rev

Rev 361 | Go to most recent revision | Only display areas with differences | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 361 Rev 395
1
/***************************************************************************
1
/***************************************************************************
2
 *   Copyright (C) 2009 by Manuel Schrape                                  *
2
 *   Copyright (C) 2009 by Manuel Schrape                                  *
3
 *   manuel.schrape@gmx.de                                                 *
3
 *   manuel.schrape@gmx.de                                                 *
4
 *                                                                         *
4
 *                                                                         *
5
 *   This program is free software; you can redistribute it and/or modify  *
5
 *   This program is free software; you can redistribute it and/or modify  *
6
 *   it under the terms of the GNU General Public License as published by  *
6
 *   it under the terms of the GNU General Public License as published by  *
7
 *   the Free Software Foundation; either version 2 of the License.        *
7
 *   the Free Software Foundation; either version 2 of the License.        *
8
 *                                                                         *
8
 *                                                                         *
9
 *   This program is distributed in the hope that it will be useful,       *
9
 *   This program is distributed in the hope that it will be useful,       *
10
 *   but WITHOUT ANY WARRANTY; without even the implied warranty of        *
10
 *   but WITHOUT ANY WARRANTY; without even the implied warranty of        *
11
 *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the         *
11
 *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the         *
12
 *   GNU General Public License for more details.                          *
12
 *   GNU General Public License for more details.                          *
13
 *                                                                         *
13
 *                                                                         *
14
 *   You should have received a copy of the GNU General Public License     *
14
 *   You should have received a copy of the GNU General Public License     *
15
 *   along with this program; if not, write to the                         *
15
 *   along with this program; if not, write to the                         *
16
 *   Free Software Foundation, Inc.,                                       *
16
 *   Free Software Foundation, Inc.,                                       *
17
 *   59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.             *
17
 *   59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.             *
18
 ***************************************************************************/
18
 ***************************************************************************/
19
#ifndef DLG_MAP_H
19
#ifndef DLG_MAP_H
20
#define DLG_MAP_H
20
#define DLG_MAP_H
21
 
21
 
22
#include <QDialog>
22
#include <QDialog>
23
#include <QList>
23
#include <QList>
24
 
24
 
25
#include "ui_dlg_Map.h"
25
#include "ui_dlg_Map.h"
26
 
26
 
27
#include "../Classes/cSettings.h"
27
#include "../Classes/cSettings.h"
28
#include "../qmapcontrol.h"
28
#include "../qmapcontrol.h"
29
#include "../global.h"
29
#include "../global.h"
30
 
30
 
31
using namespace qmapcontrol;
31
using namespace qmapcontrol;
32
 
32
 
33
class dlg_Map :  public QDialog, public Ui::dlg_Map_UI
33
class dlg_Map :  public QDialog, public Ui::dlg_Map_UI
34
{
34
{
35
    Q_OBJECT
35
    Q_OBJECT
36
 
36
 
37
public:
37
public:
38
    dlg_Map(QWidget *parent = 0);
38
    dlg_Map(QWidget *parent = 0);
39
    void add_Position(double x, double y);
39
    void add_Position(double x, double y);
40
    void create_Map(cSettings *t_Settings);
40
    void create_Map(cSettings *t_Settings);
41
 
41
 
42
private:
42
private:
43
    QPen* Pen[3];
43
    QPen* Pen[3];
44
 
44
 
45
    cSettings   *o_Settings;
45
    cSettings   *o_Settings;
46
 
46
 
47
    MapControl  *o_Map;
47
    MapControl  *o_Map;
48
    MapAdapter  *o_Adapter;
48
    MapAdapter  *o_Adapter;
49
 
49
 
50
    Layer       *o_Layer;
50
    Layer       *o_Layer;
51
    Layer       *o_Click;
51
    Layer       *o_Click;
52
    Layer       *o_Route;
52
    Layer       *o_Route;
53
 
53
 
54
    QList<Point*> p_RouteWP;
54
    QList<Point*> p_RouteWP;
55
    LineString*   l_RouteWP;
55
    LineString*   l_RouteWP;
56
 
56
 
57
    QList<Point*> p_RouteFL;
57
    QList<Point*> p_RouteFL;
58
    LineString*   l_RouteFL;
58
    LineString*   l_RouteFL;
59
 
59
 
60
    Point* LastPos;
60
    Point* LastPos;
61
//    Point* LastPoint;
61
//    Point* LastPoint;
62
    Point* LastClick;
62
    Point* LastClick;
63
 
63
 
64
    Point   *ClickPoint;
64
    Point   *ClickPoint;
65
    QPointF MapCenter;
65
    QPointF MapCenter;
66
 
66
 
67
    QList<sWayPoint> l_WayPoints;
67
    QList<sWayPoint> l_WayPoints;
68
    QList<sWayPoint> l_Track;
68
    QList<sWayPoint> l_Track;
69
 
69
 
70
    QList<sWayPoint> parse_WayPointKML(QString s_File);
70
    QList<sWayPoint> parse_WayPointKML(QString s_File);
71
    QList<sWayPoint> parse_WayPointMKW(QString s_File);
71
    QList<sWayPoint> parse_WayPointMKW(QString s_File);
72
 
72
 
73
    void show_WayPoints(QList<sWayPoint> WayPoints);
73
    void show_WayPoints(QList<sWayPoint> WayPoints);
74
 
74
 
75
    void save_WayPointsMKW(QString s_File);
75
    void save_WayPointsMKW(QString s_File);
76
 
76
 
77
private slots:
77
private slots:
78
    void slot_Zoom(int t_Zoom);
78
    void slot_Zoom(int t_Zoom);
79
    void slot_ChangeMap(int);
79
    void slot_ChangeMap(int);
80
    void slot_Click(const QMouseEvent*, const QPointF);
80
    void slot_Click(const QMouseEvent*, const QPointF);
81
 
81
 
82
    void slot_AddWayPoint();
82
    void slot_AddWayPoint();
83
    void slot_DeleteWayPoints();
83
    void slot_DeleteWayPoints();
84
    void slot_SendWayPoints();
84
    void slot_SendWayPoints();
85
    void slot_ShowWayPoints(bool);
85
    void slot_ShowWayPoints(bool);
-
 
86
 
-
 
87
    void slot_LoadMapPic();
86
 
88
 
87
    void slot_GotoTarget();
89
    void slot_GotoTarget();
88
    void slot_Close();
90
    void slot_Close();
89
 
91
 
90
    void slot_LoadWayPoints();
92
    void slot_LoadWayPoints();
91
    void slot_SaveWayPoints();
93
    void slot_SaveWayPoints();
92
 
94
 
93
protected:
95
protected:
94
    virtual void resizeEvent ( QResizeEvent * event );
96
    virtual void resizeEvent ( QResizeEvent * event );
95
 
97
 
96
signals:
98
signals:
97
    void set_Target(sWayPoint Target);
99
    void set_Target(sWayPoint Target);
98
    void set_WayPoints(QList<sWayPoint>);
100
    void set_WayPoints(QList<sWayPoint>);
99
    void set_Settings(cSettings *t_Settings);
101
    void set_Settings(cSettings *t_Settings);
100
 
102
 
101
};
103
};
102
 
104
 
103
#endif // DLG_MAP_H
105
#endif // DLG_MAP_H
104
 
106