Medical Imaging Interaction Toolkit  2018.4.99-bb4bf944
Medical Imaging Interaction Toolkit
mitkCoreObjectFactoryBase.h
Go to the documentation of this file.
1 /*============================================================================
2 
3 The Medical Imaging Interaction Toolkit (MITK)
4 
5 Copyright (c) German Cancer Research Center (DKFZ)
6 All rights reserved.
7 
8 Use of this source code is governed by a 3-clause BSD license that can be
9 found in the LICENSE file.
10 
11 ============================================================================*/
12 
13 #ifndef COREOBJECTFACTORYBASE_H_INCLUDED
14 #define COREOBJECTFACTORYBASE_H_INCLUDED
15 
16 // the mbilog header is necessary for CMake test drivers.
17 // Since the EXTRA_INCLUDE parameter of CREATE_TEST_SOURCELIST only
18 // allows one extra include file, we specify mitkLog.h here so it will
19 // be available to all classes implementing this interface.
20 #include "mitkLog.h"
21 
23 #include "mitkMapper.h"
24 #include <MitkCoreExports.h>
25 #include <itkObjectFactoryBase.h>
26 #include <itkVersion.h>
27 
28 namespace mitk
29 {
30  class DataNode;
31 
32  //## @brief base-class for factories of certain mitk objects.
33  //## @ingroup Algorithms
34  //## This interface can be implemented by factories which add new mapper classes or extend the
35  //## data tree deserialization mechanism.
36 
37  class MITKCORE_EXPORT CoreObjectFactoryBase : public itk::Object
38  {
39  public:
40  typedef std::list<mitk::FileWriterWithInformation::Pointer> FileWriterList;
41  typedef std::multimap<std::string, std::string> MultimapType;
42 
44 
45  virtual Mapper::Pointer CreateMapper(mitk::DataNode *node, MapperSlotId slotId) = 0;
46  virtual void SetDefaultProperties(mitk::DataNode *node) = 0;
47 
51  virtual std::string GetFileExtensions() = 0;
52 
56  virtual MultimapType GetFileExtensionsMap() = 0;
57 
61  virtual std::string GetSaveFileExtensions() = 0;
62 
66  virtual MultimapType GetSaveFileExtensionsMap() = 0;
67 
68  virtual const char *GetITKSourceVersion() const { return ITK_SOURCE_VERSION; }
69  virtual const char *GetDescription() const { return "Core Object Factory"; }
73  FileWriterList GetFileWriters() { return m_FileWriters; }
74  protected:
84  static void CreateFileExtensions(MultimapType fileExtensionsMap, std::string &fileExtensions);
85 
86  FileWriterList m_FileWriters;
87 
88  friend class CoreObjectFactory;
89  };
90 }
91 #endif
#define MITKCORE_EXPORT
virtual const char * GetITKSourceVersion() const
virtual const char * GetDescription() const
DataCollection - Class to facilitate loading/accessing structured data.
#define mitkClassMacroItkParent(className, SuperClassName)
Definition: mitkCommon.h:49
unsigned int MapperSlotId
Definition: mitkCommon.h:33
std::multimap< std::string, std::string > MultimapType
std::list< mitk::FileWriterWithInformation::Pointer > FileWriterList
Class for nodes of the DataTree.
Definition: mitkDataNode.h:57