Commit c3a7ae8d authored by Alexander Wiebel's avatar Alexander Wiebel
Browse files

[FIX] do not add ROI although button is pressed if ROIManager has no attached

fiber dataset. This should fix unwanted crashes.
parent 05291f7b
......@@ -558,6 +558,13 @@ void WMainWindow::slotActivateModule( QString module )
void WMainWindow::newRoi()
{
// do nothing if we can not get
if( !WKernel::getRunningKernel()->getRoiManager()->getDataSet() )
{
wlog::warn( "WMainWindow" ) << "Refused to add ROI, as ROIManager does not have data set associated.";
return;
}
if ( m_datasetBrowser->getSelectedRoi().get() == NULL )
{
boost::shared_ptr< WROIBox > newRoi = boost::shared_ptr< WROIBox >( new WROIBox( wmath::WPosition( 60., 60., 60. ),
......
......@@ -101,6 +101,7 @@ void WROIManagerFibers::addFiberDataset( boost::shared_ptr< const WDataSetFibers
void WROIManagerFibers::removeFiberDataset( boost::shared_ptr< const WDataSetFibers > /*fibers*/ )
{
assert( 0 && "removeFiberDataset( --- ) not implemented yet." );
}
boost::shared_ptr< std::vector< bool > > WROIManagerFibers::getBitField()
......@@ -147,6 +148,7 @@ void WROIManagerFibers::recalculate()
{
mbf = m_bitField;
}
int size = mbf->size();
mbf->clear();
......
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