fw4spl
SMeshReader.hpp
1 /* ***** BEGIN LICENSE BLOCK *****
2  * FW4SPL - Copyright (C) IRCAD, 2009-2018.
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 #pragma once
8 
9 #include "ioVTK/config.hpp"
10 
11 #include <fwData/Mesh.hpp>
12 
13 #include <fwIO/IReader.hpp>
14 
15 #include <boost/filesystem/path.hpp>
16 
17 #include <string>
18 
19 namespace fwJobs
20 {
21 class IJob;
22 }
23 
24 namespace ioVTK
25 {
26 
46 class IOVTK_CLASS_API SMeshReader : public ::fwIO::IReader
47 {
48 
49 public:
50  virtual ~SMeshReader() noexcept
51  {
52  }
53 
55 
56  typedef ::fwCom::Signal< void ( SPTR(::fwJobs::IJob) ) > JobCreatedSignalType;
57 
59  IOVTK_API SMeshReader() noexcept;
60 
67  IOVTK_API virtual void configureWithIHM() override;
68 
69 protected:
70 
71  IOVTK_API virtual ::fwIO::IOPathType getIOPathType() const override;
72 
78  IOVTK_API virtual void starting() override;
79 
85  IOVTK_API virtual void stopping() override;
86 
92  IOVTK_API virtual void configuring() override;
93 
100  IOVTK_API void updating() override;
101 
108  IOVTK_API void info(std::ostream& _sstream ) override;
109 
110 private:
111 
120  void loadMesh( const ::boost::filesystem::path _vtkFile, ::fwData::Mesh::sptr _pMesh );
121 
128  void notificationOfUpdate();
129 
134  bool m_bServiceIsConfigured;
135 
139  ::boost::filesystem::path m_fsMeshPath;
140 
142  SPTR(JobCreatedSignalType) m_sigJobCreated;
143 };
144 
145 } // namespace ioVTK
#define SPTR(_cls_)
STL namespace.
VTK Mesh Reader.
Definition: SMeshReader.hpp:46
Reader service API. It manages extension points definition and extension configuration.
Definition: IReader.hpp:34
#define fwCoreServiceClassDefinitionsMacro(_classinfo_)
Generate common code for services classes.
The namespace fwIO contains the base interface for reader and writer services.
Definition: ioTypes.hpp:16
Contains the representation of the data objects used in the framework.
This namespace fwJobs provides jobs management.
The namespace ioVTK contains reader, writer and helper using the fwVtkIO lib for output and input act...