Computer Assisted Medical Intervention Tool Kit version 6.0
 
Loading...
Searching...
No Matches
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-2025 Univ. Grenoble Alpes, CNRS, Grenoble INP - UGA, TIMC, 38000 Grenoble, France
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 <QLineEdit>
40#include <QProgressBar>
41#include <QStatusBar>
42#include <QStackedLayout>
43
44namespace camitk {
45
46// -- Core stuff classes
47class Component;
48class Viewer;
49class LogSyntaxHighlighter;
50
68class CAMITK_API MainWindow : public QMainWindow {
69 Q_OBJECT
70
71public:
72
75
81 MainWindow(QString title);
82
84 ~MainWindow() override;
85
89 virtual void aboutToShow();
90
92
95
97 QString getName() const;
98
106 void setWindowSubtitle(QString);
107
109 QProgressBar* getProgressBar();
110
112 void showStatusBar(bool);
113
115 virtual void redirectToConsole(bool);
116
118 void showConsole(bool);
119
121 bool getConsoleVisibility();
123
127 virtual void initSettings();
128
130 void saveSettings();
132
135
137 virtual void showDockViewer(Viewer*, bool);
138
147 virtual void addDockViewer(Qt::DockWidgetArea, Viewer*);
148
150 void refreshViewers();
151
161 virtual void setCentralViewer(Viewer*);
162
166 virtual Viewer* getCentralViewer() const;
168
169public slots:
170
174 virtual void refresh();
175
177 void show();
179
180protected:
181
183 void closeEvent(QCloseEvent*) override;
184
189
191 QMap<Viewer*, QDockWidget*> dockWidgetMap;
192
194
196 void dragEnterEvent(QDragEnterEvent* event) override;
197
199 void dragMoveEvent(QDragMoveEvent* event) override;
200
202 void dragLeaveEvent(QDragLeaveEvent* event) override;
203
205 void dropEvent(QDropEvent* event) override;
206
212
213
214private:
215
222 virtual bool addViewer(Viewer*);
223
225 ConsoleStream cout;
226
228 ConsoleStream cerr;
229
231 QProgressBar* myProgressBar;
232
234 QDockWidget* consoleWindow;
235
237 QTextEdit* consoleWindowTextEdit;
238
240 LogSyntaxHighlighter* logSyntaxHighlighter;
241
243 QString mainTitle;
244
247 QStackedLayout* centralLayout;
248
249};
250}
251
252
253#endif // MAINWINDOW_H
#define CAMITK_API
Definition CamiTKAPI.h:66
A component is something that composed something and could also be a part of something.
Definition modeling/libraries/pml/Component.h:48
Definition PersistenceManager.h:30
Provides a console windows, within the CamiTK application.
Definition ConsoleStream.h:74
Simple Syntax highlighter for CamiTK Log syntax.
Definition LogSyntaxHighlighter.h:39
This class is the base class for your application.
Definition MainWindow.h:68
QList< Viewer * > viewers
Definition MainWindow.h:188
QMap< Viewer *, QDockWidget * > dockWidgetMap
the map that gives the corresponding QDockWidget for a given Viewer
Definition MainWindow.h:191
Viewer * centralViewer
The actual central Viewer.
Definition MainWindow.h:211
Viewer is an abstract class that is the base class for all viewers.
Definition Viewer.h:182
Definition Action.cpp:40