00001
00011
00012
00013 #ifndef MAIN_WINDOW_H
00014 #define MAIN_WINDOW_H
00015
00016 #include "../global/global_definitions.h"
00017
00018 #include <QMainWindow>
00019 #include <QDockWidget>
00020
00021 #include <map>
00022
00023 class QAction;
00024 class QListWidget;
00025 class QMenu;
00026 class QTextEdit;
00027 class QTabWidget;
00028 class QToolBox;
00029 class QComboBox;
00030 class QSettings;
00031
00032 class string;
00033 class vector;
00034
00035 namespace imedgine
00036 {
00037
00038 class Controller;
00039 class ChooseViewsDialog;
00040 class TabOrganizer;
00041 class DatasetsViewer;
00042 class AlgorithmWidget;
00043 class DatasetConfigurationTabWidget;
00044 class SettingsDialog;
00045 class AboutDialog;
00046
00047
00050
00051
00066
00067
00068 class MainWindow : public QMainWindow
00069 {
00070 Q_OBJECT
00071
00072 public:
00073
00074
00077
00078 MainWindow();
00079
00080
00083
00084 virtual ~MainWindow();
00085
00086
00092
00093 void openOverview(dataset_key_type const& dataset, dataset_type type);
00094
00095 public slots:
00096
00097
00098
00099
00104
00105 void openOverview(dataset_key_type const& dataset);
00106
00107
00113
00114 void newDatasetsAdded(
00115 std::vector<std::pair<dataset_key_type, dataset_type> > const& dataset_keys_and_types);
00116
00117
00122
00123 void openNewWorkspace(const std::vector<view_pointer_type>& view_vector);
00124
00125 signals:
00126
00127
00131
00132 void newDatasetLoaded(dataset_key_type const& dataset_name);
00133
00134
00138
00139 void closeDatasetSignal(dataset_key_type const& dataset);
00140
00141 void datasetClosedSignal(dataset_key_type const& dataset);
00142
00143 private slots:
00144
00145
00148
00149 void openFileFromDialog();
00150
00151
00155
00156
00157
00158 void openRecentFile();
00159
00160
00163
00164 void newTabSlot();
00165
00166
00170
00171 void closeDataset(dataset_key_type const& dataset_name);
00172
00173 void checkForDirtyToSave();
00174
00175
00184
00185 void saveSpecificVolumeDataset(dataset_key_type const& dataset_name);
00186
00187
00192
00193 void openDatasetSaveSelectionDialog();
00194
00195
00199
00200 void saveVolumeDatasetAs(dataset_key_type const& dataset_name);
00201
00202
00203
00204
00208
00209 void updateGuiInteractionMode();
00210
00211
00215
00216 void openSettingsDialog();
00217
00218
00222
00223 void openAboutDialog();
00224
00225
00226
00227 private:
00228
00229
00233
00234 void setupUI();
00235
00236
00240
00241 void createActions();
00242
00243
00247
00248 void createMenus();
00249
00250
00254
00255 void createToolBars();
00256
00257
00261
00262 void createStatusBar();
00263
00264
00268
00269 void initializeConnections();
00270
00271
00275
00276 void loadDataset(const QString& file_path);
00277
00278
00282
00283 void updateRecentFileList(const QString& file_path);
00284
00285
00289
00290 void updateRecentFileActions();
00291
00292
00298
00299 QString strippedName(const QString& full_file_name);
00300
00301
00305
00306 void toggleDatasetDependendActionStatus(bool enable);
00307
00308
00309 bool first_launch_;
00310
00313 std::map<dataset_key_type, dataset_type> loaded_datasets_;
00314
00315 QDockWidget* dataset_configuration_editor_dock_widget_;
00316 QDockWidget* datasets_viewer_dock_widget_;
00317 QDockWidget* algorithm_config_dock_widget_;
00318
00320 QToolBox* tool_box_;
00321
00323 DatasetsViewer* datasets_viewer_;
00324
00326 AlgorithmWidget* algo_widget_;
00327
00329 DatasetConfigurationTabWidget* dataset_configuration_tab_widget_;
00330
00332 TabOrganizer* tab_organizer_;
00333
00335 ChooseViewsDialog* choose_views_dialog_;
00336
00337 SettingsDialog* settings_dialog_;
00338
00339 AboutDialog* about_dialog_;
00340
00341
00342 QMenu* file_menu_;
00343 QMenu* edit_menu_;
00344 QMenu* view_menu_;
00345 QMenu* settings_menu_;
00346 QMenu* help_menu_;
00347 QMenu* toolbox_menu_;
00348
00350 QToolBar* main_tool_bar_;
00351 QToolBar* mode_tool_bar_;
00352
00353
00354 enum { max_recent_files = 5 };
00355
00356
00358 QAction* load_dataset_action_;
00359 QAction* save_dataset_action_;
00360 QAction* save_as_dataset_action_;
00362 QAction* new_tab_action_;
00363 QAction* recent_file_actions_[max_recent_files];
00364 QAction* quit_action_;
00366 QAction* configure_imedgine_action_;
00367 QAction* toggle_datasets_viewer_action_;
00368 QAction* toggle_dataset_configuration_editor_action_;
00369 QAction* separator_action_;
00370
00371 QAction* about_action_;
00372
00373
00374
00375 QAction* standard_mode_action_;
00376 QAction* zoom_in_mode_action_;
00377 QAction* zoom_out_mode_action_;
00378 QAction* pan_mode_action_;
00379 QAction* rotation_mode_action_;
00380 QAction* region_of_interest_rectangle_mode_action_;
00381 QAction* region_of_interest_ellipse_mode_action_;
00382 QAction* region_of_interest_poly_line_mode_action_;
00383 QAction* region_of_interest_freehand_mode_action_;
00384
00385 };
00386 #endif
00387 }