fw4spl
visuVTKAdaptor/include/visuVTKAdaptor/SLine.hpp
1 /* ***** BEGIN LICENSE BLOCK *****
2  * FW4SPL - Copyright (C) IRCAD, 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_SLINE_HPP__
8 #define __VISUVTKADAPTOR_SLINE_HPP__
9 
10 #include "visuVTKAdaptor/config.hpp"
11 
12 #include <fwData/Color.hpp>
13 
14 #include <fwRenderVTK/IAdaptor.hpp>
15 
16 #include <vtkActor.h>
17 #include <vtkLineSource.h>
18 #include <vtkPolyDataMapper.h>
19 #include <vtkSmartPointer.h>
20 
21 namespace visuVTKAdaptor
22 {
23 
47 class VISUVTKADAPTOR_CLASS_API SLine : public ::fwRenderVTK::IAdaptor
48 {
49 public:
50 
52 
53  VISUVTKADAPTOR_API SLine() noexcept;
54  VISUVTKADAPTOR_API virtual ~SLine() noexcept;
55 
60  VISUVTKADAPTOR_API static const ::fwCom::Slots::SlotKeyType s_UPDATE_VISIBILITY_SLOT;
61  typedef ::fwCom::Slot<void (bool)> UpdateVisibilitySlotType;
62 
64  VISUVTKADAPTOR_API void updateVisibility ( bool isVisible );
65 
66  VISUVTKADAPTOR_API static const ::fwCom::Slots::SlotKeyType s_UPDATE_LENGTH_SLOT;
67  typedef ::fwCom::Slot<void (float)> UpdateLengthSlotType;
68 
70  VISUVTKADAPTOR_API void updateLength (float length );
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 
80 private:
81 
82  void buildPipeline();
83  void updateLine();
84 
85  vtkSmartPointer<vtkActor> m_lineActor;
86  vtkSmartPointer<vtkLineSource> m_vtkLine;
87  vtkSmartPointer<vtkPolyDataMapper> m_mapper;
88 
89  float m_length;
90  float m_width;
91  vtkSmartPointer< vtkTransform> m_transformLine;
92  ::fwData::Color::sptr m_color;
93  bool m_dotLine;
94 
95 };
96 
97 } // namespace visuVTKAdaptor
98 
99 #endif // __VISUVTKADAPTOR_SLINE_HPP__
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.