OpenWalnut  1.5.0dev
WMWriteRawData.h
1 //---------------------------------------------------------------------------
2 //
3 // Project: OpenWalnut ( http://www.openwalnut.org )
4 //
5 // Copyright 2009 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 WMWRITERAWDATA_H
26 #define WMWRITERAWDATA_H
27 
28 #include <memory>
29 #include <string>
30 #include <vector>
31 
32 #include <osg/Geode>
33 
34 #include "core/dataHandler/WDataSetScalar.h"
35 #include "core/kernel/WModule.h"
36 #include "core/kernel/WModuleInputData.h"
37 #include "core/kernel/WModuleOutputData.h"
38 
39 /**
40  * A module to read scalar data stored as array of raw data.
41  *
42  * \ingroup modules
43  */
44 class WMWriteRawData: public WModule
45 {
46 public:
47  /**
48  * Constructor of module.
49  */
51 
52  /**
53  * Destructor of module.
54  */
55  virtual ~WMWriteRawData();
56 
57  /**
58  * Gives back the name of this module.
59  * \return the module's name.
60  */
61  virtual const std::string getName() const;
62 
63  /**
64  * Gives back a description of this module.
65  * \return description to module.
66  */
67  virtual const std::string getDescription() const;
68 
69  /**
70  * Due to the prototype design pattern used to build modules, this method returns a new instance of this method. NOTE: it
71  * should never be initialized or modified in some other way. A simple new instance is required.
72  *
73  * \return the prototype used to create every module in OpenWalnut.
74  */
75  virtual std::shared_ptr< WModule > factory() const;
76 
77  /**
78  * Get the icon for this module in XPM format.
79  *
80  * \return The icon.
81  */
82  virtual const char** getXPMIcon() const;
83 
84 protected:
85  /**
86  * Entry point after loading the module. Runs in separate thread.
87  */
88  virtual void moduleMain();
89 
90  /**
91  * Initialize the connectors this module is using.
92  */
93  virtual void connectors();
94 
95  /**
96  * Initialize the properties for this module.
97  */
98  virtual void properties();
99 
100  /**
101  * Initialize requirements for this module.
102  */
103  virtual void requirements();
104 
105 private:
106  std::shared_ptr< WCondition > m_propCondition; //!< A condition used to notify about changes in several properties.
107  WPropFilename m_dataFile; //!< The data will be read from this file.
108 
109  std::shared_ptr< WDataSetScalar > m_dataSet; //!< This data set is provided as output through the connector.
110  std::shared_ptr< WModuleInputData< WDataSetScalar > > m_input; //!< Output connector provided by this module.
111 };
112 
113 #endif // WMWRITERAWDATA_H
A module to read scalar data stored as array of raw data.
std::shared_ptr< WModuleInputData< WDataSetScalar > > m_input
Output connector provided by this module.
virtual void moduleMain()
Entry point after loading the module.
std::shared_ptr< WCondition > m_propCondition
A condition used to notify about changes in several properties.
WMWriteRawData()
Constructor of module.
virtual void connectors()
Initialize the connectors this module is using.
virtual const std::string getDescription() const
Gives back a description of this module.
virtual ~WMWriteRawData()
Destructor of module.
std::shared_ptr< WDataSetScalar > m_dataSet
This data set is provided as output through the connector.
virtual void requirements()
Initialize requirements for this module.
virtual void properties()
Initialize the properties for 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...
WPropFilename m_dataFile
The data will be read from this file.
virtual const char ** getXPMIcon() const
Get the icon for this module in XPM format.
virtual const std::string getName() const
Gives back the name of this module.
Class representing a single module of OpenWalnut.
Definition: WModule.h:72