Slicer  5.1
Slicer is a multi-platform, free and open source software package for visualization and medical image computing
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 
33 class qSlicerScriptedLoadableModuleFactoryPrivate;
34 
35 //----------------------------------------------------------------------------
36 class ctkFactoryScriptedItem : public ctkAbstractFactoryFileBasedItem<qSlicerAbstractCoreModule>
37 {
38 public:
39  bool load() override;
40 protected:
42 };
43 
44 //----------------------------------------------------------------------------
45 class Q_SLICER_BASE_QTGUI_EXPORT qSlicerScriptedLoadableModuleFactory :
46  public ctkAbstractFileBasedFactory<qSlicerAbstractCoreModule>
47 {
48 public:
49 
50  typedef ctkAbstractFileBasedFactory<qSlicerAbstractCoreModule> Superclass;
53 
54  bool registerScript(const QString& key, const QFileInfo& file);
55 
57  void registerItems() override;
58 
59 protected:
60  QScopedPointer<qSlicerScriptedLoadableModuleFactoryPrivate> d_ptr;
61 
62  bool isValidFile(const QFileInfo& file)const override;
63  ctkAbstractFactoryItem<qSlicerAbstractCoreModule>*
64  createFactoryFileBasedItem() override;
65 
66 private:
67  Q_DECLARE_PRIVATE(qSlicerScriptedLoadableModuleFactory);
69 };
70 
71 #endif
qSlicerAbstractCoreModule * instanciator() override
ctkAbstractFileBasedFactory< qSlicerAbstractCoreModule > Superclass
QScopedPointer< qSlicerScriptedLoadableModuleFactoryPrivate > d_ptr
qSlicerAbstractCoreModule is the base class of any module in Slicer.
bool load() override