Slicer  5.0
Slicer is a multi-platform, free and open source software package for visualization and medical image computing
qSlicerScriptedLoadableModule.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 __qSlicerScriptedLoadableModule_h
22 #define __qSlicerScriptedLoadableModule_h
23 
24 // Qt includes
25 #include <QVariantMap>
26 
27 // Slicer includes
28 #include "qSlicerLoadableModule.h"
29 
30 #include "qSlicerBaseQTGUIExport.h"
31 
32 class qSlicerScriptedLoadableModulePrivate;
33 
34 class Q_SLICER_BASE_QTGUI_EXPORT qSlicerScriptedLoadableModule : public qSlicerLoadableModule
35 {
36  Q_OBJECT
37  Q_PROPERTY(QString title READ title WRITE setTitle)
39  Q_PROPERTY(QStringList categories READ categories WRITE setCategories)
40  Q_PROPERTY(QStringList contributors READ contributors WRITE setContributors)
41  Q_PROPERTY(QStringList associatedNodeTypes READ associatedNodeTypes WRITE setAssociatedNodeTypes)
42  Q_PROPERTY(QString helpText READ helpText WRITE setHelpText)
43  Q_PROPERTY(QString acknowledgementText READ acknowledgementText WRITE setAcknowledgementText)
44  Q_PROPERTY(QVariantMap extensions READ extensions WRITE setExtensions)
45  Q_PROPERTY(QIcon icon READ icon WRITE setIcon)
46  Q_PROPERTY(bool hidden READ isHidden WRITE setHidden)
47  Q_PROPERTY(QStringList dependencies READ dependencies WRITE setDependencies)
48  Q_PROPERTY(int index READ index WRITE setIndex)
49 
50 public:
51 
53  typedef qSlicerScriptedLoadableModulePrivate Pimpl;
54  qSlicerScriptedLoadableModule(QObject *parent=nullptr);
56 
57  QString pythonSource()const;
58  bool setPythonSource(const QString& newPythonSource);
59 
60  QString title()const override ;
61  void setTitle(const QString& newTitle);
62 
63  QStringList categories()const override;
64  void setCategories(const QStringList& newCategories);
65 
66  QStringList contributors()const override;
67  void setContributors(const QStringList& newContributors);
68 
69  QStringList associatedNodeTypes()const override;
70  void setAssociatedNodeTypes(const QStringList& newAssociatedNodeTypes);
71 
72  QString helpText()const override;
73  void setHelpText(const QString& newHelpText);
74 
75  QString acknowledgementText()const override;
76  void setAcknowledgementText(const QString& newAcknowledgementText);
77 
78  virtual QVariantMap extensions()const;
79  void setExtensions(const QVariantMap& extensions);
80 
81  QIcon icon()const override;
82  void setIcon(const QIcon& newIcon);
83 
84  QStringList dependencies() const override;
85  void setDependencies(const QStringList& dependencies);
86 
87  int index() const override;
88  void setIndex(const int index);
89 
92  bool isHidden()const override;
93  void setHidden(bool hidden);
94 
95 protected:
96 
97  void setup() override;
98 
99  void registerFileDialog();
100 
101  void registerIO();
102 
103  qSlicerAbstractModuleRepresentation* createWidgetRepresentation() override;
104 
105  vtkMRMLAbstractLogic* createLogic() override;
106 
107 protected:
108  QScopedPointer<qSlicerScriptedLoadableModulePrivate> d_ptr;
109 
110 private:
111  Q_DECLARE_PRIVATE(qSlicerScriptedLoadableModule);
112  Q_DISABLE_COPY(qSlicerScriptedLoadableModule);
113 };
114 
115 #endif
Superclass for MRML logic classes.
list extensions
Definition: conf.py:36
qSlicerScriptedLoadableModulePrivate Pimpl