Commit dce72984 authored by schurade's avatar schurade
Browse files

[FIX #440] roi tree items use the name of the roi now, roi derived from...

[FIX #440] roi tree items use the name of the roi now, roi derived from osg::Geode so simply use its getName/setName functions
parent a196de1d
......@@ -32,6 +32,7 @@
#include "algorithms/WMarchingLegoAlgorithm.h"
#include "callbacks/WGEFunctorCallback.h"
#include "WGraphicsEngine.h"
#include "WROIArbitrary.h"
......@@ -62,8 +63,7 @@ WROIArbitrary::WROIArbitrary( size_t nbCoordsX, size_t nbCoordsY, size_t nbCoord
updateGFX();
WGraphicsEngine::getGraphicsEngine()->getScene()->addChild( this );
setUserData( this );
setUpdateCallback( osg::ref_ptr<ROIArbNodeCallback>( new ROIArbNodeCallback ) );
addUpdateCallback( new WGEFunctorCallback< osg::Node >( boost::bind( &WROIArbitrary::updateGFX, this ) ) );
setDirty();
}
......@@ -91,8 +91,7 @@ WROIArbitrary::WROIArbitrary( size_t nbCoordsX, size_t nbCoordsY, size_t nbCoord
updateGFX();
WGraphicsEngine::getGraphicsEngine()->getScene()->addChild( this );
setUserData( this );
setUpdateCallback( osg::ref_ptr< ROIArbNodeCallback >( new ROIArbNodeCallback ) );
addUpdateCallback( new WGEFunctorCallback< osg::Node >( boost::bind( &WROIArbitrary::updateGFX, this ) ) );
setDirty();
}
......
......@@ -43,7 +43,7 @@ WQtRoiTreeItem* WQtBranchTreeItem::addRoiItem( osg::ref_ptr< WROI > roi )
{
WQtRoiTreeItem* rti = new WQtRoiTreeItem( this, roi, ROI );
rti->setText( 0, QString( "ROI" ) );
rti->setText( 0, QString( roi->getName().c_str() ) );
return rti;
}
......
......@@ -403,6 +403,10 @@ void WMAtlasSurfaces::cutArea( int index )
grid->getTransformationMatrix(),
*newValueSet->rawDataVectorPointer(),
1.0, wge::createColorFromIndex( index ) ) );
if ( m_labelsLoaded )
{
newRoi->setName( m_labels[index].second );
}
WKernel::getRunningKernel()->getRoiManager()->addRoi( newRoi );
}
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