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

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

10
11
#include "ioData/config.hpp"

12
13
#include <io/IWriter.hpp>

14
#include <boost/filesystem/path.hpp>
15
16
17
18
19
20
21
22
23
24
25
26

namespace ioData
{
/**
 * @brief   Mesh writer service.
 *
 * Service writing a mesh object.
 * @li This service has no specified start and stop method.
 * @li Use setConfiguration(cfg) and configure() methods to configure the mesh filename.
 * @li Use update() to write the mesh and notify observers.
 *
 * Service registered details : \n
27
 * fwServicesRegisterMacro( ::io::IWriter , ::ioData::MeshWriterService , ::fwData::Mesh )
28
29
30
31
32
33
 */
class IODATA_CLASS_API MeshWriterService : public ::io::IWriter
{

public:

34
    fwCoreServiceClassDefinitionsMacro( (MeshWriterService)(::io::IWriter) );
35

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

    /**
     * @brief   Constructor : does nothing
     */
julien.waechter's avatar
julien.waechter committed
42
    IODATA_API MeshWriterService();
43
44
45
46

    /**
     * @brief   destructor
     */
julien.waechter's avatar
julien.waechter committed
47
    IODATA_API ~MeshWriterService() throw();
48
49
50
51
52
53
54
55

    /** @name Specified writer service methods ( override from ::io::IWriter )
     * @{
     */

    /**
     * @brief   returns  (filename) extension
     */
julien.waechter's avatar
julien.waechter committed
56
    IODATA_API virtual std::vector< std::string > getSupportedExtensions();
57
58
59
60
61
62
63
64
65
66

    /**
     * @brief Configure the mesh path.
     *
     * This method is used to find
     * the file path  using a file selector.
     */
    IODATA_API void configureWithIHM();
    /// @}

67
68
69
    /// Return path type managed by the service, here FILE
    IODATA_API virtual ::io::IOPathType getIOPathType() const;

70
71
72
73
74
75
76
77
78
79
80
protected:

    /** @name Service methods ( override from ::fwServices::IService )
     * @{
     */

    /**
     * @brief Starting method : default does nothing.
     *
     * This method is used to initialize the service.
     */
julien.waechter's avatar
julien.waechter committed
81
82
83
    virtual void starting() throw(::fwTools::Failed)
    {
    }
84
85
86
87
88
89

    /**
     * @brief Stopping method : default does nothing.
     *
     * The stopping method is empty for this service.
     */
julien.waechter's avatar
julien.waechter committed
90
91
92
    virtual void stopping() throw(::fwTools::Failed)
    {
    }
93

94
95
96
97
98
    /**
     * @brief Configuring method : calls implementation from `io::IWriter`
     */
    IODATA_API virtual void configuring() throw(::fwTools::Failed);

99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
    /**
     * @brief Updating method. This method is called by update() from base service ( ::fwServices::IService )
     *
     * This method is used to update the service.
     * The mesh is written with the writer ::fwDataIO::writer::MeshWriter.
     * 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
     */
116
    IODATA_API virtual void info(std::ostream& _sstream );
117
118
119
120
121
122
    /// @}

};

}

julien.waechter's avatar
julien.waechter committed
123
#endif /*__IODATA_MESHWRITERSERVICE_HPP__*/