OpenWalnut  1.5.0dev
WMDataCreatorScalar.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 WMDATACREATORSCALAR_H
26 #define WMDATACREATORSCALAR_H
27 
28 #include <memory>
29 #include <string>
30 
31 #include "WDataSetSingleCreatorInterface.h"
32 #include "core/common/WObjectNDIP.h"
33 #include "core/common/WStrategyHelper.h"
34 #include "core/dataHandler/WDataHandlerEnums.h"
35 #include "core/dataHandler/WDataSetScalar.h"
36 #include "core/dataHandler/WValueSetBase.h"
37 #include "core/kernel/WModule.h"
38 #include "core/kernel/WModuleOutputData.h"
39 
40 /**
41  * Module which utilizes the strategy pattern to provide a multitude of dataset creation algorithms for scalar data.
42  *
43  * \ingroup modules
44  */
46 {
47 public:
48  /**
49  * Standard constructor.
50  */
52 
53  /**
54  * Destructor.
55  */
57 
58  /**
59  * Gives back the name of this module.
60  * \return the module's name.
61  */
62  virtual const std::string getName() const;
63 
64  /**
65  * Gives back a description of this module.
66  * \return description of module.
67  */
68  virtual const std::string getDescription() const;
69 
70  /**
71  * Due to the prototype design pattern used to build modules, this method returns a new instance of this method. NOTE: it
72  * should never be initialized or modified in some other way. A simple new instance is required.
73  *
74  * \return the prototype used to create every module in OpenWalnut.
75  */
76  virtual std::shared_ptr< WModule > factory() const;
77 
78  /**
79  * Get the icon for this module in XPM format.
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 private:
101  /**
102  * A condition used to notify about changes in several properties.
103  */
104  std::shared_ptr< WCondition > m_propCondition;
105 
106  std::shared_ptr< WModuleOutputData< WDataSetScalar > > m_output; //!< The only output of this module.
107 
108  WPropInt m_nbVoxelsX; //!< number of voxels in x direction
109  WPropInt m_nbVoxelsY; //!< number of voxels in y direction
110  WPropInt m_nbVoxelsZ; //!< number of voxels in z direction
111 
112  WPropPosition m_origin; //!< where to put the origin
113  WPropPosition m_size; //!< where to put the origin
114 
115  WPropBool m_timeDependent; //!< Use time dependent variation of data (experimental).
116 
117  WPropSelection m_valueType; //!< the datatype of the valueset
118  WPropSelection m_structuralType; //!< select between scalar, vector and other structural types
119 
121 };
122 
123 #endif // WMDATACREATORSCALAR_H
Module which utilizes the strategy pattern to provide a multitude of dataset creation algorithms for ...
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 moduleMain()
Entry point after loading the module.
WMDataCreatorScalar()
Standard constructor.
virtual void properties()
Initialize the properties for this module.
virtual const std::string getDescription() const
Gives back a description of this module.
WPropPosition m_size
where to put the origin
WPropInt m_nbVoxelsY
number of voxels in y direction
WPropBool m_timeDependent
Use time dependent variation of data (experimental).
virtual const char ** getXPMIcon() const
Get the icon for this module in XPM format.
WPropInt m_nbVoxelsZ
number of voxels in z direction
std::shared_ptr< WModuleOutputData< WDataSetScalar > > m_output
The only output of this 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.
WStrategyHelper< WObjectNDIP< WDataSetSingleCreatorInterface > > m_strategy
the strategy currently active.
WPropSelection m_structuralType
select between scalar, vector and other structural types
virtual const std::string getName() const
Gives back the name of this module.
WPropPosition m_origin
where to put the origin
WPropInt m_nbVoxelsX
number of voxels in x direction
WPropSelection m_valueType
the datatype of the valueset
~WMDataCreatorScalar()
Destructor.
Class representing a single module of OpenWalnut.
Definition: WModule.h:72
This class allows for an easy strategy pattern-based switching between properties and strategy instan...