Medical Imaging Interaction Toolkit  2016.11.0
Medical Imaging Interaction Toolkit
mitkVtkShadersActivator.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,
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 #include <memory>
19 #include <usModule.h>
20 #include <usModuleActivator.h>
21 #include <usModuleContext.h>
22 #include <usModuleEvent.h>
23 #include <usModuleResource.h>
24 #include <usModuleResourceStream.h>
25 
26 namespace mitk
27 {
28  class VtkShadersActivator : public us::ModuleActivator
29  {
30  public:
31  VtkShadersActivator() {}
32  ~VtkShadersActivator() {}
33  void Load(us::ModuleContext *context) override
34  {
35  m_VtkShaderRepository.reset(new VtkShaderRepository);
36  context->RegisterService<IShaderRepository>(m_VtkShaderRepository.get());
37  }
38 
39  void Unload(us::ModuleContext *) override { m_VtkShaderRepository.reset(NULL); }
40  private:
41  VtkShadersActivator(const VtkShadersActivator &);
42  VtkShadersActivator &operator=(const VtkShadersActivator &);
43 
44  std::unique_ptr<VtkShaderRepository> m_VtkShaderRepository;
45  };
46 }
47 
48 US_EXPORT_MODULE_ACTIVATOR(mitk::VtkShadersActivator)
DataCollection - Class to facilitate loading/accessing structured data.
virtual void Unload(ModuleContext *context)=0
virtual void Load(ModuleContext *context)=0
US_EXPORT_MODULE_ACTIVATOR(mitk::SimulationActivator)