OP-1900 have path_progress updated correctly for leg_remaining and error_below end...
[librepilot.git] / ground / openpilotgcs / src / plugins / osgearthview / osgearthviewwidget.cpp
blobbbd3b1c94429afde0dc758174149e4538ab8100d
1 /********************************************************************************
2 * @file osgearthviewwidget.cpp
3 * @author The OpenPilot Team Copyright (C) 2012.
4 * @addtogroup GCSPlugins GCS Plugins
5 * @{
6 * @addtogroup OsgEarthview Plugin Widget
7 * @{
8 * @brief Osg Earth view of UAV
9 *****************************************************************************/
11 * This program is free software; you can redistribute it and/or modify
12 * it under the terms of the GNU General Public License as published by
13 * the Free Software Foundation; either version 3 of the License, or
14 * (at your option) any later version.
16 * This program is distributed in the hope that it will be useful, but
17 * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
18 * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
19 * for more details.
21 * You should have received a copy of the GNU General Public License along
22 * with this program; if not, write to the Free Software Foundation, Inc.,
23 * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
26 #include "osgearthviewwidget.h"
27 #include <utils/stylehelper.h>
28 #include <iostream>
29 #include <QDebug>
30 #include <QPainter>
31 #include <QtOpenGL/QGLWidget>
32 #include <cmath>
33 #include <QtWidgets/QApplication>
34 #include <QLabel>
35 #include <QDebug>
37 #include <QtCore/QTimer>
38 #include <QtWidgets/QApplication>
39 #include <QGridLayout>
42 #include <osg/Notify>
43 #include <osg/PositionAttitudeTransform>
45 #include <osgUtil/Optimizer>
46 #include <osgGA/StateSetManipulator>
47 #include <osgGA/GUIEventHandler>
48 #include <osgViewer/Viewer>
49 #include <osgViewer/ViewerEventHandlers>
51 #include <osgEarth/MapNode>
52 #include <osgEarth/XmlUtils>
53 #include <osgEarth/Viewpoint>
55 #include <osgEarthSymbology/Color>
57 #include <osgEarthAnnotation/AnnotationRegistry>
58 #include <osgEarthAnnotation/AnnotationData>
59 #include <osgEarthAnnotation/Decluttering>
61 #include <osgEarthDrivers/kml/KML>
62 #include <osgEarthDrivers/ocean_surface/OceanSurface>
63 #include <osgEarthDrivers/cache_filesystem/FileSystemCache>
65 #include <osgEarthUtil/EarthManipulator>
66 #include <osgEarthUtil/AutoClipPlaneHandler>
67 #include <osgEarthUtil/Controls>
68 #include <osgEarthUtil/SkyNode>
69 #include <osgEarthUtil/LatLongFormatter>
70 #include <osgEarthUtil/MouseCoordsTool>
71 #include <osgEarthUtil/ObjectLocator>
73 using namespace osgEarth::Util;
74 using namespace osgEarth::Util::Controls;
75 using namespace osgEarth::Symbology;
76 using namespace osgEarth::Drivers;
77 using namespace osgEarth::Annotation;
79 #include <osgViewer/CompositeViewer>
80 #include <osgViewer/ViewerEventHandlers>
82 #include <osgGA/TrackballManipulator>
84 #include <osgDB/ReadFile>
86 #include <osgQt/GraphicsWindowQt>
88 #include <iostream>
90 #include "ui_osgearthview.h"
92 #include "utils/stylehelper.h"
93 #include "utils/homelocationutil.h"
94 #include "utils/worldmagmodel.h"
95 #include "utils/coordinateconversions.h"
96 #include "attitudestate.h"
97 #include "homelocation.h"
98 #include "positionstate.h"
100 using namespace Utils;
102 OsgEarthviewWidget::OsgEarthviewWidget(QWidget *parent) : QWidget(parent)
104 m_widget = new Ui_OsgEarthview();
105 m_widget->setupUi(this);
107 /*viewWidget = new OsgViewerWidget(this);
108 viewWidget->setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Expanding);
110 setLayout(new QVBoxLayout());
111 layout()->addWidget(viewWidget);*/
114 OsgEarthviewWidget::~OsgEarthviewWidget()
117 void OsgEarthviewWidget::paintEvent(QPaintEvent *event)
120 void OsgEarthviewWidget::resizeEvent(QResizeEvent *event)