OpenWalnut  1.5.0dev
WMDataTypeConversion.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 WMDATATYPECONVERSION_H
26 #define WMDATATYPECONVERSION_H
27 
28 #include <map>
29 #include <memory>
30 #include <string>
31 #include <vector>
32 
33 #include <osg/Geode>
34 #include <osg/Node>
35 #include <osg/Uniform>
36 
37 #include "core/kernel/WModule.h"
38 #include "core/kernel/WModuleInputData.h"
39 
40 /**
41  * Provides a new field with the approximately the same data, but with another data type. E.g., it
42  * can convert double into float.
43 
44  * \ingroup modules
45  */
47 {
48 public:
49  /**
50  * Standard constructor.
51  */
53 
54  /**
55  * Destructor.
56  */
58 
59  /**
60  * Gives back the name of this module.
61  * \return the module's name.
62  */
63  virtual const std::string getName() const;
64 
65  /**
66  * Gives back a description of this module.
67  * \return description of module.
68  */
69  virtual const std::string getDescription() const;
70 
71  /**
72  * Due to the prototype design pattern used to build modules, this method returns a new instance of this method. NOTE: it
73  * should never be initialized or modified in some other way. A simple new instance is required.
74  *
75  * \return the prototype used to create every module in OpenWalnut.
76  */
77  virtual std::shared_ptr< WModule > factory() const;
78 
79  /**
80  * Get the icon for this module in XPM format.
81  * \return The icon.
82  */
83  virtual const char** getXPMIcon() const;
84 
85 protected:
86  /**
87  * Entry point after loading the module. Runs in separate thread.
88  */
89  virtual void moduleMain();
90 
91  /**
92  * Initialize the connectors this module is using.
93  */
94  virtual void connectors();
95 
96  /**
97  * Initialize the properties for this module.
98  */
99  virtual void properties();
100 
101 private:
102  std::shared_ptr< WModuleInputData< WDataSetSingle > > m_input; //!< Input connector required by this module.
103  std::shared_ptr< WModuleOutputData< WDataSetSingle > > m_output; //!< The only output of this filter module.
104  std::shared_ptr< WDataSetSingle > m_dataSet; //!< Pointer providing access to the treated data set in the whole module.
105 
106  std::shared_ptr< WItemSelection > m_dataTypeSelectionsList; //!< A list of file type selection types
107  WPropSelection m_dataTypeSelection; //!< Selection
108 
109  std::shared_ptr< WCondition > m_propCondition; //!< A condition used to notify about changes in several properties.
110 };
111 #endif // WMDATATYPECONVERSION_H
Provides a new field with the approximately the same data, but with another data type.
WPropSelection m_dataTypeSelection
Selection.
std::shared_ptr< WModuleOutputData< WDataSetSingle > > m_output
The only output of this filter module.
std::shared_ptr< WItemSelection > m_dataTypeSelectionsList
A list of file type selection types.
virtual const std::string getName() const
Gives back the name of this module.
virtual void moduleMain()
Entry point after loading the module.
virtual void properties()
Initialize the properties for this module.
virtual const char ** getXPMIcon() const
Get the icon for this module in XPM format.
WMDataTypeConversion()
Standard constructor.
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.
std::shared_ptr< WDataSetSingle > m_dataSet
Pointer providing access to the treated data set in the whole module.
virtual void connectors()
Initialize the connectors this module is using.
std::shared_ptr< WCondition > m_propCondition
A condition used to notify about changes in several properties.
std::shared_ptr< WModuleInputData< WDataSetSingle > > m_input
Input connector required by this module.
Class representing a single module of OpenWalnut.
Definition: WModule.h:72