diff --git a/qgroundcontrol.pro b/qgroundcontrol.pro index 7ec8a814b37fe8c9777c8f98ee7bac1154c43243..4b3966c33bead6107a0273e1162103f8c0516541 100644 --- a/qgroundcontrol.pro +++ b/qgroundcontrol.pro @@ -43,9 +43,7 @@ DEPENDPATH += . \ INCLUDEPATH += . \ lib/QMapControl \ $$BASEDIR/../mavlink/contrib/slugs/include \ - $$BASEDIR/../mavlink/include \ - /usr/include/freetype2 -LIBS += /usr/lib/libftgl.so + $$BASEDIR/../mavlink/include # ../mavlink/include \ # MAVLink/include \ diff --git a/src/ui/map3D/CheetahGL.cc b/src/ui/map3D/CheetahGL.cc index 1a7a0c846b5245f80fae3dc257be608b730b3a07..d6b4e2de4177e27ca88f8bda5e5973b0631613f3 100755 --- a/src/ui/map3D/CheetahGL.cc +++ b/src/ui/map3D/CheetahGL.cc @@ -1,14 +1,13 @@ -/* -This file was produced by Deep Exploration Plugin: CPP Export filter. -Copyright (C) 1999-2008 Right Hemisphere -Mail support@righthemisphere.com for support. -Visit http://www.righthemisphere.com/dexp.htm for updates. -*/ #include "CheetahGL.h" +#if (defined __APPLE__) & (defined __MACH__) +#include +#include +#else #include #include +#endif struct sample_MATERIAL diff --git a/src/ui/map3D/CheetahGL.h b/src/ui/map3D/CheetahGL.h index 10f67b9d77e662e64b8d7d395272dd4f16b1b329..98798c301b3a0fa9d849ad0da9eaee50f24a1363 100644 --- a/src/ui/map3D/CheetahGL.h +++ b/src/ui/map3D/CheetahGL.h @@ -1,7 +1,11 @@ #ifndef CHEETAHGL_H_ #define CHEETAHGL_H_ +#if (defined __APPLE__) & (defined __MACH__) +#include +#else #include +#endif GLint generatePixhawkCheetah(float red, float green, float blue); diff --git a/src/ui/map3D/CheetahModel.h b/src/ui/map3D/CheetahModel.h index 8673396cdb7896a476e7eb0454cba411ce20a2f5..008c4222d29518d5113ff705a7849813c06a0174 100644 --- a/src/ui/map3D/CheetahModel.h +++ b/src/ui/map3D/CheetahModel.h @@ -1,7 +1,11 @@ #ifndef CHEETAHMODEL_H_ #define CHEETAHMODEL_H_ +#if (defined __APPLE__) & (defined __MACH__) +#include +#else #include +#endif class CheetahModel { diff --git a/src/ui/map3D/Q3DWidget.cc b/src/ui/map3D/Q3DWidget.cc index 4ba5ca893c6e68ce0e61c180e2ddac285c7506d6..33bc1b37c62a6af41969f11b2fbdc7a3684eba94 100755 --- a/src/ui/map3D/Q3DWidget.cc +++ b/src/ui/map3D/Q3DWidget.cc @@ -1,8 +1,9 @@ #include "Q3DWidget.h" #include -#include -#include + +//#include +//#include static const float KEY_ROTATE_AMOUNT = 5.0f; static const float KEY_MOVE_AMOUNT = 10.0f; diff --git a/src/ui/map3D/Q3DWidget.h b/src/ui/map3D/Q3DWidget.h index e3414c40bb110aa75e352675b46fe1a1c475ca8b..9d32ee7afc0ecea594d54fb798c3c5c74e9337ef 100644 --- a/src/ui/map3D/Q3DWidget.h +++ b/src/ui/map3D/Q3DWidget.h @@ -1,7 +1,6 @@ #ifndef Q3DWIDGET_H_ #define Q3DWIDGET_H_ -#include #include #include #include diff --git a/src/ui/map3D/QMap3DWidget.cc b/src/ui/map3D/QMap3DWidget.cc index 7cd86df200e0065d5662ee7bc843abc36b0ef406..5ae202712b7d35fefd16b0fb03081097dd43da45 100644 --- a/src/ui/map3D/QMap3DWidget.cc +++ b/src/ui/map3D/QMap3DWidget.cc @@ -1,6 +1,6 @@ #include "QMap3DWidget.h" -#include +//#include #include #include @@ -26,7 +26,7 @@ QMap3DWidget::QMap3DWidget(QWidget* parent) buildLayout(); - font.reset(new FTTextureFont("images/Vera.ttf")); + //font.reset(new FTTextureFont("images/Vera.ttf")); connect(UASManager::instance(), SIGNAL(activeUASSet(UASInterface*)), this, SLOT(setActiveUAS(UASInterface*))); @@ -55,6 +55,9 @@ QMap3DWidget::buildLayout(void) lockCameraCheckBox->setText("Lock Camera"); lockCameraCheckBox->setChecked(lockCamera); + positionLabel = new QLabel(this); + positionLabel->setText(tr("Waiting for first position update.. ")); + QGridLayout* layout = new QGridLayout(this); layout->setMargin(0); layout->setSpacing(2); @@ -63,6 +66,7 @@ QMap3DWidget::buildLayout(void) layout->addWidget(trailCheckBox, 1, 1); layout->addWidget(recenterButton, 1, 2); layout->addWidget(lockCameraCheckBox, 1, 3); + layout->addWidget(positionLabel, 1, 4); layout->setRowStretch(0, 100); layout->setRowStretch(1, 1); layout->setColumnStretch(0, 1); @@ -143,26 +147,29 @@ QMap3DWidget::displayHandler(void) glVertex2f(getWindowWidth(), 0.0f); glEnd(); - char buffer[6][255]; - - sprintf(buffer[0], "x = %.2f", robotX); - sprintf(buffer[1], "y = %.2f", robotY); - sprintf(buffer[2], "z = %.2f", robotZ); - sprintf(buffer[3], "r = %.2f", robotRoll); - sprintf(buffer[4], "p = %.2f", robotPitch); - sprintf(buffer[5], "y = %.2f", robotYaw); - - font->FaceSize(10); - glColor3f(1.0f, 1.0f, 1.0f); - glPushMatrix(); - glTranslatef(0.0f, 30.0f, 0.0f); - for (int32_t i = 0; i < 6; ++i) - { - glTranslatef(60.0f, 0.0f, 0.0f); - font->Render(buffer[i]); - } - glPopMatrix(); +// char buffer[6][255]; +// +// sprintf(buffer[0], "x = %.2f", robotX); +// sprintf(buffer[1], "y = %.2f", robotY); +// sprintf(buffer[2], "z = %.2f", robotZ); +// sprintf(buffer[3], "r = %.2f", robotRoll); +// sprintf(buffer[4], "p = %.2f", robotPitch); +// sprintf(buffer[5], "y = %.2f", robotYaw); + + positionLabel->setText(QString("x = %1 y = %2 z = %3 r = %4 p = %5 y = %6").arg(robotX).arg(robotY).arg(robotZ).arg(robotRoll).arg(robotPitch).arg(robotYaw)); + +// font->FaceSize(10); +// glColor3f(1.0f, 1.0f, 1.0f); +// glPushMatrix(); +// +// glTranslatef(0.0f, 30.0f, 0.0f); +// for (int32_t i = 0; i < 6; ++i) +// { +// glTranslatef(60.0f, 0.0f, 0.0f); +// font->Render(buffer[i]); +// } +// glPopMatrix(); } /** diff --git a/src/ui/map3D/QMap3DWidget.h b/src/ui/map3D/QMap3DWidget.h index 2fccec74d908ffb1e80ddc841e696d3bd1ea9cd4..2e0895850e03f01949fd8e54fe2f6325b44b946e 100644 --- a/src/ui/map3D/QMap3DWidget.h +++ b/src/ui/map3D/QMap3DWidget.h @@ -1,10 +1,11 @@ #ifndef QMAP3DWIDGET_H #define QMAP3DWIDGET_H +#include + #include "Q3DWidget.h" class CheetahModel; -class FTTextureFont; class UASInterface; class QMap3DWidget : public Q3DWidget @@ -36,6 +37,7 @@ private slots: protected: UASInterface* uas; + QLabel* positionLabel; private: void drawPlatform(float roll, float pitch, float yaw); @@ -57,7 +59,6 @@ private: QVarLengthArray trail; QScopedPointer cheetahModel; - QScopedPointer font; }; #endif // QMAP3DWIDGET_H