Medical Imaging Interaction Toolkit  2016.11.0
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,
6 Division of Medical and Biological Informatics.
7 All rights reserved.
8 
9 This software is distributed WITHOUT ANY WARRANTY; without
10 even the implied warranty of MERCHANTABILITY or FITNESS FOR
11 A PARTICULAR PURPOSE.
12 
13 See LICENSE.txt or http://www.mitk.org for details.
14 
15 ===================================================================*/
16 
17 #ifndef COREOBJECTFACTORY_H_INCLUDED
18 #define COREOBJECTFACTORY_H_INCLUDED
19 
20 #include <set>
21 
24 #include <MitkCoreExports.h>
25 namespace mitk
26 {
27  class Event;
28  class LegacyFileReaderService;
29  class LegacyFileWriterService;
30  class LegacyImageWriterService;
31 
33  {
34  public:
36 
37  virtual Mapper::Pointer CreateMapper(mitk::DataNode *node, MapperSlotId slotId) override;
38  virtual void SetDefaultProperties(mitk::DataNode *node) override;
39 
40  virtual void MapEvent(const mitk::Event *event, const int eventID);
41 
42  virtual void RegisterExtraFactory(CoreObjectFactoryBase *factory);
43  virtual void UnRegisterExtraFactory(CoreObjectFactoryBase *factory);
44 
45  static Pointer GetInstance();
46 
48 
57  DEPRECATED(virtual const char *GetFileExtensions() override);
58 
65  DEPRECATED(virtual MultimapType GetFileExtensionsMap() override);
66 
75  DEPRECATED(virtual const char *GetSaveFileExtensions() override);
76 
83  virtual MultimapType GetSaveFileExtensionsMap() override;
84 
88  DEPRECATED(virtual FileWriterList GetFileWriters());
89 
93  DEPRECATED(std::string GetDescriptionForExtension(const std::string &extension));
94 
95  protected:
97 
108  void MergeFileExtensions(MultimapType &fileExtensionsMap, MultimapType inputMap);
109 
114  void CreateFileExtensionsMap();
115 
119  DEPRECATED(void CreateSaveFileExtensions());
120 
122 
123  ExtraFactoriesContainer m_ExtraFactories;
124  FileWriterList m_FileWriters;
125  std::string m_FileExtensions;
126  MultimapType m_FileExtensionsMap;
127  std::string m_SaveFileExtensions;
128  MultimapType m_SaveFileExtensionsMap;
129 
130  private:
131  void RegisterLegacyReaders(mitk::CoreObjectFactoryBase *factory);
132  void RegisterLegacyWriters(mitk::CoreObjectFactoryBase *factory);
133 
134  void UnRegisterLegacyReaders(mitk::CoreObjectFactoryBase *factory);
135  void UnRegisterLegacyWriters(mitk::CoreObjectFactoryBase *factory);
136 
137  std::map<mitk::CoreObjectFactoryBase *, std::list<mitk::LegacyFileReaderService *>> m_LegacyReaders;
138  std::map<mitk::CoreObjectFactoryBase *, std::list<mitk::LegacyFileWriterService *>> m_LegacyWriters;
139  };
140 
141 } // namespace mitk
142 
143 #endif
#define MITKCORE_EXPORT
STL namespace.
DataCollection - Class to facilitate loading/accessing structured data.
Base class of all mappers, Vtk as well as OpenGL mappers.
Definition: mitkMapper.h:54
#define DEPRECATED(func)
Definition: mitkCommon.h:183
#define mitkClassMacro(className, SuperClassName)
Definition: mitkCommon.h:44
std::set< mitk::CoreObjectFactoryBase::Pointer > ExtraFactoriesContainer
unsigned int MapperSlotId
Definition: mitkCommon.h:37
std::multimap< std::string, std::string > MultimapType
Class for nodes of the DataTree.
Definition: mitkDataNode.h:66