Commit 425325fa authored by Sebastian Eichelbaum's avatar Sebastian Eichelbaum
Browse files

[MERGE]

parents 3b49df9f 8543fd54
......@@ -28,6 +28,7 @@
#include <vector>
#include "WMDistanceMap.h"
#include "distancemap.xpm"
#include "../../kernel/WKernel.h"
#include "../../kernel/WModuleFactory.h"
......@@ -54,6 +55,12 @@ boost::shared_ptr< WModule > WMDistanceMap::factory() const
return boost::shared_ptr< WModule >( new WMDistanceMap() );
}
const char** WMDistanceMap::getXPMIcon() const
{
return distancemap_xpm;
}
const std::string WMDistanceMap::getName() const
{
return "Distance Map";
......
......@@ -75,6 +75,12 @@ public:
*/
virtual boost::shared_ptr< WModule > factory() const;
/**
* Get the icon for this module in XPM format.
*/
virtual const char** getXPMIcon() const;
protected:
/**
* Entry point after loading the module. Runs in separate thread.
......
......@@ -29,7 +29,7 @@
#include "WMDistanceMap.h"
#include "WMDistanceMapIsosurface.h"
#include "distancemap.xpm"
#include "distancemapIsosurface.xpm"
#include "../../kernel/WKernel.h"
#include "../../kernel/WModuleFactory.h"
......@@ -63,7 +63,7 @@ boost::shared_ptr< WModule > WMDistanceMapIsosurface::factory() const
const char** WMDistanceMapIsosurface::getXPMIcon() const
{
return distancemap_xpm;
return distancemapIsosurface_xpm;
}
void WMDistanceMapIsosurface::moduleMain()
......@@ -80,9 +80,17 @@ void WMDistanceMapIsosurface::moduleMain()
// now wait for it to be ready
m_marchingCubesModule->isReady().wait();
m_marchingCubesModule->getProperties()->findProp( "Iso Value" )->setValue< float >( 0.5 );
m_properties->addProperty( m_marchingCubesModule->getProperties()->findProp( "active" ) );
m_properties->addProperty( m_marchingCubesModule->getProperties()->findProp( "Iso Value" ) );
boost::shared_ptr< WProperties2 > mcProps = m_marchingCubesModule->getProperties2();
m_isoValueProp = mcProps->getProperty( "Iso Value" )->toPropDouble();
m_isoValueProp->set( 0.5 );
m_isoValueProp->setMin( 0.0 );
m_isoValueProp->setMax( 1.0 );
m_properties2->addProperty( m_isoValueProp );
m_useTextureProp = mcProps->getProperty( "Use Texture" )->toPropBool();
m_useTextureProp->set( true );
m_properties2->addProperty( m_useTextureProp );
//////////////////////////////////////////////////////////////////////////////////
// Distance Map
......@@ -164,7 +172,8 @@ void WMDistanceMapIsosurface::properties()
{
}
void WMDistanceMapIsosurface::slotPropertyChanged( std::string /*propertyName*/ )
void WMDistanceMapIsosurface::activate()
{
m_marchingCubesModule->getProperties2()->getProperty( "active" )->toPropBool()->set( m_active->get() );
}
......@@ -68,13 +68,6 @@ public:
*/
virtual const char** getXPMIcon() const;
/**
* Determine what to do if a property was changed.
* \param propertyName Name of the property.
*/
void slotPropertyChanged( std::string propertyName );
protected:
/**
* Entry point after loading the module. Runs in separate thread.
......@@ -91,8 +84,16 @@ protected:
*/
virtual void properties();
/**
* Callback for m_active. Overwrite this in your modules to handle m_active changes separately.
*/
virtual void activate();
private:
WPropDouble m_isoValueProp; //!< Property holding the value for the distance.
WPropBool m_useTextureProp; //!< Property indicating whether to use texturing with scalar data sets.
/**
* The description of the module. This is used for the container.
*/
......
src/modules/distanceMap/distancemap.png

10.1 KB | W: | H:

src/modules/distanceMap/distancemap.png

13.3 KB | W: | H:

src/modules/distanceMap/distancemap.png
src/modules/distanceMap/distancemap.png
src/modules/distanceMap/distancemap.png
src/modules/distanceMap/distancemap.png
  • 2-up
  • Swipe
  • Onion skin
This diff is collapsed.
This diff is collapsed.
......@@ -175,38 +175,23 @@ void WMMarchingCubes::connectors()
void WMMarchingCubes::properties()
{
// {
// // If set in config file use standard isovalue from config file
// double tmpIsoValue;
// if( WPreferences::getPreference( "modules.MC.isoValue", &tmpIsoValue ) )
// {
// m_properties->addDouble( "Iso Value", tmpIsoValue )->connect( boost::bind( &WMMarchingCubes::slotPropertyChanged, this, _1 ) );
// }
// else
// {
// m_properties->addDouble( "Iso Value", m_tIsoLevel )->connect( boost::bind( &WMMarchingCubes::slotPropertyChanged, this, _1 ) );
// }
// }
m_isoValueProp = m_properties2->addProperty( "Iso Value", "The surface will show the area that has this value.", 100., m_recompute );
m_isoValueProp->setMin( wlimits::MIN_DOUBLE );
m_isoValueProp->setMax( wlimits::MAX_DOUBLE );
{
// If set in config file use standard isovalue from config file
double tmpIsoValue;
if( WPreferences::getPreference( "modules.MC.isoValue", &tmpIsoValue ) )
{
m_isoValueProp->set( tmpIsoValue );
}
}
m_opacityProp = m_properties2->addProperty( "Opacity %", "Opaqueness of surface.", 100 );
m_opacityProp->setMin( 0 );
m_opacityProp->setMax( 100 );
m_useTextureProp = m_properties2->addProperty( "Use Texture", "Use texturing of the surface?", false );
}
void WMMarchingCubes::slotPropertyChanged( std::string propertyName )
{
if( propertyName == "active" )
{
}
else
{
std::cout << propertyName << std::endl;
assert( 0 && "This property name is not supported by this function yet." );
}
m_useTextureProp = m_properties2->addProperty( "Use Texture", "Use texturing of the surface?", false );
}
void WMMarchingCubes::generateSurfacePre( double isoValue )
......
......@@ -121,12 +121,6 @@ public:
*/
virtual const std::string getDescription() const;
/**
* Determine what to do if a property was changed.
* \param propertyName Name of the property.
*/
void slotPropertyChanged( std::string propertyName );
/**
* Due to the prototype design pattern used to build modules, this method returns a new instance of this method. NOTE: it
* should never be initialized or modified in some other way. A simple new instance is required.
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment