fw4spl
SPoint.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_SPOINT_HPP__
8 
9 #ifndef __VISUVTKADAPTOR_SPOINT_HPP__
10 #define __VISUVTKADAPTOR_SPOINT_HPP__
11 
12 #include "visuVTKAdaptor/config.hpp"
13 
14 #include <fwCom/Signal.hpp>
15 #include <fwCom/Signals.hpp>
16 
17 #include <fwData/Color.hpp>
18 
19 #include <fwRenderVTK/IAdaptor.hpp>
20 
21 class vtkHandleWidget;
22 class vtkHandleRepresentation;
23 class vtkCommand;
24 
25 namespace visuVTKAdaptor
26 {
27 
53 class VISUVTKADAPTOR_CLASS_API SPoint : public ::fwRenderVTK::IAdaptor
54 {
55 
56 public:
57 
59 
60  static const ::fwServices::IService::KeyType s_POINT_INOUT;
61 
62  VISUVTKADAPTOR_API SPoint() noexcept;
63 
64  VISUVTKADAPTOR_API virtual ~SPoint() noexcept;
65 
66  VISUVTKADAPTOR_API void setRadius(const double radius);
67 
68  VISUVTKADAPTOR_API void setColor(const float red, const float green, const float blue, const float alpha = 1.0);
69 
70  VISUVTKADAPTOR_API void setSelectedColor(const float red, const float green, const float blue,
71  const float alpha = 1.0);
72 
73  VISUVTKADAPTOR_API void setInteraction(const bool interaction = true);
74 
79  typedef ::fwCom::Signal< void () > InteractionStartedSignalType;
81  VISUVTKADAPTOR_API static const ::fwCom::Signals::SignalKeyType s_INTERACTION_STARTED_SIG;
86 protected:
87 
88  VISUVTKADAPTOR_API void configuring() override;
89  VISUVTKADAPTOR_API void starting() override;
90  VISUVTKADAPTOR_API void updating() override;
91  VISUVTKADAPTOR_API void stopping() override;
92 
99  VISUVTKADAPTOR_API virtual KeyConnectionsMap getAutoConnections() const override;
100 
101 private:
102  vtkHandleWidget* m_handle;
103  vtkHandleRepresentation* m_representation;
104  vtkCommand* m_pointUpdateCommand;
105 
106  ::fwData::Color::sptr m_ptColor;
107  ::fwData::Color::sptr m_ptSelectedColor;
108  double m_radius;
109 
111  bool m_interaction;
112 };
113 
114 } //namespace visuVTKAdaptor
115 
116 #endif // __VISUVTKADAPTOR_SPOINT_HPP__
117 
118 #endif // __VISUVTKADAPTOR_SPOINT_HPP__
This class is a helper to define the connections of a service and its data.
Definition: IService.hpp:454
Adaptor to display a point.
Definition: SPoint.hpp:53
The namespace visuVTKAdaptor contains the list of adaptors available for the generic scene...
Namespace containing fw4spl communication tools.
Definition: DumpEditor.hpp:30
#define fwCoreServiceClassDefinitionsMacro(_classinfo_)
Generate common code for services classes.
Contains the representation of the data objects used in the framework.