fw4spl
SWriter.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 "ioAtoms/config.hpp"
10 
11 #include <fwAtomsBoostIO/Writer.hpp>
12 
13 #include <fwCom/Signal.hpp>
14 
15 #include <fwGui/dialog/LocationDialog.hpp>
16 
17 #include <fwIO/IWriter.hpp>
18 
19 #include <fwJobs/IJob.hpp>
20 
21 #include <set>
22 
23 namespace ioAtoms
24 {
25 
80 class IOATOMS_CLASS_API SWriter : public ::fwIO::IWriter
81 {
82 
83 public:
84 
86 
88  typedef ::fwCom::Signal< void ( ::fwJobs::IJob::sptr ) > JobCreatedSignalType;
89 
91  IOATOMS_API SWriter();
92 
94  IOATOMS_API virtual ~SWriter() noexcept
95  {
96  }
97 
99  IOATOMS_API void configureWithIHM() override;
100 
101 protected:
102 
104  typedef std::map< std::string, std::string > FileExtension2NameType;
105 
107  IOATOMS_API void configuring() override;
108 
110  IOATOMS_API void starting() override;
111 
113  IOATOMS_API void stopping() override;
114 
119  IOATOMS_API void updating() override;
120 
122  IOATOMS_API ::fwIO::IOPathType getIOPathType() const override;
123 
126 
128  std::string m_exportedVersion;
129 
131  std::string m_context;
132 
134  std::string m_version;
135 
138  bool versionSelection();
139 
141  std::set< std::string > m_allowedExts;
142 
144  FileExtension2NameType m_customExts;
145 
147  FileExtension2NameType m_allowedExtLabels;
148 
150  JobCreatedSignalType::sptr m_sigJobCreated;
151 
153  std::string m_selectedExtension;
154 };
155 
156 } // namespace ioAtoms
JobCreatedSignalType::sptr m_sigJobCreated
Signal emitted when job created.
Definition: SWriter.hpp:150
std::map< std::string, std::string > FileExtension2NameType
Maps file extension to format name.
Definition: SWriter.hpp:104
FileExtension2NameType m_customExts
Maps custom extensions to known format.
Definition: SWriter.hpp:144
std::string m_context
Defines context of data.
Definition: SWriter.hpp:131
virtual IOATOMS_API ~SWriter() noexcept
Does nothing.
Definition: SWriter.hpp:94
FileExtension2NameType m_allowedExtLabels
Labels shown in file dialog for each allowed extension.
Definition: SWriter.hpp:147
bool m_useAtomsPatcher
To activate atom patcher.
Definition: SWriter.hpp:125
std::string m_version
Current version of format.
Definition: SWriter.hpp:134
std::set< std::string > m_allowedExts
Allowed file extensions.
Definition: SWriter.hpp:141
#define fwCoreServiceClassDefinitionsMacro(_classinfo_)
Generate common code for services classes.
Writer service API. It manages extension points definition and extension configuration.
Definition: IWriter.hpp:33
std::string m_selectedExtension
Extension selected in file dialog.
Definition: SWriter.hpp:153
Contains services to read and write data via atom conversion.
Atoms writer. Service to write an fwData medical data converted in fwAtoms.
Definition: SWriter.hpp:80
std::string m_exportedVersion
Selected exported version of atom.
Definition: SWriter.hpp:128