OpenWalnut  1.5.0dev
WMTransferFunction1D.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 WMTRANSFERFUNCTION1D_H
26 #define WMTRANSFERFUNCTION1D_H
27 
28 #include <memory>
29 #include <string>
30 
31 #include <osg/Geode>
32 
33 #include "core/kernel/WModule.h"
34 #include "core/kernel/WModuleInputData.h"
35 #include "core/kernel/WModuleOutputData.h"
36 
37 /**
38  * A module to provide 1D transfer functions, e.g., for volume rendering.
39  *
40  * \ingroup modules
41  */
43 {
44 public:
45  /**
46  *
47  */
49 
50  /**
51  *
52  */
53  virtual ~WMTransferFunction1D();
54 
55  /**
56  * Gives back the name of this module.
57  * \return the module's name.
58  */
59  virtual const std::string getName() const;
60 
61  /**
62  * Gives back a description of this module.
63  * \return description to module.
64  */
65  virtual const std::string getDescription() const;
66 
67  /**
68  * Due to the prototype design pattern used to build modules, this method returns a new instance of this method. NOTE: it
69  * should never be initialized or modified in some other way. A simple new instance is required.
70  *
71  * \return the prototype used to create every module in OpenWalnut.
72  */
73  virtual std::shared_ptr< WModule > factory() const;
74 
75  /**
76  * Get the icon for this module in XPM format.
77  *
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  /**
99  * Initialize requirements for this module.
100  */
101  virtual void requirements();
102 
103 
104 private:
105  /**
106  * An input connector used to get datasets from other modules. The connection management between co
107 nnectors must not be handled by the module.
108  */
110 
111  /**
112  * The output connector used to provide the calculated data to other modules.
113  */
115 
116  /**
117  * A condition used to notify about changes in several properties.
118  */
119  std::shared_ptr< WCondition > m_propCondition;
120 
121  /**
122  * Resolution of the transfer function.
123  */
124  WPropInt m_resolution;
125 
126  /**
127  * Histogram bin size
128  */
129  WPropDouble m_opacityScale;
130 
131  /**
132  * Histogram bin size
133  */
134  WPropInt m_binSize;
135 
136  /**
137  * The transfer function property
138  */
139  WPropTransferFunction m_transferFunction;
140 };
141 
142 #endif // WMTRANSFERFUNCTION1D_H
A module to provide 1D transfer functions, e.g., for volume rendering.
virtual void connectors()
Initialize the connectors this module is using.
virtual void requirements()
Initialize requirements for this module.
WPropTransferFunction m_transferFunction
The transfer function property.
virtual const std::string getDescription() const
Gives back a description of this module.
virtual void properties()
Initialize the properties for this module.
WPropInt m_binSize
Histogram bin size.
WPropDouble m_opacityScale
Histogram bin size.
WModuleOutputData< WDataSetSingle >::SPtr m_output
The output connector used to provide the calculated data to other modules.
virtual void moduleMain()
Entry point after loading the module.
WPropInt m_resolution
Resolution of the transfer function.
WModuleInputData< WDataSetSingle >::SPtr m_input
virtual const std::string getName() const
Gives back the name of 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...
virtual const char ** getXPMIcon() const
Get the icon for this module in XPM format.
std::shared_ptr< WCondition > m_propCondition
A condition used to notify about changes in several properties.
Class offering an instantiate-able data connection between modules.
Class offering an instantiate-able data connection between modules.
Class representing a single module of OpenWalnut.
Definition: WModule.h:72