dRonin  adbada4
dRonin GCS
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Groups Pages
modelviewgadgetwidget.h
Go to the documentation of this file.
1 
12 /*
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.
17  *
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
21  * for more details.
22  *
23  * You should have received a copy of the GNU General Public License along
24  * with this program; if not, see <http://www.gnu.org/licenses/>
25  */
26 
27 #ifndef MODELVIEWGADGETWIDGET_H_
28 #define MODELVIEWGADGETWIDGET_H_
29 
30 #include <QGLWidget>
31 #include <QTimer>
32 
33 #include "glc_lib/glc_factory.h"
34 #include "glc_lib/viewport/glc_viewport.h"
35 #include "glc_lib/viewport/glc_movercontroller.h"
36 #include "glc_lib/shading/glc_light.h"
37 #include "glc_lib/sceneGraph/glc_world.h"
38 #include "glc_lib/glc_exception.h"
39 
41 #include "attitudeactual.h"
42 
43 class ModelViewGadgetWidget : public QGLWidget
44 {
45  Q_OBJECT
46 
47 public:
48  ModelViewGadgetWidget(QWidget *parent = nullptr);
50  void setAcFilename(QString acf);
51 
52  void setBgFilename(QString bgf);
53  void setVboEnable(bool eVbo);
54  void reloadScene();
55  void updateAttitude(int value);
56 
57 private:
58  void initializeGL();
59  void paintGL();
60  void resizeGL(int width, int height);
61  // Create GLC_Object to display
62  void CreateScene();
63 
64  // Mouse events
65  void mousePressEvent(QMouseEvent *e);
66  void mouseMoveEvent(QMouseEvent *e);
67  void mouseReleaseEvent(QMouseEvent *e);
68  void wheelEvent(QWheelEvent *e);
69  void keyPressEvent(QKeyEvent *e);
70 
72  // Private slots Functions
74 private slots:
75  void updateAttitude();
76 
77 private:
78  GLC_Factory *m_pFactory;
79  GLC_Light m_Light;
80  GLC_World m_World;
81  GLC_Viewport m_GlView;
82  GLC_MoverController m_MoverController;
83  GLC_BoundingBox m_ModelBoundingBox;
84  // ! The timer used for motion
85  QTimer m_MotionTimer;
86 
87  QString acFilename;
88  QString bgFilename;
89  bool vboEnable;
90 
91  static const QString fallbackAcFilename;
92  static const QString fallbackBgFilename;
93 
94  AttitudeActual *attState;
95 };
96 
97 #endif /* MODELVIEWGADGETWIDGET_H_ */
ModelViewGadgetWidget(QWidget *parent=nullptr)
void setAcFilename(QString acf)
void setBgFilename(QString bgf)
void updateAttitude(int value)
e
Definition: OPPlots.m:99