fw4spl
STransform.hpp
1 /* ***** BEGIN LICENSE BLOCK *****
2  * FW4SPL - Copyright (C) IRCAD, 2009-2017.
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 __VISUVTKADAPTOR_STRANSFORM_HPP__
8 #define __VISUVTKADAPTOR_STRANSFORM_HPP__
9 
10 #include "visuVTKAdaptor/config.hpp"
11 
12 #include <fwRenderVTK/IAdaptor.hpp>
13 
14 #include <vtkSmartPointer.h>
15 
16 #include <vector>
17 
18 class vtkTransform;
19 class vtkCommand;
20 
21 namespace visuVTKAdaptor
22 {
23 
44 class VISUVTKADAPTOR_CLASS_API STransform : public ::fwRenderVTK::IAdaptor
45 {
46 
47 public:
48 
50 
51  static const ::fwServices::IService::KeyType s_TM3D_INOUT;
52 
54  VISUVTKADAPTOR_API STransform() noexcept;
55 
57  VISUVTKADAPTOR_API virtual ~STransform() noexcept;
58 
60  VISUVTKADAPTOR_API void setTransform(vtkTransform* t);
61 
63  VISUVTKADAPTOR_API vtkTransform* getTransform();
64 
66  VISUVTKADAPTOR_API void updateFromVtk();
67 
68 protected:
69 
70  VISUVTKADAPTOR_API void configuring() override;
71 
73  VISUVTKADAPTOR_API void starting() override;
74 
76  VISUVTKADAPTOR_API void updating() override;
77 
79  VISUVTKADAPTOR_API void stopping() override;
80 
82  VISUVTKADAPTOR_API void swapping() override;
83 
90  VISUVTKADAPTOR_API virtual KeyConnectionsMap getAutoConnections() const override;
91 
93  vtkTransform* m_transform;
94 
96  vtkCommand* m_transformCommand;
97 
99  std::string m_parentId;
100 
102  vtkSmartPointer<vtkTransform> m_parentTransform;
103 };
104 
105 } //namespace visuVTKAdaptor
106 
107 #endif // __VISUVTKADAPTOR_STRANSFORM_HPP__
This class is a helper to define the connections of a service and its data.
Definition: IService.hpp:454
The namespace visuVTKAdaptor contains the list of adaptors available for the generic scene...
STL namespace.
Adaptor binding a TransformationMatrix3D to a vtkTransform.
Definition: STransform.hpp:44
#define fwCoreServiceClassDefinitionsMacro(_classinfo_)
Generate common code for services classes.