Slicer 4.2
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.
00001 /*==============================================================================
00002 
00003   Program: 3D Slicer
00004 
00005   Copyright (c) Kitware Inc.
00006 
00007   See COPYRIGHT.txt
00008   or http://www.slicer.org/copyright/copyright.txt for details.
00009 
00010   Unless required by applicable law or agreed to in writing, software
00011   distributed under the License is distributed on an "AS IS" BASIS,
00012   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
00013   See the License for the specific language governing permissions and
00014   limitations under the License.
00015 
00016   This file was originally developed by Jean-Christophe Fillion-Robin, Kitware Inc.
00017   and was partially funded by NIH grant 3P41RR013218-12S1
00018 
00019 ==============================================================================*/
00020 
00021 #ifndef __qSlicerScriptedLoadableModuleFactory_h
00022 #define __qSlicerScriptedLoadableModuleFactory_h
00023 
00024 // CTK includes
00025 #include <ctkPimpl.h>
00026 #include <ctkAbstractFileBasedFactory.h>
00027 
00028 // SlicerQt includes
00029 #include "qSlicerAbstractCoreModule.h"
00030 
00031 #include "qSlicerBaseQTGUIExport.h"
00032 
00033 class qSlicerScriptedLoadableModuleFactoryPrivate;
00034 
00035 //----------------------------------------------------------------------------
00036 class ctkFactoryScriptedItem : public ctkAbstractFactoryFileBasedItem<qSlicerAbstractCoreModule>
00037 {
00038 public:
00039   virtual bool load();
00040 protected:
00041   virtual qSlicerAbstractCoreModule* instanciator();
00042 };
00043 
00044 //----------------------------------------------------------------------------
00045 class Q_SLICER_BASE_QTGUI_EXPORT qSlicerScriptedLoadableModuleFactory :
00046   public ctkAbstractFileBasedFactory<qSlicerAbstractCoreModule>
00047 {
00048 public:
00049 
00050   typedef ctkAbstractFileBasedFactory<qSlicerAbstractCoreModule> Superclass;
00051   qSlicerScriptedLoadableModuleFactory();
00052   virtual ~qSlicerScriptedLoadableModuleFactory();
00053 
00054   bool registerScript(const QString& key, const QFileInfo& file);
00055 
00057   virtual void registerItems();
00058 
00059 protected:
00060   QScopedPointer<qSlicerScriptedLoadableModuleFactoryPrivate> d_ptr;
00061 
00062   virtual bool isValidFile(const QFileInfo& file)const;
00063   virtual ctkAbstractFactoryItem<qSlicerAbstractCoreModule>*
00064     createFactoryFileBasedItem();
00065 
00066 private:
00067   Q_DECLARE_PRIVATE(qSlicerScriptedLoadableModuleFactory);
00068   Q_DISABLE_COPY(qSlicerScriptedLoadableModuleFactory);
00069 };
00070 
00071 #endif
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Defines