OpenWalnut  1.5.0dev
WMDistanceMapIsosurface.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 WMDISTANCEMAPISOSURFACE_H
26 #define WMDISTANCEMAPISOSURFACE_H
27 
28 #include <memory>
29 
30 
31 #include "core/dataHandler/WDataSetScalar.h"
32 #include "core/kernel/WModule.h"
33 #include "core/kernel/WModuleContainer.h"
34 #include "core/kernel/WModuleInputForwardData.h"
35 #include "core/kernel/WModuleOutputForwardData.h"
36 
37 /**
38  * Computes a distance map from an anatomy dataset and renders it as isosurface. It is a composition of isosurface and the
39  * distance map module.
40  * \ingroup modules
41  */
43 {
44 /**
45  * Only UnitTests may be friends.
46  */
48 
49 public:
50  /**
51  * Standard constructor.
52  */
54 
55  /**
56  * Destructor.
57  */
59 
60  /**
61  * Due to the prototype design pattern used to build modules, this method returns a new instance of this method. NOTE: it
62  * should never be initialized or modified in some other way. A simple new instance is required.
63  *
64  * \return the prototype used to create every module in OpenWalnut.
65  */
66  virtual std::shared_ptr< WModule > factory() const;
67 
68  /**
69  * Get the icon for this module in XPM format.
70  * \return The icon.
71  */
72  virtual const char** getXPMIcon() const;
73 
74 protected:
75  /**
76  * Entry point after loading the module. Runs in separate thread.
77  */
78  virtual void moduleMain();
79 
80  /**
81  * Initialize the connectors this module is using.
82  */
83  virtual void connectors();
84 
85  /**
86  * Initialize requirements for this module.
87  */
88  virtual void requirements();
89 
90  /**
91  * Callback for m_active. Overwrite this in your modules to handle m_active changes separately.
92  */
93  virtual void activate();
94 
95 private:
96  WPropDouble m_isoValueProp; //!< Property holding the value for the distance.
97  WPropInt m_opacityProp; //!< Property holding the value for the opacity of the surface.
98  WPropBool m_useTextureProp; //!< Property indicating whether to use texturing with scalar data sets.
99  WPropColor m_surfaceColorProp; //!< Property indicating which color to use for non-textured surface.
100 
101  std::shared_ptr< WModuleInputForwardData< WDataSetScalar > > m_input; //!< Input connector required by this module.
102  std::shared_ptr< WModuleOutputForwardData< WDataSetScalar > > m_output; //!< Connector to provide the distance map to other modules.
103 
104  std::shared_ptr< WModule > m_isosurfaceModule; //!< The isosurface module used in this container.
105  std::shared_ptr< WModule > m_distanceMapModule; //!< The distance map module used in this container.
106 };
107 
108 #endif // WMDISTANCEMAPISOSURFACE_H
Computes a distance map from an anatomy dataset and renders it as isosurface.
std::shared_ptr< WModuleOutputForwardData< WDataSetScalar > > m_output
Connector to provide the distance map to other modules.
std::shared_ptr< WModuleInputForwardData< WDataSetScalar > > m_input
Input connector required by this module.
virtual void activate()
Callback for m_active.
WPropColor m_surfaceColorProp
Property indicating which color to use for non-textured surface.
std::shared_ptr< WModule > m_isosurfaceModule
The isosurface module used in this container.
virtual void connectors()
Initialize the connectors this module is using.
WMDistanceMapIsosurface()
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...
WPropInt m_opacityProp
Property holding the value for the opacity of the surface.
virtual const char ** getXPMIcon() const
Get the icon for this module in XPM format.
WPropDouble m_isoValueProp
Property holding the value for the distance.
virtual void requirements()
Initialize requirements for this module.
std::shared_ptr< WModule > m_distanceMapModule
The distance map module used in this container.
virtual void moduleMain()
Entry point after loading the module.
friend class WMDistanceMapIsosurfaceTest
Only UnitTests may be friends.
WPropBool m_useTextureProp
Property indicating whether to use texturing with scalar data sets.
Class able to contain other modules.