fw4spl
STransformFromWheel.hpp
1 /* ***** BEGIN LICENSE BLOCK *****
2  * FW4SPL - Copyright (C) IRCAD, 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_STRANSFORMFROMWHEEL_HPP__
8 #define __VISUVTKADAPTOR_STRANSFORMFROMWHEEL_HPP__
9 
10 #include "visuVTKAdaptor/config.hpp"
11 
12 #include <fwDataTools/helper/MedicalImageAdaptor.hpp>
13 #include <fwDataTools/PickingInfo.hpp>
14 
15 #include <fwRenderVTK/IAdaptor.hpp>
16 
17 #include <glm/mat4x4.hpp>
18 
19 namespace visuVTKAdaptor
20 {
21 
54 class VISUVTKADAPTOR_CLASS_API STransformFromWheel : public ::fwRenderVTK::IAdaptor
55 {
56 public:
57 
59 
61  VISUVTKADAPTOR_API STransformFromWheel();
62 
64  VISUVTKADAPTOR_API virtual ~STransformFromWheel();
65 
66 protected:
67 
68  VISUVTKADAPTOR_API virtual void configuring() override;
69  VISUVTKADAPTOR_API virtual void starting() override;
70  VISUVTKADAPTOR_API virtual void updating() override;
71  VISUVTKADAPTOR_API virtual void stopping() override;
72 
73 private:
74 
76  void rotateTransform(double cx, double cy, double wheelAngle);
77 
79  void translateTransform(::fwDataTools::PickingInfo info);
80 
82  void applyTransformToOutput(const ::glm::dmat4& transform) const;
83 
85  void updateSliceOrientation(int from, int to);
86 
89 
91  unsigned char m_interactionMode;
92 
94  double m_initAngle;
95 
97  double m_lastPickedPos[3];
98 
100  bool m_translate;
101 };
102 
103 } // namespace visuVTKAdaptor
104 
105 #endif // __VISUVTKADAPTOR_STRANSFORMFROMWHEEL_HPP__
The namespace visuVTKAdaptor contains the list of adaptors available for the generic scene...
Structure to store picking information.
Definition: PickingInfo.hpp:20
#define fwCoreServiceClassDefinitionsMacro(_classinfo_)
Generate common code for services classes.