OpenWalnut  1.5.0dev
WMVectorOperator.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 WMVECTOROPERATOR_H
26 #define WMVECTOROPERATOR_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/dataHandler/WDataSetScalar.h"
38 #include "core/dataHandler/WDataSetVector.h"
39 #include "core/kernel/WModule.h"
40 #include "core/kernel/WModuleInputData.h"
41 
42 /**
43  * Operators for processing two WDataSetScalar.
44  *
45  * \ingroup modules
46  */
48 {
49 public:
50  /**
51  * Standard constructor.
52  */
54 
55  /**
56  * Destructor.
57  */
59 
60  /**
61  * Gives back the name of this module.
62  * \return the module's name.
63  */
64  virtual const std::string getName() const;
65 
66  /**
67  * Gives back a description of this module.
68  * \return description of module.
69  */
70  virtual const std::string getDescription() const;
71 
72  /**
73  * Due to the prototype design pattern used to build modules, this method returns a new instance of this method. NOTE: it
74  * should never be initialized or modified in some other way. A simple new instance is required.
75  *
76  * \return the prototype used to create every module in OpenWalnut.
77  */
78  virtual std::shared_ptr< WModule > factory() const;
79 
80  /**
81  * Get the icon for this module in XPM format.
82  * \return The icon.
83  */
84  virtual const char** getXPMIcon() const;
85 
86 protected:
87  /**
88  * Entry point after loading the module. Runs in separate thread.
89  */
90  virtual void moduleMain();
91 
92  /**
93  * Initialize the connectors this module is using.
94  */
95  virtual void connectors();
96 
97  /**
98  * Initialize the properties for this module.
99  */
100  virtual void properties();
101 
102 private:
103  /**
104  * A condition used to notify about changes in several properties.
105  */
106  std::shared_ptr< WCondition > m_propCondition;
107 
108  /**
109  * A list of operations that are possible
110  */
111  std::shared_ptr< WItemSelection > m_operations;
112 
113  /**
114  * The currently selected operation.
115  */
116  WPropSelection m_opSelection;
117 
118  std::shared_ptr< WModuleInputData< WDataSetVector > > m_inputA; //!< Input connector required by this module.
119 
120  std::shared_ptr< WModuleOutputData< WDataSetScalar > > m_output; //!< The only output of this filter module.
121 };
122 #endif // WMVECTOROPERATOR_H
123 
Operators for processing two WDataSetScalar.
std::shared_ptr< WCondition > m_propCondition
A condition used to notify about changes in several properties.
std::shared_ptr< WModuleOutputData< WDataSetScalar > > m_output
The only output of this filter module.
WPropSelection m_opSelection
The currently selected operation.
virtual const char ** getXPMIcon() const
Get the icon for this module in XPM format.
WMVectorOperator()
Standard constructor.
~WMVectorOperator()
Destructor.
virtual const std::string getName() const
Gives back the name of this module.
std::shared_ptr< WItemSelection > m_operations
A list of operations that are possible.
virtual void moduleMain()
Entry point after loading the 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 void properties()
Initialize the properties for this module.
std::shared_ptr< WModuleInputData< WDataSetVector > > m_inputA
Input connector required by this module.
virtual void connectors()
Initialize the connectors this module is using.
virtual const std::string getDescription() const
Gives back a description of this module.
Class representing a single module of OpenWalnut.
Definition: WModule.h:72