Slicer 4.2
Slicer is a multi-platform, free and open source software package for visualization and medical image computing
qSlicerCLIExecutableModuleFactory.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 __qSlicerCLIExecutableModuleFactory_h
00022 #define __qSlicerCLIExecutableModuleFactory_h
00023 
00024 // SlicerQT includes
00025 #include "qSlicerAbstractCoreModule.h"
00026 #include "qSlicerBaseQTCLIExport.h"
00027 
00028 // CTK includes
00029 #include <ctkPimpl.h>
00030 #include <ctkAbstractPluginFactory.h>
00031 
00032 //-----------------------------------------------------------------------------
00033 class qSlicerCLIExecutableModuleFactoryItem
00034   : public ctkAbstractFactoryFileBasedItem<qSlicerAbstractCoreModule>
00035 {
00036 public:
00037   qSlicerCLIExecutableModuleFactoryItem(const QString& newTempDirectory);
00038   virtual bool load();
00039 protected:
00040   virtual qSlicerAbstractCoreModule* instanciator();
00041 private:
00042   QString TempDirectory;
00043 };
00044 
00045 //-----------------------------------------------------------------------------
00046 class Q_SLICER_BASE_QTCLI_EXPORT qSlicerCLIExecutableModuleFactory :
00047   public ctkAbstractFileBasedFactory<qSlicerAbstractCoreModule>
00048 {
00049 public:
00050   typedef ctkAbstractFileBasedFactory<qSlicerAbstractCoreModule> Superclass;
00051   qSlicerCLIExecutableModuleFactory();
00052   qSlicerCLIExecutableModuleFactory(const QString& tempDir);
00053 
00054   virtual void registerItems();
00055 
00060   virtual QString fileNameToKey(const QString& fileName)const;
00061 
00062   void setTempDirectory(const QString& newTempDirectory);
00063 
00064 protected:
00065   virtual bool isValidFile(const QFileInfo& file)const;
00066 
00067   virtual ctkAbstractFactoryItem<qSlicerAbstractCoreModule>*
00068     createFactoryFileBasedItem();
00069 
00070 private:
00071   QString TempDirectory;
00072 };
00073 
00074 #endif
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Defines