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
qSlicerScriptedLoadableModuleFactory.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 __qSlicerScriptedLoadableModuleFactory_h
22#define __qSlicerScriptedLoadableModuleFactory_h
23
24// CTK includes
25#include <ctkPimpl.h>
26#include <ctkAbstractFileBasedFactory.h>
27
28// Slicer includes
30
31#include "qSlicerBaseQTGUIExport.h"
32
33class qSlicerScriptedLoadableModuleFactoryPrivate;
34
35//----------------------------------------------------------------------------
36class ctkFactoryScriptedItem : public ctkAbstractFactoryFileBasedItem<qSlicerAbstractCoreModule>
37{
38public:
39 bool load() override;
40protected:
42};
43
44//----------------------------------------------------------------------------
45class Q_SLICER_BASE_QTGUI_EXPORT qSlicerScriptedLoadableModuleFactory :
46 public ctkAbstractFileBasedFactory<qSlicerAbstractCoreModule>
47{
48public:
49
50 typedef ctkAbstractFileBasedFactory<qSlicerAbstractCoreModule> Superclass;
53
54 bool registerScript(const QString& key, const QFileInfo& file);
55
57 void registerItems() override;
58
59protected:
60 QScopedPointer<qSlicerScriptedLoadableModuleFactoryPrivate> d_ptr;
61
62 bool isValidFile(const QFileInfo& file)const override;
63 ctkAbstractFactoryItem<qSlicerAbstractCoreModule>*
65
66private:
67 Q_DECLARE_PRIVATE(qSlicerScriptedLoadableModuleFactory);
69};
70
71#endif
bool load() override
qSlicerAbstractCoreModule * instanciator() override
qSlicerAbstractCoreModule is the base class of any module in Slicer.
bool registerScript(const QString &key, const QFileInfo &file)
bool isValidFile(const QFileInfo &file) const override
ctkAbstractFactoryItem< qSlicerAbstractCoreModule > * createFactoryFileBasedItem() override
QScopedPointer< qSlicerScriptedLoadableModuleFactoryPrivate > d_ptr
ctkAbstractFileBasedFactory< qSlicerAbstractCoreModule > Superclass