OpenWalnut  1.5.0dev
WMWriteAmiraMesh.h
1 //---------------------------------------------------------------------------
2 //
3 // Project: OpenWalnut ( http://www.openwalnut.org )
4 //
5 // Copyright 2013 OpenWalnut Community, BSV@Uni-Leipzig and CNCF@MPI-CBS
6 // For more information see http://www.openwalnut.org/copying
7 //
8 // This file is part of OpenWalnut.
9 //
10 // OpenWalnut is free software: you can redistribute it and/or modify
11 // it under the terms of the GNU Lesser General Public License as published by
12 // the Free Software Foundation, either version 3 of the License, or
13 // (at your option) any later version.
14 //
15 // OpenWalnut is distributed in the hope that it will be useful,
16 // but WITHOUT ANY WARRANTY; without even the implied warranty of
17 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
18 // GNU Lesser General Public License for more details.
19 //
20 // You should have received a copy of the GNU Lesser General Public License
21 // along with OpenWalnut. If not, see <http://www.gnu.org/licenses/>.
22 //
23 //---------------------------------------------------------------------------
24 
25 #ifndef WMWRITEAMIRAMESH_H
26 #define WMWRITEAMIRAMESH_H
27 
28 #include <fstream>
29 #include <memory>
30 #include <string>
31 
32 #include <osg/Geode>
33 
34 #include "core/dataHandler/WDataSetFibers.h"
35 #include "core/kernel/WModule.h"
36 #include "core/kernel/WModuleInputData.h"
37 #include "core/kernel/WModuleOutputData.h"
38 
39 /**
40  * Someone should add some documentation here.
41  * Probably the best person would be the module's
42  * creator, i.e. "wiebel".
43  *
44  * This is only an empty template for a new module. For
45  * an example module containing many interesting concepts
46  * and extensive documentation have a look at "src/modules/template"
47  *
48  * \ingroup modules
49  */
51 {
52 public:
53  /**
54  *
55  */
57 
58  /**
59  *
60  */
61  virtual ~WMWriteAmiraMesh();
62 
63  /**
64  * Gives back the name of this module.
65  * \return the module's name.
66  */
67  virtual const std::string getName() const;
68 
69  /**
70  * Gives back a description of this module.
71  * \return description to module.
72  */
73  virtual const std::string getDescription() const;
74 
75  /**
76  * Due to the prototype design pattern used to build modules, this method returns a new instance of this method. NOTE: it
77  * should never be initialized or modified in some other way. A simple new instance is required.
78  *
79  * \return the prototype used to create every module in OpenWalnut.
80  */
81  virtual std::shared_ptr< WModule > factory() const;
82 
83 protected:
84  /**
85  * Entry point after loading the module. Runs in separate thread.
86  */
87  virtual void moduleMain();
88 
89  /**
90  * Initialize the connectors this module is using.
91  */
92  virtual void connectors();
93 
94  /**
95  * Initialize the properties for this module.
96  */
97  virtual void properties();
98 
99  /**
100  * Initialize requirements for this module.
101  */
102  virtual void requirements();
103 
104 
105 private:
106  /**
107  * Writes the data to file.
108  */
109  void writeFile();
110 
111  WPropFilename m_savePath; //!< Path where tracts should be stored
112 
113  /**
114  * Input connector for writing directly tracts to a file.
115  */
116  std::shared_ptr< WModuleInputData< const WDataSetFibers > > m_tractConnector;
117 
118  WPropTrigger m_run; //!< Button to start saving
119 };
120 
121 #endif // WMWRITEAMIRAMESH_H
Someone should add some documentation here.
virtual const std::string getName() const
Gives back the name of this module.
virtual std::shared_ptr< WModule > factory() const
Due to the prototype design pattern used to build modules, this method returns a new instance of this...
virtual const std::string getDescription() const
Gives back a description of this module.
virtual void requirements()
Initialize requirements for this module.
WPropTrigger m_run
Button to start saving.
std::shared_ptr< WModuleInputData< const WDataSetFibers > > m_tractConnector
Input connector for writing directly tracts to a file.
void writeFile()
Writes the data to file.
virtual void connectors()
Initialize the connectors this module is using.
virtual void properties()
Initialize the properties for this module.
virtual void moduleMain()
Entry point after loading the module.
WPropFilename m_savePath
Path where tracts should be stored.
Class representing a single module of OpenWalnut.
Definition: WModule.h:72