Medical Imaging Interaction Toolkit  2018.4.99-389bf124
Medical Imaging Interaction Toolkit
mitkSegmentationModuleActivator.cpp
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 #include <usGetModuleContext.h>
14 #include <usModule.h>
15 #include <usModuleActivator.h>
16 #include <usModuleContext.h>
17 
19 
20 namespace mitk
21 {
25  class SegmentationModuleActivator : public us::ModuleActivator
26  {
27  public:
28  void Load(us::ModuleContext *context) override
29  {
30  /*register ToolManager provider service*/
31  m_ToolManagerProvider = mitk::ToolManagerProvider::New();
32  context->RegisterService<mitk::ToolManagerProvider>(m_ToolManagerProvider);
33  }
34 
35  void Unload(us::ModuleContext *) override {}
36  private:
37  mitk::ToolManagerProvider::Pointer m_ToolManagerProvider;
38  };
39 }
40 
41 US_EXPORT_MODULE_ACTIVATOR(mitk::SegmentationModuleActivator)
DataCollection - Class to facilitate loading/accessing structured data.
virtual void Unload(ModuleContext *context)=0
static Pointer New()
Micro Service Singleton to get an instance of mitk::ToolManager.
#define US_EXPORT_MODULE_ACTIVATOR(_activator_type)
Export a module activator class.
virtual void Load(ModuleContext *context)=0