Slicer  4.11
Slicer is a multi-platform, free and open source software package for visualization and medical image computing
qSlicerApplication.h
Go to the documentation of this file.
1 /*==============================================================================
2 
3  Program: 3D Slicer
4 
5  Copyright (c) Kitware Inc.
6 
7  See COPYRIGHT.txt
8  or http://www.slicer.org/copyright/copyright.txt for details.
9 
10  Unless required by applicable law or agreed to in writing, software
11  distributed under the License is distributed on an "AS IS" BASIS,
12  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13  See the License for the specific language governing permissions and
14  limitations under the License.
15 
16  This file was originally developed by Jean-Christophe Fillion-Robin, Kitware Inc.
17  and was partially funded by NIH grant 3P41RR013218-12S1
18 
19 ==============================================================================*/
20 
21 #ifndef __qSlicerApplication_h
22 #define __qSlicerApplication_h
23 
24 // Qt includes
25 #include <QPalette>
26 
27 // CTK includes
28 #include <ctkPimpl.h>
29 #include <ctkSettingsDialog.h>
30 
31 // QTCORE includes
32 #include "qSlicerCoreApplication.h"
33 
34 // QTGUI includes
35 #include "qSlicerBaseQTGUIExport.h"
36 
37 class QMainWindow;
38 class qSlicerApplicationPrivate;
40 class qSlicerIOManager;
41 #ifdef Slicer_USE_PYTHONQT
43 #endif
45 class qSlicerWidget;
46 
47 class ctkErrorLogModel;
48 #ifdef Slicer_USE_QtTesting
49 class ctkQtTestingUtility;
50 #endif
51 
52 #ifdef Slicer_BUILD_DICOM_SUPPORT
53 class ctkDICOMBrowser;
54 #endif
55 
56 // MRML includes
57 class vtkMRMLNode;
58 
59 class Q_SLICER_BASE_QTGUI_EXPORT qSlicerApplication : public qSlicerCoreApplication
60 {
61  Q_OBJECT
62 public:
63 
65  qSlicerApplication(int &argc, char **argv);
66  ~qSlicerApplication() override;
67 
70 
82  bool notify(QObject * receiver, QEvent * event) override;
83 
85  Q_INVOKABLE qSlicerCommandOptions* commandOptions()const;
86 
88  Q_INVOKABLE qSlicerIOManager* ioManager();
89 
90 #ifdef Slicer_USE_PYTHONQT
91  Q_INVOKABLE qSlicerPythonManager * pythonManager();
93  Q_INVOKABLE ctkPythonConsole * pythonConsole();
94 #endif
95 
96  #ifdef Slicer_USE_QtTesting
97  Q_INVOKABLE ctkQtTestingUtility* testingUtility();
99  #endif
100 
102  Q_INVOKABLE qSlicerLayoutManager* layoutManager()const;
103  Q_INVOKABLE void setLayoutManager(qSlicerLayoutManager* layoutManager);
104 
106  QMainWindow* mainWindow()const;
107 
111  //virtual void commitData(QSessionManager & manager);
112 
114  void setToolTipsEnabled(bool enable);
115 
117  QString nodeModule(vtkMRMLNode* node)const;
118 
119  Q_INVOKABLE ctkSettingsDialog* settingsDialog()const;
120 
138  Q_INVOKABLE virtual void logApplicationInformation() const;
139 
140 #ifdef Slicer_BUILD_DICOM_SUPPORT
141  Q_INVOKABLE ctkDICOMBrowser* createDICOMBrowserForMainDatabase();
144 #endif
145 
146 #ifdef Q_OS_WIN32
147  Q_INVOKABLE static unsigned long int windowsOSBuildNumber();
149 
151  Q_INVOKABLE static unsigned int windowsActiveCodePage();
152 #endif
153 
156  Q_INVOKABLE static bool isCodePageUtf8();
157 
158 public slots:
159 
165  void openNodeModule(vtkMRMLNode* node);
166 
169  void confirmRestart(QString reason = QString());
170 
173  bool launchDesigner(const QStringList& args = QStringList());
174 
175 #ifdef Slicer_BUILD_EXTENSIONMANAGER_SUPPORT
176  void openExtensionsManagerDialog();
177 #endif
178 
180  int numberOfRecentLogFilesToKeep();
181 
183  QStringList recentLogFiles();
184 
187  QString currentLogFile()const;
188 
195  void setHasBorderInFullScreen(bool);
196 
202  void setRenderPaused(bool pause) override;
203 
206  void pauseRender() override;
207 
210  void resumeRender() override;
211 
212 signals:
213 
223  void startupCompleted();
224 
229  void renderPaused(bool);
230 
231 protected slots:
232 
234  void editNode(vtkObject*, void*, unsigned long) override;
235 
236 protected:
239  void handleCommandLineArguments() override;
240  void onSlicerApplicationLogicModified() override;
241 
244  void setupFileLogging();
245 
246 private:
247  Q_DECLARE_PRIVATE(qSlicerApplication);
248  Q_DISABLE_COPY(qSlicerApplication);
249 };
250 
254 void Q_SLICER_BASE_QTGUI_EXPORT qSlicerApplyPalette(QPalette& palette);
255 
256 #endif
virtual void onSlicerApplicationLogicModified()
static qSlicerCoreApplication * application()
void Q_SLICER_BASE_QTGUI_EXPORT qSlicerApplyPalette(QPalette &palette)
qSlicerCoreApplication Superclass
virtual void handleCommandLineArguments()
virtual void setRenderPaused(bool pause)
virtual void editNode(vtkObject *, void *, unsigned long)
virtual void handlePreApplicationCommandLineArguments()
Abstract Superclass for all specific types of MRML nodes.
Definition: vtkMRMLNode.h:167