Medical Imaging Interaction Toolkit  2018.4.99-12ad79a3
Medical Imaging Interaction Toolkit
mitkCoreObjectFactory.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 COREOBJECTFACTORY_H_INCLUDED
14 #define COREOBJECTFACTORY_H_INCLUDED
15 
16 #include <set>
17 
20 #include <MitkCoreExports.h>
21 namespace mitk
22 {
23  class Event;
24  class LegacyFileReaderService;
25  class LegacyFileWriterService;
26  class LegacyImageWriterService;
27 
29  {
30  public:
32 
33  Mapper::Pointer CreateMapper(mitk::DataNode *node, MapperSlotId slotId) override;
34  void SetDefaultProperties(mitk::DataNode *node) override;
35 
36  virtual void MapEvent(const mitk::Event *event, const int eventID);
37 
38  virtual void RegisterExtraFactory(CoreObjectFactoryBase *factory);
39  virtual void UnRegisterExtraFactory(CoreObjectFactoryBase *factory);
40 
41  static Pointer GetInstance();
42 
43  ~CoreObjectFactory() override;
44 
53  DEPRECATED(virtual const char *GetFileExtensions() override);
54 
61  DEPRECATED(virtual MultimapType GetFileExtensionsMap() override);
62 
71  DEPRECATED(virtual const char *GetSaveFileExtensions() override);
72 
79  MultimapType GetSaveFileExtensionsMap() override;
80 
84  DEPRECATED(virtual FileWriterList GetFileWriters());
85 
89  DEPRECATED(std::string GetDescriptionForExtension(const std::string &extension));
90 
91  protected:
93 
104  void MergeFileExtensions(MultimapType &fileExtensionsMap, MultimapType inputMap);
105 
110  void CreateFileExtensionsMap();
111 
115  DEPRECATED(void CreateSaveFileExtensions());
116 
117  typedef std::set<mitk::CoreObjectFactoryBase::Pointer> ExtraFactoriesContainer;
118 
119  ExtraFactoriesContainer m_ExtraFactories;
120  FileWriterList m_FileWriters;
121  std::string m_FileExtensions;
123  std::string m_SaveFileExtensions;
125 
126  private:
127  void RegisterLegacyReaders(mitk::CoreObjectFactoryBase *factory);
128  void RegisterLegacyWriters(mitk::CoreObjectFactoryBase *factory);
129 
130  void UnRegisterLegacyReaders(mitk::CoreObjectFactoryBase *factory);
131  void UnRegisterLegacyWriters(mitk::CoreObjectFactoryBase *factory);
132 
133  std::map<mitk::CoreObjectFactoryBase *, std::list<mitk::LegacyFileReaderService *>> m_LegacyReaders;
134  std::map<mitk::CoreObjectFactoryBase *, std::list<mitk::LegacyFileWriterService *>> m_LegacyWriters;
135  };
136 
137 } // namespace mitk
138 
139 #endif
ExtraFactoriesContainer m_ExtraFactories
#define MITKCORE_EXPORT
DataCollection - Class to facilitate loading/accessing structured data.
#define DEPRECATED(func)
Definition: mitkCommon.h:179
#define mitkClassMacro(className, SuperClassName)
Definition: mitkCommon.h:40
std::set< mitk::CoreObjectFactoryBase::Pointer > ExtraFactoriesContainer
unsigned int MapperSlotId
Definition: mitkCommon.h:33
std::multimap< std::string, std::string > MultimapType
Class for nodes of the DataTree.
Definition: mitkDataNode.h:64