Commit 1fb0417c authored by Lionel Heng's avatar Lionel Heng

Removed now redundant files for 3D view perspective.

parent 9bc4a88f
This diff is collapsed.
/*=====================================================================
QGroundControl Open Source Ground Control Station
(c) 2009, 2010 QGROUNDCONTROL PROJECT <http://www.qgroundcontrol.org>
This file is part of the QGROUNDCONTROL project
QGROUNDCONTROL is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
QGROUNDCONTROL is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with QGROUNDCONTROL. If not, see <http://www.gnu.org/licenses/>.
======================================================================*/
/**
* @file
* @brief Generates a display list which renders a Pixhawk Cheetah MAV.
*
* @author Lionel Heng <hengli@student.ethz.ch>
*
*/
#ifndef CHEETAHGL_H_
#define CHEETAHGL_H_
#if (defined __APPLE__) & (defined __MACH__)
#include <OpenGL/gl.h>
#else
#include <GL/gl.h>
#endif
/**
* @brief Creates a display list which renders a Pixhawk Cheetah MAV.
* @param red Red intensity of the MAV model
* @param green Green intensity of the MAV model
* @param blue Blue intensity of the MAV model
*
* @return The index of the display list.
**/
GLint generatePixhawkCheetah(float red, float green, float blue);
#endif
/*=====================================================================
QGroundControl Open Source Ground Control Station
(c) 2009, 2010 QGROUNDCONTROL PROJECT <http://www.qgroundcontrol.org>
This file is part of the QGROUNDCONTROL project
QGROUNDCONTROL is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
QGROUNDCONTROL is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with QGROUNDCONTROL. If not, see <http://www.gnu.org/licenses/>.
======================================================================*/
/**
* @file
* @brief Definition of the class CheetahModel.
*
* @author Lionel Heng <hengli@student.ethz.ch>
*
*/
#include "CheetahModel.h"
#include "CheetahGL.h"
CheetahModel::CheetahModel()
: cheetah_dl(-1)
{
}
void
CheetahModel::init(float red, float green, float blue)
{
cheetah_dl = generatePixhawkCheetah(red, green, blue);
}
void
CheetahModel::draw(void)
{
glPushMatrix();
glScalef(0.5f, 0.5f, -0.5f);
glCallList(cheetah_dl);
glPopMatrix();
}
/*=====================================================================
QGroundControl Open Source Ground Control Station
(c) 2009, 2010 QGROUNDCONTROL PROJECT <http://www.qgroundcontrol.org>
This file is part of the QGROUNDCONTROL project
QGROUNDCONTROL is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
QGROUNDCONTROL is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with QGROUNDCONTROL. If not, see <http://www.gnu.org/licenses/>.
======================================================================*/
/**
* @file
* @brief Definition of the class CheetahModel.
*
* @author Lionel Heng <hengli@student.ethz.ch>
*
*/
#ifndef CHEETAHMODEL_H_
#define CHEETAHMODEL_H_
#if (defined __APPLE__) & (defined __MACH__)
#include <OpenGL/gl.h>
#else
#include <GL/gl.h>
#endif
/**
* @brief Container for display list which renders the Pixhawk Cheetah MAV.
**/
class CheetahModel
{
public:
CheetahModel();
/**
* @brief Initializes the display list.
* @param red Red intensity of the MAV model
* @param green Green intensity of the MAV model
* @param blue Blue intensity of the MAV model
**/
void init(float red, float green, float blue);
/**
* @brief Executes the display list.
**/
void draw(void);
private:
GLint cheetah_dl;
};
#endif /* CHEETAHMODEL_H_ */
This diff is collapsed.
/*=====================================================================
QGroundControl Open Source Ground Control Station
(c) 2009, 2010 QGROUNDCONTROL PROJECT <http://www.qgroundcontrol.org>
This file is part of the QGROUNDCONTROL project
QGROUNDCONTROL is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
QGROUNDCONTROL is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with QGROUNDCONTROL. If not, see <http://www.gnu.org/licenses/>.
======================================================================*/
/**
* @file
* @brief Definition of the class QMap3DWidget.
*
* @author Lionel Heng <hengli@student.ethz.ch>
*
*/
#ifndef QMAP3DWIDGET_H
#define QMAP3DWIDGET_H
#include <QLabel>
#include "Imagery.h"
#include "Q3DWidget.h"
class CheetahModel;
class UASInterface;
/**
* @brief A 3D View widget which displays vehicle-centric information.
**/
class QMap3DWidget : public Q3DWidget
{
Q_OBJECT
public:
explicit QMap3DWidget(QWidget* parent);
~QMap3DWidget();
void buildLayout(void);
static void display(void* clientData);
void displayHandler(void);
// void paintEvent(QPaintEvent *event);
static void mouse(Qt::MouseButton button, MouseState state,
int32_t x, int32_t y, void* clientData);
void mouseHandler(Qt::MouseButton button, MouseState state,
int32_t x, int32_t y);
static void timer(void* clientData);
void timerHandler(void);
double getTime(void) const;
public slots:
void setActiveUAS(UASInterface* uas);
void markTarget(void);
private slots:
void showGrid(int state);
void showTrail(int state);
void showImagery(const QString& text);
void recenterCamera(void);
void toggleLockCamera(int state);
protected:
UASInterface* uas;
void paintText(QString text, QColor color, float fontSize,
float refX, float refY, QPainter* painter) const;
void drawWaypoints(void) const;
private:
void drawPlatform(float roll, float pitch, float yaw) const;
void drawGrid(float x, float y, float z) const;
void drawImagery(double originX, double originY, double originZ,
const QString& zone, bool prefetch) const;
void drawTrail(float x, float y, float z);
void drawTarget(float x, float y, float z) const;
void drawLegend(void);
double lastRedrawTime;
bool displayGrid;
bool displayImagery;
bool displayTrail;
typedef struct
{
float x;
float y;
float z;
} Pose3D;
bool lockCamera;
Pose3D lastUnlockedPose;
bool updateLastUnlockedPose;
Pose3D camOffset;
QVarLengthArray<Pose3D, 10000> trail;
bool displayTarget;
bool displayWaypoints;
Pose3D targetPosition;
QScopedPointer<CheetahModel> cheetahModel;
QScopedPointer<Imagery> imagery;
QComboBox* imageryComboBox;
};
#endif // QMAP3DWIDGET_H
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment