Computer Assited Medical Intervention Tool Kit
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
MainWindow.h
Go to the documentation of this file.
1 /*****************************************************************************
2  * $CAMITK_LICENCE_BEGIN$
3  *
4  * CamiTK - Computer Assisted Medical Intervention ToolKit
5  * (c) 2001-2013 UJF-Grenoble 1, CNRS, TIMC-IMAG UMR 5525 (GMCAO)
6  *
7  * Visit http://camitk.imag.fr for more information
8  *
9  * This file is part of CamiTK.
10  *
11  * CamiTK is free software: you can redistribute it and/or modify
12  * it under the terms of the GNU Lesser General Public License version 3
13  * only, as published by the Free Software Foundation.
14  *
15  * CamiTK is distributed in the hope that it will be useful,
16  * but WITHOUT ANY WARRANTY; without even the implied warranty of
17  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
18  * GNU Lesser General Public License version 3 for more details.
19  *
20  * You should have received a copy of the GNU Lesser General Public License
21  * version 3 along with CamiTK. If not, see <http://www.gnu.org/licenses/>.
22  *
23  * $CAMITK_LICENCE_END$
24  ****************************************************************************/
25 
26 
27 #ifndef MAINWINDOW_H
28 #define MAINWINDOW_H
29 
30 // -- Core stuff
31 #include "CamiTKAPI.h"
32 #include "ConsoleStream.h"
33 
34 // -- QT stuff
35 #include <QMainWindow>
36 #include <QApplication>
37 #include <QDir>
38 #include <QTextEdit>
39 #include <QProgressBar>
40 #include <QStatusBar>
41 
42 
43 namespace camitk {
44 
45 // -- Core stuff classes
46 class Component;
47 class Viewer;
48 
59 class CAMITK_API MainWindow : public QMainWindow {
60  Q_OBJECT
61 
62 public:
63 
66 
72  MainWindow(QString title);
73 
75  virtual ~MainWindow();
76 
80  virtual void aboutToShow();
81 
83 
86 
93  void setWindowSubtitle(QString);
94 
96  QProgressBar * getProgressBar();
97 
99  void showStatusBar(bool);
100 
102  virtual void redirectToConsole(bool);
103 
105  void showConsole(bool);
107 
110 
115  virtual bool addViewer(Viewer*);
116 
118  virtual void showViewer(Viewer *, bool);
119 
124  virtual void addDockViewer(Qt::DockWidgetArea, Viewer*);
125 
127  void refreshViewers();
128 
133  virtual void setCentralViewer(Viewer*);
135 
136 public slots:
137 
139 
140 
141  virtual void refresh();
142 
144  void show();
146 
147 
148 protected:
149 
151  virtual void closeEvent ( QCloseEvent *);
152 
154 
155 
156  QList<Viewer *> viewers;
157 
159  QMap<Viewer*, QDockWidget*> dockWidgetMap;
160 
162  virtual void initSettings();
164 
166  void dragEnterEvent(QDragEnterEvent *event);
167 
169  void dragMoveEvent(QDragMoveEvent* event);
170 
172  void dragLeaveEvent(QDragLeaveEvent* event);
173 
175  void dropEvent(QDropEvent *event);
176 
177 private:
178 
181 
184 
186  QProgressBar *myProgressBar;
187 
189  QDialog *consoleWindow;
190 
193 
195  QString mainTitle;
196 };
197 }
198 
199 
200 #endif // MAINWINDOW_H