Computer Assited Medical Intervention Tool Kit  version 3.3
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups 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-2014 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 
62 class CAMITK_API MainWindow : public QMainWindow {
63  Q_OBJECT
64 
65 public:
66 
69 
75  MainWindow(QString title);
76 
78  virtual ~MainWindow();
79 
83  virtual void aboutToShow();
84 
86 
89 
96  void setWindowSubtitle(QString);
97 
99  QProgressBar * getProgressBar();
100 
102  void showStatusBar(bool);
103 
105  virtual void redirectToConsole(bool);
106 
108  void showConsole(bool);
110 
113 
118  virtual bool addViewer(Viewer*);
119 
121  virtual void showViewer(Viewer *, bool);
122 
127  virtual void addDockViewer(Qt::DockWidgetArea, Viewer*);
128 
130  void refreshViewers();
131 
136  virtual void setCentralViewer(Viewer*);
138 
139 public slots:
140 
142  virtual void refresh();
145 
147  void show();
149 
150 
151 protected:
152 
154  virtual void closeEvent ( QCloseEvent *);
155 
157  QList<Viewer *> viewers;
160 
162  QMap<Viewer*, QDockWidget*> dockWidgetMap;
163 
165  virtual void initSettings();
167 
169  void dragEnterEvent(QDragEnterEvent *event);
170 
172  void dragMoveEvent(QDragMoveEvent* event);
173 
175  void dragLeaveEvent(QDragLeaveEvent* event);
176 
178  void dropEvent(QDropEvent *event);
179 
180 
181 private:
182 
185 
188 
190  QProgressBar *myProgressBar;
191 
193  QDialog *consoleWindow;
194 
197 
199  QString mainTitle;
200 };
201 }
202 
203 
204 #endif // MAINWINDOW_H
Viewer is an abstract viewer.
Definition: Viewer.h:55
This Class is the base class for your application.
Definition: MainWindow.h:62
QDialog * consoleWindow
console to display all messages
Definition: MainWindow.h:193
#define CAMITK_API
Definition: CamiTKAPI.h:49
QProgressBar * myProgressBar
the progress bar (access through setProgress() method)
Definition: MainWindow.h:190
Provides a console windows, within the CamiTK application.
Definition: ConsoleStream.h:72
Definition: ExtensionWindow.h:42
A component is something that composed something and could also be a part of something.
Definition: modeling/libraries/pml/Component.h:48
ConsoleStream cout
the output stream for the application console
Definition: MainWindow.h:184
QMap< Viewer *, QDockWidget * > dockWidgetMap
the map that gives the corresponding QDockWidget for a given Viewer
Definition: MainWindow.h:162
ConsoleStream cerr
the error stream for the application console
Definition: MainWindow.h:187
QString mainTitle
the main part of the title
Definition: MainWindow.h:199
QTextEdit * consoleWindowTextEdit
the QTextEdit part of the console dialog
Definition: MainWindow.h:196