Slicer 5.9
Slicer is a multi-platform, free and open source software package for visualization and medical image computing
Loading...
Searching...
No Matches
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#define qSlicerGetTitleMacro(_TITLE) \
41 static QString staticTitle() \
42 { \
43 return _TITLE; \
44 } \
45 QString title() const override \
46 { \
47 return _TITLE; \
48 }
49
51//
60class Q_SLICER_BASE_QTCORE_EXPORT qSlicerAbstractCoreModule : public QObject
61{
64 Q_OBJECT
65
68
78 Q_PROPERTY(QString name READ name)
79
80
86 Q_PROPERTY(QString title READ title)
87
97 Q_PROPERTY(QStringList categories READ categories)
98
106 Q_PROPERTY(int index READ index)
107
113 Q_PROPERTY(bool hidden READ isHidden)
114
121
126 Q_PROPERTY(QString helpText READ helpText)
127
136
144 Q_PROPERTY(QStringList contributors READ contributors)
145
150 Q_PROPERTY(QString slicerWikiUrl READ slicerWikiUrl)
151
156
163 Q_PROPERTY(QStringList dependencies READ dependencies)
164
171 Q_PROPERTY(QString path READ path)
172
177 Q_PROPERTY(bool isInstalled READ isInstalled)
178
183 Q_PROPERTY(bool isBuiltIn READ isBuiltIn)
184
192 Q_PROPERTY(QStringList associatedNodeTypes READ associatedNodeTypes)
193
194public:
195 typedef QObject Superclass;
201 qSlicerAbstractCoreModule(QObject* parent = nullptr);
203
204 virtual void printAdditionalInfo();
205
207 QString slicerWikiUrl() const { return "https://www.slicer.org/w/index.php"; }
208
214
218
222 virtual QString name() const;
223 virtual void setName(const QString& name);
224
227 virtual QString title() const = 0;
228
234 virtual QStringList categories() const;
235
237 virtual int index() const;
238
243 virtual bool isHidden() const;
244
246 virtual QStringList contributors() const;
247
250 virtual QString helpText() const;
251
254 virtual QString acknowledgementText() const;
255
261
267
274
279
281 vtkMRMLAbstractLogic* moduleLogic(const QString& moduleName) const;
282
288
290 Q_INVOKABLE vtkMRMLScene* mrmlScene() const;
291
292 virtual QStringList dependencies() const;
293
296 QString path() const;
297 void setPath(const QString& newPath);
298
301 bool isInstalled() const;
302 void setInstalled(bool value);
303
306 bool isBuiltIn() const;
307 void setBuiltIn(bool value);
308
310 virtual QStringList associatedNodeTypes() const;
311
312public slots:
313
317
318protected:
320 virtual void setup() = 0;
321
324
328
329protected:
330 QScopedPointer<qSlicerAbstractCoreModulePrivate> d_ptr;
331
332private:
333 Q_DECLARE_PRIVATE(qSlicerAbstractCoreModule);
334 Q_DISABLE_COPY(qSlicerAbstractCoreModule);
336
339 void representationDeleted(qSlicerAbstractModuleRepresentation* representation);
340};
341
342#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.