GlobeEngine
ExoViewerUI.h
Go to the documentation of this file.
1 #ifndef ExoViewer_ExoViewerUI_h
2 #define ExoViewer_ExoViewerUI_h
3 
4 #include "OpenGL_Includes.h"
5 #include <QDateEdit>
6 #include <QToolBar>
7 #include <qcombobox.h>
8 #include "ui_exoviewer.h"
9 #include "ui_exoinfowidget.h"
10 #include "ui_coreviewinfowidget.h"
11 #include "ExoViewerGLWidget.h"
12 #include "BodySelectionDialog.h"
13 #include "NavigateToDialog.h"
14 #include "VisibleLabelsDialog.h"
15 #include "UnitCirclesDialog.h"
16 #include "PlanetsInHZDialog.h"
17 #include "OverviewMapDialog.h"
18 #include "HelpDialog.h"
19 
20 #include "SimpleQTViewer.h"
21 
22 namespace geExoViewer {
24 {
25  Q_OBJECT
26 
27 public:
28  ExoViewerUI(std::string path, ExoViewerGLWidget* _glWidget, QWidget *parent = 0);
29  ~ExoViewerUI();
30 
31 public slots:
32  void selectMenuFile(QAction* _action);
33  void selectMenuView(QAction* _action);
34  void selectMenuNavigation(QAction* _action);
35  void selectMenuDebug(QAction* _action);
36  void acceptBodySelection();
37  void acceptVisiblityLabel();
38  void updateSceneSpeed(int _value);
39  void switchToSun();
40  void setUnitCircles(double _unitSize, int _unit, int _numberOfCircles);
41  void setDate();
42  void setDateStatus();
43  void setBodyInfoWidget();
44  void navigateToBody(std::string _n);
46  void changeToLinkedBody(const QString &link);
47  void selectMenuFavourites(QAction* _action);
48  void showHelpDialog();
51  void toggleCoreInfoWidget();
52  void showCoreInfoWidget();
53  void hideCoreInfoWidget();
54  void hideExoInfoWidget();
57  void showExoInfoWidget();
58  void toggleMapView();
59  //void rz(int _w, int _h);
60 
61  //comparison slots
62  void toggleComparisonView();
63  void xPropertyChanged(int index);
64  void yPropertyChanged(int index);
65  void xLinesChanged();
66  void yLinesChanged();
67  void xMinChanged();
68  void xMaxChanged();
69  void yMinChanged();
70  void yMaxChanged();
71  void addSystemOrPlanet();
72  void setComparisonRanges();
73 
74 
75 protected:
76  void keyPressEvent(QKeyEvent *event);
77  void keyReleaseEvent(QKeyEvent *e);
78 
79 private:
80 
81  Ui::ExoViewerClass ui;
82  QTimer* update_timer;
83 
84  QWidget* iW;
85  QWidget* coreViewIW;
86 
87  ExoViewerGLWidget* getGLWidget();
88 
89  HelpDialog* helpDialog;
90  BodySelectionDialog* bodySelection;
91  NavigateToDialog* navigateTo;
92  PlanetsInHZDialog* planetsInHZ;
93  VisibleLabelsDialog* visibleLables;
94  Ui::ExoInfoWidgetClass exoInfoWidget;
95  Ui::CoreViewInfoWidgetClass coreViewInfoWidget;
96  UnitCirclesDialog* unitCirclesDialog;
97  OverviewMapDialog* overviewMapDialog;
98  QDateEdit* dateWidget;
99 
100  QLabel* datelabel;
101  QSlider* speedControl;
102 
103  void createHelpDialog();
104  void createBodySelectionDialog();
105  void createNavigateToDialog();
106  void createPlanetInHZDialog();
107  void createVisibleLablesDialog();
108  void createOverviewMapDialog();
109  void setDateLabel(QString _input);
110  void initializeToolbar(QToolBar* toolbar);
111  void initializeFavourites();
112  void saveFavourites();
113  void addToFavourites(QString name);
114  void deleteFromFavourites(QString name);
115  void setAddButtonIcon(bool selectionInFavourites);
116 
117  //comparison view
118  void createPlanetAdder();
119 
120  /* list of toolbars:
121  0: search, fav, map, coreView and comparison button
122  1: file, view and debug button
123  2: datelabel, date setter and slider
124  3: help and options
125  4: comparison view horizontal
126  */
127  QList<QToolBar*> toolBars;
128  QVector<QString> favourites;
129 
130  /* this vector stores the visibilities of the different label types.
131  This is needed to know which labels have to be set to visible again when the overview map is deactivated again. */
132  std::vector<bool> configuredLabelVisibility;
133 
134  /* this is needed to know what speed we were at before we switched to overview map view.
135  We set the speed to 0 if we go into overview since this will improve performance.*/
136  double configuredSpeed;
137 
138  std::string picturePath;
139  std::string iconPath;
140 
141  std::string menuViewIconPath;
142  std::string menuFileIconPath;
143  std::string menuSearchIconPath;
144  std::string menuFavouriteIconPath;
145  std::string menuDebugIconPath;
146  std::string menuMapIconPath;
147  std::string applyIconPath;
148  std::string helpIconPath;
149  std::string addIconPath;
150  std::string deleteIconPath;
151  std::string closeIconPath;
152  std::string coreViewIconPath;
153  std::string exoInfoIconPath;
154 
155  std::string comparisonIconPath;
156 
157  QToolButton* toolButtonSearch;
158  QToolButton* toolButtonFavourite;
159  QToolButton* toolButtonMap;
160  QToolButton* toolButtonCoreView;
161  QToolButton* toolButtonFile;
162  QToolButton* toolButtonDebug;
163  QToolButton* toolButtonView;
164  QToolButton* toolButtonExoInfo;
165  QToolButton* toolButtonHelp;
166 
167  QToolButton* toolButtonComparison;
168 
169  QIcon addIcon;
170  QIcon deleteIcon;
171 
172  QString favouritesFilePath;
173 
174  QString getString(double _value, QString _unit);
175  bool isFullScreen;
176 
177  bool isCoreView;
178  bool isShowExoInfoWidget;
179  bool isMapView;
180 
181  bool isComparisonView;
182 
183  QString insertUnits(std::string s, std::string units);
184  QString convertToHabZoneFormat(double d);
185 
186  //comparison view
187  QComboBox* dropdownXProperties;
188  QComboBox* dropdownYProperties;
189  QLineEdit* xPropertyMin;
190  QLineEdit* xPropertyMax;
191  QLineEdit* yPropertyMin;
192  QLineEdit* yPropertyMax;
193  QLineEdit* numberOfLinesX;
194  QLineEdit* numberOfLinesY;
195  QLineEdit* planetAdder;
196 
197  void setupComparisonUI();
198 };
199 
200 }
201 
202 #endif
Definition: ExoViewerGLWidget.h:27
Definition: BodySelectionDialog.h:14
Definition: HelpDialog.h:15
void yMaxChanged()
Definition: ExoViewerUI.cpp:1149
void addSystemOrPlanet()
Definition: ExoViewerUI.cpp:1162
void instantiateOverViewMap()
Definition: ExoViewerUI.cpp:353
void changeToLinkedBody(const QString &link)
Definition: ExoViewerUI.cpp:685
void keyPressEvent(QKeyEvent *event)
Definition: ExoViewerUI.cpp:713
void xPropertyChanged(int index)
Definition: ExoViewerUI.cpp:1068
Definition: UnitCirclesDialog.h:14
void selectMenuView(QAction *_action)
Definition: ExoViewerUI.cpp:285
Definition: PlanetsInHZDialog.h:12
void xLinesChanged()
Definition: ExoViewerUI.cpp:1084
void yMinChanged()
Definition: ExoViewerUI.cpp:1136
void xMinChanged()
Definition: ExoViewerUI.cpp:1110
void setDate()
Definition: ExoViewerUI.cpp:708
void deleteCurrentFromFavourites()
Definition: ExoViewerUI.cpp:821
Definition: NavigateToDialog.h:11
void toggleComparisonView()
Definition: ExoViewerUI.cpp:978
void acceptBodySelection()
Definition: ExoViewerUI.cpp:619
void acceptVisiblityLabel()
Definition: ExoViewerUI.cpp:667
void setBodyInfoWidget()
Definition: ExoViewerUI.cpp:383
void changeBodySatelliteList()
Definition: ExoViewerUI.cpp:692
void yLinesChanged()
Definition: ExoViewerUI.cpp:1097
void toggleMapView()
Definition: ExoViewerUI.cpp:920
void switchToSun()
Definition: ExoViewerUI.cpp:699
void instantiateNavigateToObjectDialog()
Definition: ExoViewerUI.cpp:345
void setDateStatus()
Definition: ExoViewerUI.cpp:378
void toggleCoreInfoWidget()
Definition: ExoViewerUI.cpp:867
~ExoViewerUI()
Definition: ExoViewerUI.cpp:257
void selectMenuFile(QAction *_action)
Definition: ExoViewerUI.cpp:267
void selectMenuDebug(QAction *_action)
Definition: ExoViewerUI.cpp:367
Definition: ExoViewerUI.h:23
void showCoreInfoWidget()
Definition: ExoViewerUI.cpp:876
Definition: VisibleLabelsDialog.h:18
void showHelpDialog()
Definition: ExoViewerUI.cpp:360
void keyReleaseEvent(QKeyEvent *e)
Definition: ExoViewerUI.cpp:722
void showExoInfoWidget()
Definition: ExoViewerUI.cpp:913
void yPropertyChanged(int index)
Definition: ExoViewerUI.cpp:1076
void hideExoInfoWidget()
Definition: ExoViewerUI.cpp:907
void updateSceneSpeed(int _value)
Definition: ExoViewerUI.cpp:674
Definition: SimpleQTViewer.h:13
void selectMenuFavourites(QAction *_action)
Definition: ExoViewerUI.cpp:784
void navigateToBody(std::string _n)
Definition: ExoViewerUI.cpp:757
void addCurrentToFavourites()
Definition: ExoViewerUI.cpp:809
ExoViewerUI(std::string path, ExoViewerGLWidget *_glWidget, QWidget *parent=0)
Definition: ExoViewerUI.cpp:14
void hideCoreInfoWidget()
Definition: ExoViewerUI.cpp:901
Definition: OverviewMapDialog.h:15
void selectMenuNavigation(QAction *_action)
Definition: ExoViewerUI.cpp:324
void xMaxChanged()
Definition: ExoViewerUI.cpp:1123
Definition: BodySelectionDialog.h:12
void setUnitCircles(double _unitSize, int _unit, int _numberOfCircles)
Definition: ExoViewerUI.cpp:704
void setComparisonRanges()
Definition: ExoViewerUI.cpp:1217