fw4spl
SImageWriter.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 <fwIO/IWriter.hpp>
12 
13 #include <boost/filesystem/path.hpp>
14 
15 #include <string>
16 
17 namespace fwData
18 {
19 class Image;
20 }
21 
22 namespace fwJobs
23 {
24 class IJob;
25 }
26 
27 namespace ioVTK
28 {
29 
53 class IOVTK_CLASS_API SImageWriter : public ::fwIO::IWriter
54 {
55 
56 public:
57 
61  IOVTK_API SImageWriter() noexcept;
62 
63  ~SImageWriter() noexcept
64  {
65  }
66 
68 
69  typedef ::fwCom::Signal< void ( SPTR(::fwJobs::IJob) ) > JobCreatedSignalType;
70 
77  IOVTK_API virtual void configureWithIHM() override;
78 
89  IOVTK_API static bool saveImage( const ::boost::filesystem::path& imgFile,
90  const CSPTR(::fwData::Image)& image,
91  const SPTR(JobCreatedSignalType)& sigJobCreated);
92 
93 protected:
94 
95  IOVTK_API virtual ::fwIO::IOPathType getIOPathType() const override;
96 
102  IOVTK_API virtual void starting() override;
103 
109  IOVTK_API virtual void stopping() override;
110 
116  IOVTK_API virtual void configuring() override;
117 
124  IOVTK_API void updating() override;
125 
132  IOVTK_API void info(std::ostream& _sstream ) override;
133 
134 private:
139  bool m_bServiceIsConfigured;
140 
144  ::boost::filesystem::path m_fsImgPath;
145 
146  SPTR(JobCreatedSignalType) m_sigJobCreated;
147 };
148 
149 } // namespace ioVTK
#define SPTR(_cls_)
#define CSPTR(_cls_)
VTK Image Writer.
#define fwCoreServiceClassDefinitionsMacro(_classinfo_)
Generate common code for services classes.
Writer service API. It manages extension points definition and extension configuration.
Definition: IWriter.hpp:33
Contains the representation of the data objects used in the framework.
This class defines an image.
This namespace fwJobs provides jobs management.
The namespace ioVTK contains reader, writer and helper using the fwVtkIO lib for output and input act...