Slicer 5.9
Slicer is a multi-platform, free and open source software package for visualization and medical image computing
Loading...
Searching...
No Matches
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 Q_PROPERTY(bool pythonDisabled READ isPythonDisabled CONSTANT)
60 Q_PROPERTY(QStringList additionalModulePaths READ additionalModulePaths CONSTANT)
61 Q_PROPERTY(QStringList modulesToIgnore READ modulesToIgnore CONSTANT)
62public:
63 typedef ctkCommandLineParser Superclass;
66
68 bool parse(const QStringList& arguments);
69
71 bool displayHelpAndExit() const;
72
74 bool ignoreRest() const;
75
77 bool ignoreSlicerRC() const;
78
80 QString pythonScript() const;
81
83 QString extraPythonScript() const;
84
86 void setExtraPythonScript(const QString& newExtraPythonScript);
87
95 QString pythonCode() const;
96
98 bool runPythonAndExit() const;
99
101 void setRunPythonAndExit(bool value);
102
104 QStringList additionalModulePaths() const;
105
107 QStringList modulesToIgnore() const;
108
110 bool disableModules() const;
111
114
116 bool disableCLIModules() const;
117
120
123
126
129
132
135
138
141
144
147
157 virtual bool displayMessageAndExit() const;
158
161
164
166 bool verbose() const;
167
170
177
184 bool settingsDisabled() const;
185
191
197 bool isTestingEnabled() const;
198
204 bool isPythonDisabled() const;
205
206protected:
209 virtual void addArguments();
210
213 QHash<QString, QVariant> parsedArgs() const;
214
215protected:
216 QScopedPointer<qSlicerCoreCommandOptionsPrivate> d_ptr;
217
218private:
219 Q_DECLARE_PRIVATE(qSlicerCoreCommandOptions);
220 Q_DISABLE_COPY(qSlicerCoreCommandOptions);
221};
222
223#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
bool isPythonDisabled() const
void setExtraPythonScriptProcessedArgumentsCount(int argumentCount)
virtual void addArguments()
void setRunPythonAndExit(bool value)