Medical Imaging Interaction Toolkit  2018.4.99-936b789b
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  itkFactorylessNewMacro(CoreObjectFactory);
33 
34  Mapper::Pointer CreateMapper(mitk::DataNode *node, MapperSlotId slotId) override;
35  void SetDefaultProperties(mitk::DataNode *node) override;
36 
37  virtual void MapEvent(const mitk::Event *event, const int eventID);
38 
39  virtual void RegisterExtraFactory(CoreObjectFactoryBase *factory);
40  virtual void UnRegisterExtraFactory(CoreObjectFactoryBase *factory);
41 
42  static Pointer GetInstance();
43 
44  ~CoreObjectFactory() override;
45 
54  DEPRECATED(virtual std::string GetFileExtensions() override);
55 
62  DEPRECATED(virtual MultimapType GetFileExtensionsMap() override);
63 
72  DEPRECATED(virtual std::string GetSaveFileExtensions() override);
73 
80  MultimapType GetSaveFileExtensionsMap() override;
81 
85  DEPRECATED(virtual FileWriterList GetFileWriters());
86 
90  DEPRECATED(std::string GetDescriptionForExtension(const std::string &extension));
91 
92  protected:
94 
105  void MergeFileExtensions(MultimapType &fileExtensionsMap, MultimapType inputMap);
106 
111  void CreateFileExtensionsMap();
112 
116  DEPRECATED(void CreateSaveFileExtensions());
117 
118  typedef std::set<mitk::CoreObjectFactoryBase::Pointer> ExtraFactoriesContainer;
119 
120  ExtraFactoriesContainer m_ExtraFactories;
121  FileWriterList m_FileWriters;
122  std::string m_FileExtensions;
124  std::string m_SaveFileExtensions;
126 
127  private:
128  void RegisterLegacyReaders(mitk::CoreObjectFactoryBase *factory);
129  void RegisterLegacyWriters(mitk::CoreObjectFactoryBase *factory);
130 
131  void UnRegisterLegacyReaders(mitk::CoreObjectFactoryBase *factory);
132  void UnRegisterLegacyWriters(mitk::CoreObjectFactoryBase *factory);
133 
134  std::map<mitk::CoreObjectFactoryBase *, std::list<mitk::LegacyFileReaderService *>> m_LegacyReaders;
135  std::map<mitk::CoreObjectFactoryBase *, std::list<mitk::LegacyFileWriterService *>> m_LegacyWriters;
136  };
137 
138 } // namespace mitk
139 
140 #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:57