TransformationMatrix3DWriterService.hpp 3.28 KB
Newer Older
1
/* ***** BEGIN LICENSE BLOCK *****
2
 * FW4SPL - Copyright (C) IRCAD, 2009-2017.
Nicolas Philipps's avatar
Nicolas Philipps committed
3
4
 * Distributed under the terms of the GNU Lesser General Public License (LGPL) as
 * published by the Free Software Foundation.
5
6
 * ****** END LICENSE BLOCK ****** */

julien.waechter's avatar
julien.waechter committed
7
8
#ifndef __IODATA_TRANSFORMATIONMATRIX3DWRITERSERVICE_HPP__
#define __IODATA_TRANSFORMATIONMATRIX3DWRITERSERVICE_HPP__
9

10
#include "ioData/config.hpp"
11
12
13

#include <io/IWriter.hpp>

14
#include <boost/filesystem/path.hpp>
15
16
17
18

namespace ioData
{
/**
Nicolas Philipps's avatar
Nicolas Philipps committed
19
 * @brief   Transformation matrix 3D writer service.
20
21
22
23
24
25
26
27
 *
 * Service writing a TransformationMatrix3D object
 * @li Use setConfiguration(cfg) and configure() methods to configure the matrix filename.
 * @li Use start() to initialize the service.
 * @li Use update() to write the transformation matrix.
 * @li Use stop() to stop service before to destroy it.
 *
 * Service registered details : \n
28
29
 * fwServicesRegisterMacro( ::io::IWriter , ::ioData::TransformationMatrix3DWriterService ,
 *::fwData::TransformationMatrix3D )
30
31
32
33
34
35
 */
class IODATA_CLASS_API TransformationMatrix3DWriterService : public ::io::IWriter
{

public:

36
    fwCoreServiceClassDefinitionsMacro( (TransformationMatrix3DWriterService)(::io::IWriter) );
37
38

    /// Super class of writer services
julien.waechter's avatar
julien.waechter committed
39
    typedef ::io::IWriter SuperClass;
40

Nicolas Philipps's avatar
Nicolas Philipps committed
41
42
43
    /** @name Specified writer service methods ( override from ::io::IWriter )
     * @{
     */
44

Nicolas Philipps's avatar
Nicolas Philipps committed
45
46
47
48
49
50
51
    /**
     * @brief Configure the matrix path.
     *
     * This method is used to find
     * the file path  using a file selector.
     */
    IODATA_API virtual void configureWithIHM();
52

Nicolas Philipps's avatar
Nicolas Philipps committed
53
54
55
    /**
     * @brief   returns  (filename) extension
     */
julien.waechter's avatar
julien.waechter committed
56
    IODATA_API virtual std::vector< std::string > getSupportedExtensions();
Nicolas Philipps's avatar
Nicolas Philipps committed
57
    ///@}
58

59
60
    /// Return path type managed by the service, here FILE
    IODATA_API virtual ::io::IOPathType getIOPathType() const;
61
62
63

protected:

64
65
    /** @name Service methods ( override from ::fwServices::IService )
     * @{
Nicolas Philipps's avatar
Nicolas Philipps committed
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
     */

    /**
     * @brief Starting method. This method is called by start() from base service ( ::fwServices::IService )
     *
     * This method is used to initialize the service. The starting method is empty for this service.
     */
    IODATA_API virtual void starting( ) throw(::fwTools::Failed);

    /**
     * @brief Stopping method. This method is called by stop() from base service ( ::fwServices::IService )
     *
     * The stopping method is empty for this service.
     */
    IODATA_API virtual void stopping( ) throw(::fwTools::Failed);

82
83
84
85
86
    /**
     * @brief Configuring method : calls implementation from `io::IWriter`
     */
    IODATA_API virtual void configuring() throw(::fwTools::Failed);

Nicolas Philipps's avatar
Nicolas Philipps committed
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
    /**
     * @brief Updating method. This method is called by update() from base service ( ::fwServices::IService )
     *
     * This method is used to update the service.
     * The transformation matrix is written with the writer ::fwDataIO::writer::TransformationMatrix3DWriter.
     * Notify writing.
     */
    IODATA_API void updating() throw(::fwTools::Failed);

    /**
     * @brief Info method.
     *
     * This method is used to give
     * informations about the service.
     *
     * @param[out] _sstream output stream
     */
104
    IODATA_API virtual void info(std::ostream& _sstream );
Nicolas Philipps's avatar
Nicolas Philipps committed
105
    /// @}
106
107
108
109
110

};

} // namespace ioData

julien.waechter's avatar
julien.waechter committed
111
#endif // __IODATA_TRANSFORMATIONMATRIX3DWRITERSERVICE_HPP__