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

[CHANGE] - removed registering of textures at the datahandler. This should be...

[CHANGE] - removed registering of textures at the datahandler. This should be done by a separate module in the future.
parent 58725ddf
......@@ -43,6 +43,7 @@
#include "../../dataHandler/WDataHandlerEnums.h"
#include "../../dataHandler/WDataHandler.h"
#include "../../dataHandler/exceptions/WDHValueSetMismatch.h"
#include "../../dataHandler/WDataTexture3D.h"
#include "../../kernel/WKernel.h"
#include "WMScalarOperator.xpm"
#include "WMScalarOperator.h"
......@@ -443,14 +444,8 @@ void WMScalarOperator::moduleMain()
VisitorVSetA visitor( valueSetB.get(), s ); // the visitor cascades to the second value set
boost::shared_ptr< WValueSetBase > newValueSet = valueSetA->applyFunction( visitor );
// Create the new dataset and export it as texture and on the connector
if ( m_currentResult )
{
WDataHandler::deregisterDataSet( m_currentResult );
}
m_currentResult = boost::shared_ptr<WDataSetScalar>( new WDataSetScalar( newValueSet, m_inputA->getData()->getGrid() ) );
m_output->updateData( m_currentResult );
WDataHandler::registerDataSet( m_currentResult );
// Create the new dataset and export it
m_output->updateData( boost::shared_ptr<WDataSetScalar>( new WDataSetScalar( newValueSet, m_inputA->getData()->getGrid() ) ) );
// done
prog->finish();
......
......@@ -122,8 +122,7 @@ private:
boost::shared_ptr< WModuleInputData< WDataSetScalar > > m_inputB; //!< Input connector required by this module.
boost::shared_ptr< WModuleOutputData< WDataSetScalar > > m_output; //!< The only output of this filter module.
boost::shared_ptr< WDataSetScalar > m_currentResult; //!< the last set output dataset
};
#endif // WMSCALAROPERATOR_H
......@@ -236,31 +236,10 @@ void WMSpatialDerivation::derive( boost::shared_ptr< WGridRegular3D > grid, boos
}
}
// de-register at datahandler
if ( m_lastOutputDataSet )
{
WDataHandler::deregisterDataSet( m_lastOutputDataSet );
}
boost::shared_ptr< WValueSet< double > > valueset = boost::shared_ptr< WValueSet< double > >(
new WValueSet< double >( 1, 3, vectors, W_DT_DOUBLE )
);
m_lastOutputDataSet = boost::shared_ptr< WDataSetVector >( new WDataSetVector( valueset, grid ) );
// register new
WDataHandler::registerDataSet( m_lastOutputDataSet );
m_vectorOut->updateData( m_lastOutputDataSet );
}
void WMSpatialDerivation::activate()
{
// deactivate the output if wanted
if ( m_lastOutputDataSet )
{
m_lastOutputDataSet->getTexture()->setGloballyActive( m_active->get( true ) );
}
// Always call WModule's activate!
WModule::activate();
m_vectorOut->updateData( boost::shared_ptr< WDataSetVector >( new WDataSetVector( valueset, grid ) ) );
}
......@@ -95,11 +95,6 @@ protected:
*/
virtual void properties();
/**
* Callback for m_active. Overwrite this in your modules to handle m_active changes separately.
*/
virtual void activate();
private:
/**
......@@ -112,11 +107,6 @@ private:
*/
boost::shared_ptr< WModuleOutputData< WDataSetVector > > m_vectorOut;
/**
* The last created output. Needed for de-registering at data handler
*/
boost::shared_ptr< WDataSetVector > m_lastOutputDataSet;
/**
* A condition used to notify about changes in several properties.
*/
......
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