fw4spl
SPlaneList.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_SPLANELIST_HPP__
8 #define __VISUVTKADAPTOR_SPLANELIST_HPP__
9 
10 #ifndef ANDROID
11 
12 #include "visuVTKAdaptor/config.hpp"
13 
14 #include <fwCom/helper/SigSlotConnection.hpp>
15 
16 #include <fwData/Plane.hpp>
17 
18 #include <fwRenderVTK/IAdaptor.hpp>
19 
20 class vtkCommand;
21 
22 namespace visuVTKAdaptor
23 {
24 
55 class VISUVTKADAPTOR_CLASS_API SPlaneList : public ::fwRenderVTK::IAdaptor
56 {
57 
58 public:
59 
61 
62  VISUVTKADAPTOR_API SPlaneList() noexcept;
63 
64  VISUVTKADAPTOR_API virtual ~SPlaneList() noexcept;
65 
66  //------------------------------------------------------------------------------
67 
68  void setPlaneCollectionId(::fwRenderVTK::SRender::VtkObjectIdType id)
69  {
70  m_planeCollectionId = id;
71  }
72 
73  //------------------------------------------------------------------------------
74 
75  ::fwRenderVTK::SRender::VtkObjectIdType getPlaneCollectionId() const
76  {
77  return m_planeCollectionId;
78  }
79 
80 protected:
81 
83  typedef ::fwCom::Signal< void (::fwData::Plane::sptr) > SelectedignalType;
84 
85  VISUVTKADAPTOR_API void configuring() override;
86  VISUVTKADAPTOR_API void starting() override;
87  VISUVTKADAPTOR_API void updating() override;
88  VISUVTKADAPTOR_API void stopping() override;
89 
96  VISUVTKADAPTOR_API virtual KeyConnectionsMap getAutoConnections() const override;
97 
99  void updateSelection(::fwData::Plane::sptr plane);
100 
101  vtkCommand* m_rightButtonCommand;
102  ::fwRenderVTK::SRender::VtkObjectIdType m_planeCollectionId;
103 
106 
107 private:
112  void updatePlanes();
114 
116  void showPlanes(bool visible);
120 };
121 
122 } //namespace visuVTKAdaptor
123 
124 #endif // ANDROID
125 
126 #endif // __VISUVTKADAPTOR_SPLANELIST_HPP__
This class is a helper to define the connections of a service and its data.
Definition: IService.hpp:454
::fwCom::helper::SigSlotConnection m_planeConnections
Store connections to planes adaptors.
Definition: SPlaneList.hpp:105
The namespace visuVTKAdaptor contains the list of adaptors available for the generic scene...
This class provides few tools to ease connect/disconnect between a signal emitter and a slot receiver...
::fwCom::Signal< void(::fwData::Plane::sptr) > SelectedignalType
Type of signal emitted when plane selection changed.
Definition: SPlaneList.hpp:83
#define fwCoreServiceClassDefinitionsMacro(_classinfo_)
Generate common code for services classes.
The namespace fwRenderVTK contains classes for rendering with VTK.
Represents a list of Plane that can be interacted with 3 points.
Definition: SPlaneList.hpp:55