Slicer  4.10
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 // SlicerQt 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=0);
56 
57  QString pythonSource()const;
58  bool setPythonSource(const QString& newPythonSource);
59 
60  virtual QString title()const ;
61  void setTitle(const QString& newTitle);
62 
63  virtual QStringList categories()const;
64  void setCategories(const QStringList& newCategories);
65 
66  virtual QStringList contributors()const;
67  void setContributors(const QStringList& newContributors);
68 
69  virtual QStringList associatedNodeTypes()const;
70  void setAssociatedNodeTypes(const QStringList& newAssociatedNodeTypes);
71 
72  virtual QString helpText()const;
73  void setHelpText(const QString& newHelpText);
74 
75  virtual QString acknowledgementText()const;
76  void setAcknowledgementText(const QString& newAcknowledgementText);
77 
78  virtual QVariantMap extensions()const;
79  void setExtensions(const QVariantMap& extensions);
80 
81  virtual QIcon icon()const;
82  void setIcon(const QIcon& newIcon);
83 
84  virtual QStringList dependencies() const;
85  void setDependencies(const QStringList& dependencies);
86 
87  virtual int index() const;
88  void setIndex(const int index);
89 
92  virtual bool isHidden()const;
93  void setHidden(bool hidden);
94 
95 protected:
96 
97  virtual void setup();
98 
99  void registerFileDialog();
100 
101  void registerIO();
102 
103  virtual qSlicerAbstractModuleRepresentation* createWidgetRepresentation();
104 
105  virtual vtkMRMLAbstractLogic* createLogic();
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.
qSlicerScriptedLoadableModulePrivate Pimpl