Commit d8ae0784 by schurade

[ADD] use active flag for arbitrary rois

parent cf91e8b6
......@@ -161,6 +161,11 @@ void WMArbitraryRois::initSelectionRoi()
void WMArbitraryRois::createCutDataset()
{
if( !m_active->get() )
{
return;
}
boost::shared_ptr< WValueSetBase > newValueSet;
boost::shared_ptr< WGridRegular3D > grid = boost::shared_dynamic_cast< WGridRegular3D >( m_dataSet->getGrid() );
......@@ -321,6 +326,11 @@ void WMArbitraryRois::renderMesh()
void WMArbitraryRois::finalizeRoi()
{
if( !m_active->get() )
{
return;
}
if( !WKernel::getRunningKernel()->getRoiManager()->getBitField() )
{
wlog::warn( "WMArbitraryRois" ) << "Refused to add ROI, as ROIManager does not have computed its bitfield yet.";
......@@ -337,3 +347,20 @@ void WMArbitraryRois::finalizeRoi()
WKernel::getRunningKernel()->getRoiManager()->addRoi( newRoi, WKernel::getRunningKernel()->getRoiManager()->getSelectedRoi()->getROI() );
}
}
void WMArbitraryRois::activate()
{
if( m_selectionRoi )
{
if( m_active->get() )
{
m_selectionRoi->setNodeMask( 0xFFFFFFFF );
}
else
{
m_selectionRoi->setNodeMask( 0x0 );
}
}
WModule::activate();
}
......@@ -103,6 +103,10 @@ protected:
*/
virtual void properties();
/**
* Callback for m_active. Overwrite this in your modules to handle m_active changes separately.
*/
virtual void activate();
private:
/**
......
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