Slicer 5.9
Slicer is a multi-platform, free and open source software package for visualization and medical image computing
All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Modules Pages
qSlicerCoreCommandOptions.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 __qSlicerCoreCommandOptions_h
22#define __qSlicerCoreCommandOptions_h
23
24// CTK includes
25#include <ctkCommandLineParser.h>
26
27#include "qSlicerBaseQTCoreExport.h"
28#include "vtkSlicerConfigure.h" // For Slicer_USE_PYTHONQT
29
30class QSettings;
31class qSlicerCoreCommandOptionsPrivate;
32
33class Q_SLICER_BASE_QTCORE_EXPORT qSlicerCoreCommandOptions : public ctkCommandLineParser
34{
35 Q_OBJECT
36 Q_PROPERTY(bool displayHelpAndExit READ displayHelpAndExit CONSTANT)
37 Q_PROPERTY(bool ignoreSlicerRC READ ignoreSlicerRC CONSTANT)
38 Q_PROPERTY(QString pythonScript READ pythonScript CONSTANT)
39 Q_PROPERTY(QString extraPythonScript READ extraPythonScript CONSTANT)
41 Q_PROPERTY(QString pythonCode READ pythonCode CONSTANT)
43 Q_PROPERTY(bool disableCLIModules READ disableCLIModules CONSTANT)
44 Q_PROPERTY(bool disableLoadableModules READ disableLoadableModules CONSTANT)
50 Q_PROPERTY(bool displayVersionAndExit READ displayVersionAndExit CONSTANT)
52 Q_PROPERTY(bool displayHomePathAndExit READ displayHomePathAndExit CONSTANT)
55 Q_PROPERTY(bool displayMessageAndExit READ displayMessageAndExit STORED false CONSTANT)
56 Q_PROPERTY(bool verboseModuleDiscovery READ verboseModuleDiscovery CONSTANT)
57 Q_PROPERTY(bool disableMessageHandlers READ disableMessageHandlers CONSTANT)
58 Q_PROPERTY(bool testingEnabled READ isTestingEnabled CONSTANT)
59#ifdef Slicer_USE_PYTHONQT
60 Q_PROPERTY(bool pythonDisabled READ isPythonDisabled CONSTANT)
61#endif
62 Q_PROPERTY(QStringList additionalModulePaths READ additionalModulePaths CONSTANT)
63 Q_PROPERTY(QStringList modulesToIgnore READ modulesToIgnore CONSTANT)
64public:
65 typedef ctkCommandLineParser Superclass;
68
70 bool parse(const QStringList& arguments);
71
73 bool displayHelpAndExit()const;
74
76 bool ignoreRest() const;
77
79 bool ignoreSlicerRC()const;
80
82 QString pythonScript()const;
83
85 QString extraPythonScript()const;
86
88 void setExtraPythonScript(const QString& newExtraPythonScript);
89
97 QString pythonCode()const;
98
100 bool runPythonAndExit()const;
101
103 void setRunPythonAndExit(bool value);
104
106 QStringList additionalModulePaths()const;
107
109 QStringList modulesToIgnore()const;
110
112 bool disableModules()const;
113
116
118 bool disableCLIModules()const;
119
122
125
128
131
134
137
140
143
146
149
159 virtual bool displayMessageAndExit() const;
160
163
166
168 bool verbose()const;
169
172
179
186 bool settingsDisabled() const;
187
193
199 bool isTestingEnabled()const;
200
201#ifdef Slicer_USE_PYTHONQT
205 bool isPythonDisabled()const;
206#endif
207
208
209protected:
212 virtual void addArguments();
213
216 QHash<QString, QVariant> parsedArgs() const;
217
218protected:
219 QScopedPointer<qSlicerCoreCommandOptionsPrivate> d_ptr;
220
221private:
222 Q_DECLARE_PRIVATE(qSlicerCoreCommandOptions);
223 Q_DISABLE_COPY(qSlicerCoreCommandOptions);
224
225};
226
227#endif
bool disableModules() const
Return True if the loading of any modules should be disabled.
bool ignoreRest() const
Return True if the ignore rest argument has been passed.
bool disableTerminalOutputs() const
bool parse(const QStringList &arguments)
Convenient method allowing to parse arguments.
QHash< QString, QVariant > parsedArgs() const
bool disableBuiltInModules() const
Return True if the loading of all built-in modules should be disabled.
bool isTestingEnabled() const
bool verbose() const
Return True if slicer should display information at startup.
bool keepTemporarySettings() const
void setExtraPythonScript(const QString &newExtraPythonScript)
Set extra python script to be executed after slicer is loaded.
QScopedPointer< qSlicerCoreCommandOptionsPrivate > d_ptr
bool settingsDisabled() const
void setExtraPythonScriptProcessedArgumentsCount(int argumentCount)
virtual void addArguments()
void setRunPythonAndExit(bool value)