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
qSlicerAbstractCoreModule.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 __qSlicerAbstractCoreModule_h
22#define __qSlicerAbstractCoreModule_h
23
24// Qt includes
25#include <QObject>
26#include <QStringList>
27
28// CTK includes
29#include <ctkPimpl.h>
30
31// QTBase includes
32#include "qSlicerBaseQTCoreExport.h"
33
37class vtkMRMLScene;
38class qSlicerAbstractCoreModulePrivate;
39
40
41#define qSlicerGetTitleMacro(_TITLE) \
42 static QString staticTitle() { return _TITLE; } \
43 QString title() const override { return _TITLE; }
44
46//
55class Q_SLICER_BASE_QTCORE_EXPORT qSlicerAbstractCoreModule : public QObject
56{
59 Q_OBJECT
60
63
73 Q_PROPERTY(QString name READ name)
74
75
81 Q_PROPERTY(QString title READ title)
82
92 Q_PROPERTY(QStringList categories READ categories)
93
101 Q_PROPERTY(int index READ index)
102
108 Q_PROPERTY(bool hidden READ isHidden)
109
118
123 Q_PROPERTY(QString helpText READ helpText)
124
133
141 Q_PROPERTY(QStringList contributors READ contributors)
142
147 Q_PROPERTY(QString slicerWikiUrl READ slicerWikiUrl)
148
153
160 Q_PROPERTY(QStringList dependencies READ dependencies)
161
168 Q_PROPERTY(QString path READ path)
169
174 Q_PROPERTY(bool isInstalled READ isInstalled)
175
180 Q_PROPERTY(bool isBuiltIn READ isBuiltIn)
181
189 Q_PROPERTY(QStringList associatedNodeTypes READ associatedNodeTypes)
190
191public:
192
193 typedef QObject Superclass;
199 qSlicerAbstractCoreModule(QObject *parent=nullptr);
201
202 virtual void printAdditionalInfo();
203
205 QString slicerWikiUrl()const{ return "https://www.slicer.org/w/index.php"; }
206
212
216
220 virtual QString name()const;
221 virtual void setName(const QString& name);
222
225 virtual QString title()const = 0;
226
232 virtual QStringList categories()const;
233
235 virtual int index()const;
236
241 virtual bool isHidden()const;
242
244 virtual QStringList contributors()const;
245
248 virtual QString helpText()const;
249
252 virtual QString acknowledgementText()const;
253
259
265
272
277
279 vtkMRMLAbstractLogic* moduleLogic(const QString& moduleName) const;
280
286
288 Q_INVOKABLE vtkMRMLScene* mrmlScene() const;
289
290 virtual QStringList dependencies()const;
291
294 QString path()const;
295 void setPath(const QString& newPath);
296
299 bool isInstalled()const;
300 void setInstalled(bool value);
301
304 bool isBuiltIn()const;
305 void setBuiltIn(bool value);
306
308 virtual QStringList associatedNodeTypes()const;
309
310public slots:
311
315
316protected:
318 virtual void setup() = 0;
319
322
326
327protected:
328 QScopedPointer<qSlicerAbstractCoreModulePrivate> d_ptr;
329
330private:
331 Q_DECLARE_PRIVATE(qSlicerAbstractCoreModule);
332 Q_DISABLE_COPY(qSlicerAbstractCoreModule);
334
337 void representationDeleted(qSlicerAbstractModuleRepresentation *representation);
338};
339
340#endif
vtkSlicerApplicationLogic * appLogic() const
void setInstalled(bool value)
qSlicerAbstractModuleRepresentation * createNewWidgetRepresentation()
virtual bool isHidden() const
virtual int index() const
Return the category index of the module.
vtkMRMLAbstractLogic * moduleLogic(const QString &moduleName) const
Convenience method for getting another module's logic from appLogic.
virtual QString acknowledgementText() const
void initialize(vtkSlicerApplicationLogic *appLogic)
virtual QString name() const
Q_INVOKABLE vtkMRMLScene * mrmlScene() const
Return a pointer on the MRML scene.
void setWidgetRepresentationCreationEnabled(bool value)
QString defaultDocumentationLink() const
virtual void setMRMLScene(vtkMRMLScene *)
virtual QStringList dependencies() const
virtual vtkMRMLAbstractLogic * createLogic()=0
virtual QStringList categories() const
virtual QStringList contributors() const
Return the contributors of the module.
virtual QStringList associatedNodeTypes() const
Return node types associated with this module (e.g., node types this module can edit)
virtual qSlicerAbstractModuleRepresentation * createWidgetRepresentation()=0
Create and return a widget representation for the module.
virtual void printAdditionalInfo()
virtual void setup()=0
All initialization code should be done in the setup.
qSlicerAbstractModuleRepresentation * widgetRepresentation()
void setPath(const QString &newPath)
void setBuiltIn(bool value)
bool isWidgetRepresentationCreationEnabled() const
virtual QString title() const =0
qSlicerAbstractCoreModule(QObject *parent=nullptr)
Q_INVOKABLE vtkMRMLAbstractLogic * logic()
virtual QString helpText() const
QScopedPointer< qSlicerAbstractCoreModulePrivate > d_ptr
void setAppLogic(vtkSlicerApplicationLogic *appLogic)
virtual void setName(const QString &name)
Superclass for MRML logic classes.
A set of MRML Nodes that supports serialization and undo/redo.