fw4spl
SPdfWriter.hpp
1 /* ***** BEGIN LICENSE BLOCK *****
2  * FW4SPL - Copyright (C) IRCAD, 2016-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 "ioQt/config.hpp"
10 
11 #include <fwData/Image.hpp>
12 
13 #include <fwGuiQt/container/QtContainer.hpp>
14 
15 #include <fwIO/IWriter.hpp>
16 
17 #include <QPdfWriter>
18 #include <QtWidgets>
19 
20 namespace ioQt
21 {
22 
51 class IOQT_CLASS_API SPdfWriter : public ::fwIO::IWriter
52 {
53 
54 public:
55 
56  typedef std::vector< QImage > ImagesScaledListType;
57  typedef std::vector< ::fwData::Image::sptr > ImagesListType;
58  typedef std::vector< std::string > ImagesIDsType;
59 
60  typedef std::vector< QWidget* > ContainersListType;
61  typedef std::vector< std::string > ContainersIDsType;
62 
67  IOQT_API SPdfWriter();
68 
72  IOQT_API ~SPdfWriter() noexcept;
73 
74 protected:
75 
86  IOQT_API virtual void starting() override;
87 
93  IOQT_API virtual void stopping() override;
94 
101  IOQT_API virtual void configuring( ) override;
102 
109  IOQT_API void configureWithIHM() override;
110 
117  IOQT_API void updating() override;
118 
127  IOQT_API virtual void info(std::ostream& _sstream ) override;
129 
131  IOQT_API ::fwIO::IOPathType getIOPathType() const override;
132 
133 private:
134 
140  IOQT_API static QImage convertFwImageToQImage(::fwData::Image::sptr image);
141 
146  IOQT_API static void scaleQImage(QImage& qImage, const int scale);
147 
152  ImagesIDsType m_imagesUIDs;
153 
157  ImagesListType m_imagesToExport;
158 
163  ContainersIDsType m_containersIDs;
164 
168  ContainersListType m_containersToExport;
169 
170 };
171 }
Creates and writes a PDF containing images.
Definition: SPdfWriter.hpp:51
STL namespace.
#define fwCoreServiceClassDefinitionsMacro(_classinfo_)
Generate common code for services classes.
Writer service API. It manages extension points definition and extension configuration.
Definition: IWriter.hpp:33
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.