GlobeEngine
CompassWidget.h
Go to the documentation of this file.
1 #ifndef HikingViewer_CompassWidget_h
2 #define HikingViewer_CompassWidget_h
3 
4 #include "OpenGL_Includes.h"
5 #include "ClickableQLabel.h"
6 #include "vmmlib/vector.hpp"
7 #include <QLabel>
8 #include <QListWidget>
9 #include <QVBoxLayout>
10 
11 namespace geQT {
13  Q_OBJECT
14 
15  public:
16  CompassLabel(QWidget* parent = 0, Qt::WindowFlags f = 0) {
17  start = 0;
18  end = 90 * 16;
19  };
21  void paintEvent(QPaintEvent* ev);
22  void setAngles(float _start, float _end);
23  private:
24  float start, end;
25  };
26 
27  class CompassWidget: public QWidget {
28  Q_OBJECT
29 
30  public:
31  CompassWidget(std::string _propath, QWidget* parent = 0, Qt::WindowFlags f = 0);
33 
34  vmml::Vector2f getAngles();
35 
36  signals:
37  void compassUpdate();
38 
39  public slots:
40  void compassClicked(QMouseEvent* e);
41  void setRiskLevel(int _riskLevel);
42  void setHeightLevel(int _meters);
43  private:
44  float getDegreeForPosition(vmml::Vector2f _pos);
45 
46  QVBoxLayout* layout;
47  CompassLabel* imageWindow;
48  QLabel* riskLevelLabel;
49  QLabel* heightThreshold;
50 
51  vmml::Vector2f compassCenter;
52  vmml::Vector2f compassSize;
53 
54  vmml::Vector4ub dangerColorStart;
55  vmml::Vector4ub dangerColorEnd;
56 
57  std::string picturePath;
58  float startDegree;
59  float endDegree;
60  bool clickCount;
61  };
62 }
63 #endif
CompassWidget(std::string _propath, QWidget *parent=0, Qt::WindowFlags f=0)
Definition: CompassWidget.cpp:23
void compassClicked(QMouseEvent *e)
Definition: CompassWidget.cpp:87
void paintEvent(QPaintEvent *ev)
Definition: CompassWidget.cpp:8
Definition: CompassWidget.h:27
CompassLabel(QWidget *parent=0, Qt::WindowFlags f=0)
Definition: CompassWidget.h:16
void setRiskLevel(int _riskLevel)
Definition: CompassWidget.cpp:110
Definition: CompassWidget.h:12
Definition: ClickableQLabel.h:9
void setHeightLevel(int _meters)
Definition: CompassWidget.cpp:114
vmml::Vector2f getAngles()
Definition: CompassWidget.cpp:118
void setAngles(float _start, float _end)
Definition: CompassWidget.cpp:17
Definition: ClickableQLabel.h:8
~CompassLabel()
Definition: CompassWidget.h:20
~CompassWidget()
Definition: CompassWidget.cpp:57