fw4spl
SPlane.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_SPLANE_HPP__
8 #define __VISUVTKADAPTOR_SPLANE_HPP__
9 
10 #ifndef ANDROID
11 
12 #include "visuVTKAdaptor/config.hpp"
13 
14 #include <fwCom/Signal.hpp>
15 #include <fwCom/Signals.hpp>
16 
17 #include <fwData/Plane.hpp>
18 
19 #include <fwRenderVTK/IAdaptor.hpp>
20 
21 class vtkPlaneSource;
22 class vtkPlaneCollection;
23 class vtkPlane;
24 class vtkObject;
25 class vtkActor;
26 
27 namespace fwData
28 {
29 class Plane;
30 }
31 
32 namespace visuVTKAdaptor
33 {
34 
63 class VISUVTKADAPTOR_CLASS_API SPlane : public ::fwRenderVTK::IAdaptor
64 {
65 
66 public:
67 
69 
70  VISUVTKADAPTOR_API SPlane() noexcept;
71 
72  VISUVTKADAPTOR_API virtual ~SPlane() noexcept;
73 
74  static const ::fwServices::IService::KeyType s_PLANE_INOUT;
75 
76  VISUVTKADAPTOR_API void setVtkPlaneCollection( vtkObject* col );
77 
82  typedef ::fwCom::Signal< void (::fwData::Plane::sptr) > InteractionStartedSignalType;
84  VISUVTKADAPTOR_API static const ::fwCom::Signals::SignalKeyType s_INTERACTION_STARTED_SIG;
93  void selectPlane(bool select);
99 protected:
100  VISUVTKADAPTOR_API void configuring() override;
101  VISUVTKADAPTOR_API void starting() override;
102  VISUVTKADAPTOR_API void updating() override;
103  VISUVTKADAPTOR_API void stopping() override;
104 
112  VISUVTKADAPTOR_API virtual KeyConnectionsMap getAutoConnections() const override;
113 
118  void updatePoints();
120 
122  void startInteraction();
127 private:
128 
129  vtkPlaneSource* m_vtkPlane;
130  vtkActor* m_actorPlan;
131 
132  vtkPlane* m_vtkImplicitPlane;
133  vtkPlaneCollection* m_vtkPlaneCollection;
134 
135  ::fwRenderVTK::SRender::VtkObjectIdType m_planeCollectionId;
136 
138  ::fwCom::helper::SigSlotConnection m_connections;
139 };
140 
141 } //namespace visuVTKAdaptor
142 
143 #endif // ANDROID
144 
145 #endif // __VISUVTKADAPTOR_SPLANE_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...
Namespace containing fw4spl communication tools.
Definition: DumpEditor.hpp:30
Namespace fwServices is dedicated to (mimic) the dynamic affectation of methods to (pure data) object...
Represents a Plane that can be interacted with 3 points.
Definition: SPlane.hpp:63
#define fwCoreServiceClassDefinitionsMacro(_classinfo_)
Generate common code for services classes.
The namespace fwRenderVTK contains classes for rendering with VTK.
Contains the representation of the data objects used in the framework.