OpenWalnut  1.5.0dev
WMDataCreatorFibers.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 WMDATACREATORFIBERS_H
26 #define WMDATACREATORFIBERS_H
27 
28 #include <memory>
29 #include <string>
30 
31 #include "WDataSetFibersCreatorInterface.h"
32 #include "core/common/WObjectNDIP.h"
33 #include "core/common/WStrategyHelper.h"
34 #include "core/dataHandler/WDataSetFibers.h"
35 #include "core/kernel/WModule.h"
36 #include "core/kernel/WModuleOutputData.h"
37 
38 /**
39  * Module which utilizes the strategy pattern to provide a multitude of dataset creation algorithms for fiber data.
40  *
41  * \ingroup modules
42  */
44 {
45 public:
46  /**
47  * Standard constructor.
48  */
50 
51  /**
52  * Destructor.
53  */
55 
56  /**
57  * Gives back the name of this module.
58  * \return the module's name.
59  */
60  virtual const std::string getName() const;
61 
62  /**
63  * Gives back a description of this module.
64  * \return description of module.
65  */
66  virtual const std::string getDescription() const;
67 
68  /**
69  * Due to the prototype design pattern used to build modules, this method returns a new instance of this method. NOTE: it
70  * should never be initialized or modified in some other way. A simple new instance is required.
71  *
72  * \return the prototype used to create every module in OpenWalnut.
73  */
74  virtual std::shared_ptr< WModule > factory() const;
75 
76  /**
77  * Get the icon for this module in XPM format.
78  * \return The icon.
79  */
80  virtual const char** getXPMIcon() const;
81 
82 protected:
83  /**
84  * Entry point after loading the module. Runs in separate thread.
85  */
86  virtual void moduleMain();
87 
88  /**
89  * Initialize the connectors this module is using.
90  */
91  virtual void connectors();
92 
93  /**
94  * Initialize the properties for this module.
95  */
96  virtual void properties();
97 
98 private:
99  /**
100  * A condition used to notify about changes in several properties.
101  */
102  std::shared_ptr< WCondition > m_propCondition;
103 
104  std::shared_ptr< WModuleOutputData< WDataSetFibers > > m_output; //!< The only output of this module.
105 
106  /**
107  * Number of fibers.
108  */
109  WPropInt m_numFibers;
110 
111  /**
112  * Number of vertices per fiber.
113  */
115 
116  /**
117  * The seed for the random.
118  */
119  WPropInt m_seed;
120 
121  WPropBool m_timeDependent; //!< Use time dependent variation of data (experimental).
122 
123  /**
124  * Fiber color.
125  */
126  WPropColor m_fibColor;
127 
128  /**
129  * Size of the fiber bounding box.
130  */
131  WPropPosition m_size;
132 
133  /**
134  * Origin of the bounding box.
135  */
136  WPropPosition m_origin;
137 
139 };
140 
141 #endif // WMDATACREATORFIBERS_H
Module which utilizes the strategy pattern to provide a multitude of dataset creation algorithms for ...
WPropPosition m_size
Size of the fiber bounding box.
virtual void connectors()
Initialize the connectors this module is using.
WPropPosition m_origin
Origin of the bounding box.
virtual const std::string getName() const
Gives back the name of this module.
WPropInt m_numVertsPerFiber
Number of vertices per fiber.
~WMDataCreatorFibers()
Destructor.
virtual const std::string getDescription() const
Gives back a description of this module.
WPropBool m_timeDependent
Use time dependent variation of data (experimental).
WMDataCreatorFibers()
Standard constructor.
std::shared_ptr< WModuleOutputData< WDataSetFibers > > m_output
The only output of this module.
WPropInt m_numFibers
Number of fibers.
WStrategyHelper< WObjectNDIP< WDataSetFibersCreatorInterface > > m_strategy
the strategy currently active.
WPropColor m_fibColor
Fiber color.
std::shared_ptr< WCondition > m_propCondition
A condition used to notify about changes in several properties.
virtual const char ** getXPMIcon() const
Get the icon for this module in XPM format.
virtual void properties()
Initialize the properties for this module.
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...
WPropInt m_seed
The seed for the random.
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...