Vespucci  1.0.0
mainwindow.h
Go to the documentation of this file.
1 /*******************************************************************************
2  Copyright (C) 2014-2016 Wright State University - All Rights Reserved
3  Daniel P. Foose - Maintainer/Lead Developer
4 
5  This file is part of Vespucci.
6 
7  Vespucci is free software: you can redistribute it and/or modify
8  it under the terms of the GNU General Public License as published by
9  the Free Software Foundation, either version 3 of the License, or
10  (at your option) any later version.
11 
12  Vespucci is distributed in the hope that it will be useful,
13  but WITHOUT ANY WARRANTY; without even the implied warranty of
14  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15  GNU General Public License for more details.
16 
17  You should have received a copy of the GNU General Public License
18  along with Vespucci. If not, see <http://www.gnu.org/licenses/>.
19 *******************************************************************************/
20 #ifndef MAINWINDOW_H
21 #define MAINWINDOW_H
22 
23 #include <QMainWindow>
26 #include "GUI/Display/plotviewer.h"
28 #include "GUI/macrodialog.h"
29 #include "GUI/pythonshelldialog.h"
35 class PythonShellDialog;
36 class HistoryDialog;
37 class SpectrumEditor;
38 class VespucciWorkspace;
39 class VespucciDataset;
40 class DatasetTreeModel;
41 class RangeDialog;
42 class SpectrumViewer;
43 class DataViewer;
44 class PlotViewer;
45 class DataModel;
46 class StatsDialog;
47 class MacroDialog;
48 class TreeItem;
50 namespace Ui {
51 class MainWindow;
52 }
53 
58 class MainWindow : public QMainWindow
59 {
60  Q_OBJECT
61 
62 public:
63  explicit MainWindow(QWidget *parent, QSharedPointer<VespucciWorkspace> ws);
64  ~MainWindow();
65  void RefreshTreeModel(const DataModel *data_model);
66  QCPRange *global_data_range();
67  QCPColorGradient *global_gradient();
68  void RecalculateGlobalDataRange(QCPRange* new_data_range);
69  void RefreshGlobalColorGradient(QCPColorGradient new_gradient);
70  void SetGlobalDataRange(QCPRange* new_data_range);
71  QSharedPointer<VespucciWorkspace> workspace_ptr(); //return the workspace
72  void DisplayExceptionWarning(std::exception e);
73  void DisplayExceptionWarning(std::string where, std::exception e);
74  QListView *map_list_view();
75  void SetActiveDatasetListRow(const QModelIndex &index);
76  void SetActiveDatasetTreeIndex(const QModelIndex &index);
77  void DisplayWarning(const QString &title, const QString &text);
78  void DisplayInformation(const QString &title, const QString &text);
79  void SetDatasetTreeModel(DatasetTreeModel *new_model);
80 
81  DatasetTreeModel *dataset_tree_model();
82  PlotViewer *plot_viewer();
83  DataViewer *data_viewer();
84 
85 signals:
86  void DatasetSelectionChanged(QString dataset_key);
87  void MatrixSelectionChanged(QStringList matrix_keys);
88  void DatasetToBeRemoved(QString name);
89  void MatrixToBeRemoved(QStringList keys);
90 
91 protected:
92  void closeEvent(QCloseEvent *event);
93 public slots:
94  void RangeDialogAccepted(double min, double max);
95  void SetPlotViewerActionChecked(bool checked);
96  void SetDataViewerActionChecked(bool checked);
97  void SetStatsViewerActionChecked(bool checked);
98  void SetSpectrumEditorActionChecked(bool checked);
99  void SetMacroEditorActionChecked(bool checked);
100  void SetPythonShellActionChecked(bool checked);
101  void SetHistoryDialogActionChecked(bool checked);
102  void SpectrumRequested(QString dataset_key, QString map_name, size_t index);
103  void HeldSpectrumRequested(QString dataset_key, QString map_name, size_t index);
104  void ItemSelected(TreeItem *item);
105 private slots:
106  void on_actionExit_triggered();
107 
108  void on_actionImport_Dataset_from_File_triggered();
109 
110  void on_actionAbout_Vespucci_triggered();
111 
112  void on_actionCiting_Vespucci_triggered();
113 
114  void on_actionNew_Univariate_Map_triggered();
115 
116  void on_actionNew_Band_Ratio_Map_triggered();
117 
118  void on_actionPrincipal_Components_Analysis_triggered();
119 
120  void on_actionNormalize_Standardize_triggered();
121 
122  void on_actionSubtract_Background_triggered();
123 
124  void on_actionSpectra_triggered();
125 
126  void on_actionAverage_Spectra_triggered();
127 
128  void on_actionAverage_Spectra_with_Abscissa_triggered();
129 
130  void on_actionSpectral_Abscissa_triggered();
131 
132  void on_actionAll_Data_triggered();
133 
134  void on_actionFilter_Derivatize_triggered();
135 
136  void on_actionClose_Dataset_triggered();
137 
138  void on_actionDocumentation_triggered();
139 
140  void on_actionCrop_triggered();
141 
142  void on_actionCorrect_Baseline_triggered();
143 
144  void on_actionPartial_Least_Squares_triggered();
145 
146  void on_actionK_Means_Clustering_triggered();
147 
148  void on_actionVertex_Components_triggered();
149 
150  void on_actionUndo_triggered();
151 
152  void on_actionDelete_Map_triggered();
153 
154  void on_actionNew_Composite_Dataset_triggered();
155 
156  void on_actionReject_Clipped_Spectra_triggered();
157 
158  void on_actionSpectra_as_Columns_triggered();
159 
160  void on_actionBooleanize_Clamp_triggered();
161 
162  void on_actionRemove_Vectors_of_Zeros_triggered();
163 
164  void on_actionRun_script_triggered();
165 
166  void on_actionDetect_Peaks_triggered();
167 
168  void on_actionCalculate_Peak_Populations_triggered();
169 
170  void on_actionImport_From_Multiple_Point_Spectra_triggered();
171 
172  void on_actionBatch_File_Conversion_triggered();
173 
174  void on_actionClassical_Least_Squares_triggered();
175 
176  void on_actionSettings_triggered();
177 
178  void on_actionTransform_Abscissa_triggered();
179 
180  void on_actionFourierTransform_triggered();
181 
182  void on_actionInterpolate_to_New_Abscissa_triggered();
183 
184  void on_actionSave_Log_File_triggered();
185 
186  void on_actionImport_Dataset_from_Multiple_Files_triggered();
187 
188  void on_actionCreate_Plot_triggered();
189 
190  void on_actionPlot_Viewer_toggled(bool arg1);
191 
192  void ChildDialogVisibleToggled(const QString &key, bool arg1);
193 
194  void on_actionData_Viewer_toggled(bool arg1);
195 
196  void on_actionStatistics_Viewer_toggled(bool arg1);
197 
198  void on_actionSpectrum_Editor_toggled(bool arg1);
199 
200  void on_actionPython_Shell_toggled(bool arg1);
201 
202  void on_actionMacro_Editor_toggled(bool arg1);
203 
204  void on_actionMapResult_triggered();
205 
206  void on_actionOnline_Documentation_triggered();
207 
208  void on_actionGlobal_Color_Scales_triggered();
209 
210  void on_datasetTreeView_clicked(const QModelIndex &index);
211 
212  void on_datasetTreeView_doubleClicked(const QModelIndex &index);
213 
214  void on_actionShow_in_Data_Viewer_triggered();
215 
216  void on_actionView_Statistics_triggered();
217 
218  void on_actionPlotResult_triggered();
219 
220  void on_actionSave_Dataset_triggered();
221 
222  void on_actionOpenDataset_triggered();
223 
224  void on_actionSave_Dataset_As_triggered();
225 
226  void on_actionExport_Matrix_triggered();
227 
228  void on_actionImport_Data_Into_Dataset_triggered();
229 
230  void on_actionCalculate_Representative_Spectrum_triggered();
231 
232  void on_actionTransform_triggered();
233 
234  void on_actionOn_Multiple_Datasets_triggered();
235 
236  void on_actionHierarchical_Clustering_triggered();
237 
238 
239  void on_actionHistory_toggled(bool arg1);
240 
241  void on_actionConcatenate_triggered();
242 
243  void on_actionAnalyze_triggered();
244 
245  void on_actionNew_Dataset_from_Matrix_triggered();
246 
247  void on_actionEstimate_Dimensionality_triggered();
248 
249 private:
250  void CloseDataset(const QString &name);
251  Ui::MainWindow *ui;
252 
253  PlotViewer *plot_viewer_;
254  DataViewer *data_viewer_;
255  StatsDialog *stats_viewer_;
256  MacroDialog *macro_editor_;
257  SpectrumEditor *spectrum_editor_;
258  PythonShellDialog *python_shell_;
259  HistoryDialog *history_dialog_;
260  MatrixSelectionDialog *matrix_selection_dialog_;
261 
262 
266  QSharedPointer<VespucciWorkspace> workspace_;
267 
268 
272  DatasetTreeModel *dataset_tree_model_;
273 
274  unsigned int global_map_count_;
275 
276  QMap<QString, QDialog*> child_dialogs_;
277 
278  TreeItem *selected_item_;
279 
280  bool item_selected_;
281 };
282 
283 #endif // MAINWINDOW_H
284 
285 
286 
Definition: ahcadialog.h:26
The RangeDialog class.
Definition: rangedialog.h:32
VESPUCCI_EXPORT arma::uword max(arma::uword a, arma::uword b)
Vespucci::Math::max.
Definition: accessory.cpp:237
The VespucciDataset class This is the main class for dealing with hyperspectral data. This handles the import and export of spectra, and the creation of maps. Images are handled by the MapData class. This class is intended to be allocated on the heap inside of a smart pointer, there is no copy constructor.
The DataViewer class Window that displays dataset elements in a QTableView widget inside a QTabWidget...
Definition: dataviewer.h:41
The VespucciWorkspace class A class which contains all "global variables" (that aren&#39;t held in MainWi...
VESPUCCI_EXPORT arma::uword min(arma::uword a, arma::uword b)
Vespucci::Math::min.
Definition: accessory.cpp:249
Defines a color gradient for use with e.g. QCPColorMap.
Definition: qcustomplot.h:1905
Represents the range an axis is encompassing.
Definition: qcustomplot.h:481
The MainWindow class The main window of the program, this is where the user performs most operations...
Definition: mainwindow.h:58