00001 /*========================================================================= 00002 00003 Program: Medical Imaging & Interaction Toolkit 00004 Language: C++ 00005 Date: $Date$ 00006 Version: $Revision$ 00007 00008 Copyright (c) German Cancer Research Center, Division of Medical and 00009 Biological Informatics. All rights reserved. 00010 See MITKCopyright.txt or https://www.mitk.org/copyright.html for details. 00011 00012 This software is distributed WITHOUT ANY WARRANTY; without even 00013 the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR 00014 PURPOSE. See the above copyright notices for more information. 00015 00016 =========================================================================*/ 00017 00018 #ifndef COREOBJECTFACTORYBASE_H_INCLUDED 00019 #define COREOBJECTFACTORYBASE_H_INCLUDED 00020 00021 // the mbilog header is necessary for CMake test drivers. 00022 // Since the EXTRA_INCLUDE parameter of CREATE_TEST_SOURCELIST only 00023 // allows one extra include file, we specify mitkLog.h here so it will 00024 // be available to all classes implementing this interface. 00025 #include "mitkLog.h" 00026 00027 #include "mitkCommon.h" 00028 #include "mitkMapper.h" 00029 #include <itkObjectFactoryBase.h> 00030 #include <itkVersion.h> 00031 #include "mitkFileWriterWithInformation.h" 00032 00033 namespace mitk { 00034 00035 class DataNode; 00036 00037 //## @brief base-class for factories of certain mitk objects. 00038 //## @ingroup Algorithms 00039 //## This interface can be implemented by factories which add new mapper classes or extend the 00040 //## data tree deserialization mechanism. 00041 00042 class MITK_CORE_EXPORT CoreObjectFactoryBase : public itk::Object 00043 { 00044 public: 00045 typedef std::list<mitk::FileWriterWithInformation::Pointer> FileWriterList; 00046 typedef std::multimap<std::string, std::string> MultimapType; 00047 mitkClassMacro(CoreObjectFactoryBase,itk::Object); 00048 virtual Mapper::Pointer CreateMapper(mitk::DataNode* node, MapperSlotId slotId) = 0; 00049 virtual void SetDefaultProperties(mitk::DataNode* node) = 0; 00050 virtual const char* GetFileExtensions() = 0; 00051 virtual MultimapType GetFileExtensionsMap() = 0; 00052 virtual const char* GetSaveFileExtensions() = 0; 00053 virtual MultimapType GetSaveFileExtensionsMap() = 0; 00054 virtual const char* GetITKSourceVersion() const 00055 { 00056 return ITK_SOURCE_VERSION; 00057 } 00058 virtual const char* GetDescription() const 00059 { 00060 return "Core Object Factory"; 00061 } 00062 FileWriterList GetFileWriters() { 00063 return m_FileWriters; 00064 } 00065 00066 protected: 00067 00074 static void CreateFileExtensions(MultimapType fileExtensionsMap, std::string& fileExtensions); 00075 00076 FileWriterList m_FileWriters; 00077 }; 00078 } 00079 #endif