Slicer  5.1
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 class 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 
121  QString nodeModule(vtkMRMLNode* node, double *confidence=nullptr)const;
122 
123  Q_INVOKABLE ctkSettingsDialog* settingsDialog()const;
124  Q_INVOKABLE void openSettingsDialog(const QString& settingsPanel=QString());
125 
142  Q_INVOKABLE virtual void logApplicationInformation() const;
143 
144 #ifdef Slicer_BUILD_DICOM_SUPPORT
145  Q_INVOKABLE ctkDICOMBrowser* createDICOMBrowserForMainDatabase();
148 #endif
149 
150 #ifdef Q_OS_WIN32
151  Q_INVOKABLE static unsigned long int windowsOSBuildNumber();
153 
155  Q_INVOKABLE static unsigned int windowsActiveCodePage();
156 #endif
157 
160  Q_INVOKABLE static bool isCodePageUtf8();
161 
162 public slots:
163 
169  void openNodeModule(vtkMRMLNode* node, QString role=QString(), QString context=QString());
170 
173  void confirmRestart(QString reason = QString());
174 
177  bool launchDesigner(const QStringList& args = QStringList());
178 
179 #ifdef Slicer_BUILD_EXTENSIONMANAGER_SUPPORT
180  void openExtensionsManagerDialog();
182 
184  void openExtensionsCatalogWebsite();
185 #endif
186 
188  int numberOfRecentLogFilesToKeep();
189 
191  QStringList recentLogFiles();
192 
195  QString currentLogFile()const;
196 
203  void setHasBorderInFullScreen(bool);
204 
210  void setRenderPaused(bool pause) override;
211 
214  void pauseRender() override;
215 
218  void resumeRender() override;
219 
221  bool loadFiles(const QStringList& filePaths, vtkMRMLMessageCollection* userMessages = nullptr) override;
222 
223 signals:
224 
234  void startupCompleted();
235 
240  void renderPaused(bool);
241 
242 protected slots:
243 
245  void editNode(vtkObject*, void*, unsigned long) override;
246 
247 protected:
250  void handleCommandLineArguments() override;
251  void onSlicerApplicationLogicModified() override;
252 
255  void setupFileLogging();
256 
257 private:
258  Q_DECLARE_PRIVATE(qSlicerApplication);
259  Q_DISABLE_COPY(qSlicerApplication);
260 };
261 
265 void Q_SLICER_BASE_QTGUI_EXPORT qSlicerApplyPalette(QPalette& palette);
266 
267 #endif
virtual void onSlicerApplicationLogicModified()
virtual bool loadFiles(const QStringList &filePaths, vtkMRMLMessageCollection *userMessages=nullptr)
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