fw4spl
SPointList.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_SPOINTLIST_HPP__
8 #define __VISUVTKADAPTOR_SPOINTLIST_HPP__
9 
10 #ifndef ANDROID
11 
12 #include "visuVTKAdaptor/config.hpp"
13 #include "visuVTKAdaptor/SPoint.hpp"
14 
15 #include <fwData/Color.hpp>
16 #include <fwData/Point.hpp>
17 
18 #include <fwRenderVTK/IAdaptor.hpp>
19 
20 #include <set>
21 #include <vector>
22 
23 namespace visuVTKAdaptor
24 {
25 
52 class VISUVTKADAPTOR_CLASS_API SPointList : public ::fwRenderVTK::IAdaptor
53 {
54 
55 public:
56  typedef std::vector< WPTR(::fwData::Point) > WeakPointListType;
57  typedef std::set< WPTR(::fwData::Point) > WeakPointSetType;
58 
59  static const ::fwServices::IService::KeyType s_POINTLIST_INPUT;
60 
62 
63  VISUVTKADAPTOR_API SPointList() noexcept;
64 
65  VISUVTKADAPTOR_API virtual ~SPointList() noexcept;
66 
67  VISUVTKADAPTOR_API void setRadius(const double);
68 
69  VISUVTKADAPTOR_API void setColor(const fwData::Color::sptr);
70 
71  VISUVTKADAPTOR_API void setInteraction(const bool);
72 
73 protected:
74 
75  VISUVTKADAPTOR_API void configuring() override;
76  VISUVTKADAPTOR_API void starting() override;
77  VISUVTKADAPTOR_API void updating() override;
78  VISUVTKADAPTOR_API void stopping() override;
79 
88  VISUVTKADAPTOR_API virtual KeyConnectionsMap getAutoConnections() const override;
89 
90  VISUVTKADAPTOR_API void createServices(WeakPointListType& wPtList);
91  VISUVTKADAPTOR_API WeakPointListType getWeakPointList();
92  VISUVTKADAPTOR_API WeakPointListType getNewPoints();
93 
94  WeakPointListType m_oldWeakPointList;
95  WeakPointListType m_weakPointList;
96 
97 private:
102  void addPoint(::fwData::Point::sptr point);
104 
106  void updateSpline();
111  ::fwData::Color::sptr m_ptColor;
113 
115  double m_radius;
116 
118  bool m_interaction;
119 };
120 
121 } //namespace visuVTKAdaptor
122 
123 #endif // ANDROID
124 
125 #endif // __VISUVTKADAPTOR_SPOINTLIST_HPP__
Adaptor to display a point list.
Definition: SPointList.hpp:52
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...
#define fwCoreServiceClassDefinitionsMacro(_classinfo_)
Generate common code for services classes.
Contains the representation of the data objects used in the framework.