fw4spl
IVtkRenderWindowInteractorManager.hpp
1 /* ***** BEGIN LICENSE BLOCK *****
2  * FW4SPL - Copyright (C) IRCAD, 2009-2015.
3  * Distributed under the terms of the GNU Lesser General Public License (LGPL) as
4  * published by the Free Software Foundation.
5  * ****** END LICENSE BLOCK ****** */
6 
7 #ifndef __FWRENDERVTK_IVTKRENDERWINDOWINTERACTORMANAGER_HPP__
8 #define __FWRENDERVTK_IVTKRENDERWINDOWINTERACTORMANAGER_HPP__
9 
10 #include <string>
11 #include <fwServices/IService.hpp>
12 
13 #include <vtkRenderWindowInteractor.h>
14 
15 #include <fwCore/base.hpp>
16 
17 #include <fwGui/container/fwContainer.hpp>
18 
19 #include "fwRenderVTK/factory/new.hpp"
20 #include "fwRenderVTK/registry/detail.hpp"
21 #include "fwRenderVTK/config.hpp"
22 
23 namespace fwRenderVTK
24 {
25 
30 class FWRENDERVTK_CLASS_API IVtkRenderWindowInteractorManager : public ::fwCore::BaseObject
31 {
32 
33 public:
34 
35  typedef ::fwRenderVTK::factory::Key Key;
36 
43  template <typename T>
44  class Registrar
45  {
46  public:
47  Registrar(std::string functorKey)
48  {
49  ::fwRenderVTK::registry::get()->addFactory(functorKey, &::fwRenderVTK::factory::New<T>);
50  }
51  };
52 
53 
55 
56  typedef std::string FactoryRegistryKeyType;
57 
58  FWRENDERVTK_API static const FactoryRegistryKeyType REGISTRY_KEY;
59 
60  FWRENDERVTK_API static IVtkRenderWindowInteractorManager::sptr createManager();
61 
63  FWRENDERVTK_API IVtkRenderWindowInteractorManager();
64 
66  FWRENDERVTK_API virtual ~IVtkRenderWindowInteractorManager();
67 
69  FWRENDERVTK_API virtual void installInteractor( ::fwGui::container::fwContainer::sptr _parent ) = 0;
70 
72  FWRENDERVTK_API virtual void uninstallInteractor() = 0;
73 
75  FWRENDERVTK_API virtual ::vtkRenderWindowInteractor * getInteractor() = 0;
76 
77  virtual void setRenderService(::fwServices::IService::sptr srv)
78  {
79  m_renderService = srv;
80  }
81 
82 
83 protected:
84  ::fwServices::IService::wptr m_renderService;
85 };
86 
87 } // namespace fwRenderVTK
88 
89 #endif // __FWRENDERVTK_IVTKRENDERWINDOWINTERACTORMANAGER_HPP__
90 
91 
#define fwCoreNonInstanciableClassDefinitionsMacro(_classinfo_)
Generate common code for Non Instanciable classes (Interfaces, Abstract classes, ...)
Base class for all FW4SPL&#39;s classes.
Definition: BaseObject.hpp:22
The namespace fwGui contains the base interface for IHM services.
Definition: SJobBar.hpp:23
Class used to register a class factory in factory registry. This class defines also the object factor...
STL namespace.
Namespace fwServices is dedicated to (mimic) the dynamic affectation of methods to (pure data) object...
Defines a class to manage vtkRenderWindowInteractor in a window.
Key class used to restrict access to Object construction. See http://www.drdobbs.com/184402053.
The namespace fwRenderVTK contains classes for rendering with VTK.