fw4spl
SSliceFollowerCamera.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_SSLICEFOLLOWERCAMERA_HPP__
8 #define __VISUVTKADAPTOR_SSLICEFOLLOWERCAMERA_HPP__
9 
10 #include "visuVTKAdaptor/config.hpp"
11 
12 #include <fwDataTools/helper/MedicalImageAdaptor.hpp>
13 
14 #include <fwRenderVTK/IAdaptor.hpp>
15 
16 class vtkCamera;
17 
18 namespace visuVTKAdaptor
19 {
20 
44 class VISUVTKADAPTOR_CLASS_API SSliceFollowerCamera : public ::fwDataTools::helper::MedicalImageAdaptor,
46 {
47 public:
49 
50  VISUVTKADAPTOR_API SSliceFollowerCamera() noexcept;
51 
52  VISUVTKADAPTOR_API virtual ~SSliceFollowerCamera() noexcept;
53 
54 protected:
55 
56  VISUVTKADAPTOR_API void configuring() override;
57  VISUVTKADAPTOR_API void starting() override;
58  VISUVTKADAPTOR_API void updating() override;
59  VISUVTKADAPTOR_API void stopping() override;
60 
70  VISUVTKADAPTOR_API virtual KeyConnectionsMap getAutoConnections() const override;
71 
72  void initializeCamera();
73  void updateCamera(double distance = -1., double size = -1);
74 
75  vtkCamera* m_camera;
76 
77 private:
82  void updateSliceIndex(int axial, int frontal, int sagittal);
84 
86  void updateSliceType(int from, int to);
90 };
91 
92 } //namespace visuVTKAdaptor
93 
94 #endif // __VISUVTKADAPTOR_SSLICEFOLLOWERCAMERA_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...
Update the camera according to slice move.
#define fwCoreServiceClassDefinitionsMacro(_classinfo_)
Generate common code for services classes.