Medical Imaging Interaction Toolkit  2016.11.0
Medical Imaging Interaction Toolkit
All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Modules Pages
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,
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 COREOBJECTFACTORYBASE_H_INCLUDED
18 #define COREOBJECTFACTORYBASE_H_INCLUDED
19 
20 // the mbilog header is necessary for CMake test drivers.
21 // Since the EXTRA_INCLUDE parameter of CREATE_TEST_SOURCELIST only
22 // allows one extra include file, we specify mitkLog.h here so it will
23 // be available to all classes implementing this interface.
24 #include "mitkLog.h"
25 
27 #include "mitkMapper.h"
28 #include <MitkCoreExports.h>
29 #include <itkObjectFactoryBase.h>
30 #include <itkVersion.h>
31 
32 namespace mitk
33 {
34  class DataNode;
35 
36  //## @brief base-class for factories of certain mitk objects.
37  //## @ingroup Algorithms
38  //## This interface can be implemented by factories which add new mapper classes or extend the
39  //## data tree deserialization mechanism.
40 
41  class MITKCORE_EXPORT CoreObjectFactoryBase : public itk::Object
42  {
43  public:
44  typedef std::list<mitk::FileWriterWithInformation::Pointer> FileWriterList;
45  typedef std::multimap<std::string, std::string> MultimapType;
46 
48 
49  virtual Mapper::Pointer CreateMapper(mitk::DataNode *node, MapperSlotId slotId) = 0;
50  virtual void SetDefaultProperties(mitk::DataNode *node) = 0;
51 
55  virtual const char *GetFileExtensions() = 0;
56 
60  virtual MultimapType GetFileExtensionsMap() = 0;
61 
65  virtual const char *GetSaveFileExtensions() = 0;
66 
70  virtual MultimapType GetSaveFileExtensionsMap() = 0;
71 
72  virtual const char *GetITKSourceVersion() const { return ITK_SOURCE_VERSION; }
73  virtual const char *GetDescription() const { return "Core Object Factory"; }
77  FileWriterList GetFileWriters() { return m_FileWriters; }
78  protected:
88  static void CreateFileExtensions(MultimapType fileExtensionsMap, std::string &fileExtensions);
89 
90  FileWriterList m_FileWriters;
91 
92  friend class CoreObjectFactory;
93  };
94 }
95 #endif
#define MITKCORE_EXPORT
DataCollection - Class to facilitate loading/accessing structured data.
Base class of all mappers, Vtk as well as OpenGL mappers.
Definition: mitkMapper.h:54
#define mitkClassMacroItkParent(className, SuperClassName)
Definition: mitkCommon.h:53
virtual const char * GetDescription() const
unsigned int MapperSlotId
Definition: mitkCommon.h:37
std::multimap< std::string, std::string > MultimapType
std::list< mitk::FileWriterWithInformation::Pointer > FileWriterList
Class for nodes of the DataTree.
Definition: mitkDataNode.h:66