fw4spl
SDistance.hpp
1 /* ***** BEGIN LICENSE BLOCK *****
2  * FW4SPL - Copyright (C) IRCAD, 2009-2018.
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 #pragma once
8 
9 #ifndef ANDROID
10 
11 #include "visuVTKAdaptor/config.hpp"
12 
13 #include <fwData/Color.hpp>
14 #include <fwData/Point.hpp>
15 
16 #include <fwRenderVTK/IAdaptor.hpp>
17 
18 #include <vector>
19 
20 class vtkDistanceRepresentation2D;
21 class vtkActor;
22 class vtkLineSource;
23 
24 namespace visuVTKAdaptor
25 {
26 
44 class VISUVTKADAPTOR_CLASS_API SDistance : public ::fwRenderVTK::IAdaptor
45 {
46 
47 public:
48 
50 
51  VISUVTKADAPTOR_API SDistance() noexcept;
52 
53  VISUVTKADAPTOR_API virtual ~SDistance() noexcept;
54 
55  static const ::fwServices::IService::KeyType s_POINTLIST_INPUT;
56 
58  VISUVTKADAPTOR_API void setAxisColor( ::fwData::Color::sptr newColor) noexcept;
59 
60 protected:
61 
62  VISUVTKADAPTOR_API void configuring() override;
63  VISUVTKADAPTOR_API void starting() override;
64  VISUVTKADAPTOR_API void updating() override;
65  VISUVTKADAPTOR_API void stopping() override;
66 
73  VISUVTKADAPTOR_API virtual KeyConnectionsMap getAutoConnections() const override;
74 
75 private:
76 
77  vtkDistanceRepresentation2D* m_distanceRepresentation;
78 
79  vtkActor* m_lineActor;
80  vtkLineSource* m_lineSource;
81 
82  ::fwData::Point::cwptr m_point1;
83  ::fwData::Point::cwptr m_point2;
84 
86  ::fwCom::Connection m_point1Connection;
87 
89  ::fwCom::Connection m_point2Connection;
90 };
91 
92 } //namespace visuVTKAdaptor
93 
94 #endif // ANDROID
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...
Namespace containing fw4spl communication tools.
Definition: DumpEditor.hpp:30
Namespace fwServices is dedicated to (mimic) the dynamic affectation of methods to (pure data) object...
Display the distance between the two points of the point list.
Definition: SDistance.hpp:44
#define fwCoreServiceClassDefinitionsMacro(_classinfo_)
Generate common code for services classes.
Contains the representation of the data objects used in the framework.