Commit d3cdea5c authored by Sebastian Eichelbaum's avatar Sebastian Eichelbaum
Browse files

[CHANGE] - marching cubes now uses conditions to notify main thread about...

[CHANGE] - marching cubes now uses conditions to notify main thread about property change instead of calculating the surface in slotPropertyChanged
parent 8aaa8d56
......@@ -60,7 +60,6 @@ WModuleConnector::WModuleConnector( boost::shared_ptr<WModule> module, std::stri
signal_ConnectionEstablished.connect( getSignalHandler( CONNECTION_ESTABLISHED ) );
signal_ConnectionClosed.connect( getSignalHandler( CONNECTION_CLOSED ) );
}
WModuleConnector::~WModuleConnector()
......
......@@ -312,7 +312,8 @@ protected:
boost::shared_ptr< WModuleConnector > output )
{
// just copy the data and add one
boost::shared_ptr< WModuleOutputData< WTestTransferableBase > > o = boost::shared_dynamic_cast< WModuleOutputData< WTestTransferableBase > >( output );
boost::shared_ptr< WModuleOutputData< WTestTransferableBase > > o =
boost::shared_dynamic_cast< WModuleOutputData< WTestTransferableBase > >( output );
if ( !o.get() )
{
return;
......
......@@ -56,6 +56,7 @@
WMMarchingCubes::WMMarchingCubes():
WModule(),
m_propertiesChanged( boost::shared_ptr< WCondition >( new WCondition() ) ),
m_nCellsX( 0 ),
m_nCellsY( 0 ),
m_nCellsZ( 0 ),
......@@ -103,6 +104,7 @@ void WMMarchingCubes::moduleMain()
// use the m_input "data changed" flag
m_moduleState.setResetable( true, true );
m_moduleState.add( m_input->getDataChangedCondition() );
m_moduleState.add( m_propertiesChanged );
// signal ready state
ready();
......@@ -186,11 +188,7 @@ void WMMarchingCubes::slotPropertyChanged( std::string propertyName )
{
if( propertyName == "Iso Value" )
{
double isoValue = m_properties->getValue< double >( propertyName );
debugLog() << "Update isosurface for isovalue: " << isoValue << std::endl;
//generateSurfacePre( isoValue );
//renderSurface();
debugLog() << "Updating done." << std::endl;
m_propertiesChanged->notify();
}
else if( propertyName == "Use Texture" )
{
......@@ -225,7 +223,7 @@ void WMMarchingCubes::slotPropertyChanged( std::string propertyName )
void WMMarchingCubes::generateSurfacePre( double isoValue )
{
debugLog() << "Isovalue: " << isoValue << std::endl;
debugLog() << "Isovalue: " << isoValue;
switch( (*m_dataSet).getValueSet()->getDataType() )
{
case W_DT_UNSIGNED_CHAR:
......
......@@ -171,6 +171,11 @@ protected:
private:
/**
* This condition denotes whether the properties have changed.
*/
boost::shared_ptr< WCondition > m_propertiesChanged;
/**
* Prepares and commits everything for rendering with the OSG
* \param mesh The mesh that will be rendered.
......
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