Commit 066a2a37 authored by Alexander Wiebel's avatar Alexander Wiebel
Browse files

[FIX #398] adapted EEGView to new ROI infrastructure. Thus it is available

again.
parent 080bd7be
......@@ -288,22 +288,21 @@ void WMEEGView::moduleMain()
{
debugLog() << "New event position: " << event->getTime();
if( boost::shared_ptr< WRMROIRepresentation > roi = m_roi.lock() )
if( m_roi )
{
WKernel::getRunningKernel()->getRoiManager()->removeRoi( roi );
WKernel::getRunningKernel()->getRoiManager()->removeRoi( m_roi );
}
if( WKernel::getRunningKernel()->getRoiManager()->getBitField() && m_sourceCalculator )
if( m_sourceCalculator )
{
wmath::WPosition position = m_sourceCalculator->calculate( event );
m_roi = WKernel::getRunningKernel()->getRoiManager()->addRoi( new WROIBox(
position - wmath::WVector3D( 5.0, 5.0, 5.0 ),
position + wmath::WVector3D( 5.0, 5.0, 5.0 ) ) );
m_roi = new WROIBox( position - wmath::WVector3D( 5.0, 5.0, 5.0 ),
position + wmath::WVector3D( 5.0, 5.0, 5.0 ) );
WKernel::getRunningKernel()->getRoiManager()->addRoi( m_roi );
}
else
{
m_roi.reset();
m_roi.release();
}
m_currentEventTime = event->getTime();
......@@ -600,7 +599,7 @@ osg::ref_ptr< osg::Node > WMEEGView::drawElectrodes()
boost::shared_ptr< WEEGChannelInfo > channelInfo = m_eeg->getChannelInfo( channelID );
try
{
osg::Vec3 pos = wge::osgVec3( channelInfo->getPosition() );
osg::Vec3 pos = channelInfo->getPosition();
// create sphere geode on electrode position
osg::ShapeDrawable* shape = new osg::ShapeDrawable( new osg::Sphere( pos, sphereSize ) );
......@@ -687,7 +686,7 @@ osg::ref_ptr< osg::Node > WMEEGView::drawLabels()
boost::shared_ptr< WEEGChannelInfo > channelInfo = m_eeg->getChannelInfo( channelID );
try
{
osg::Vec3 pos = wge::osgVec3( channelInfo->getPosition() );
osg::Vec3 pos = channelInfo->getPosition();
// create text geode for the channel label
osgText::Text* text = new osgText::Text;
......
......@@ -33,10 +33,11 @@
#include "../../dataHandler/WEEG2.h"
#include "../../graphicsEngine/WGEGroupNode.h"
#include "../../graphicsEngine/WROIBox.h"
#include "../../gui/WCustomWidget.h"
#include "../../kernel/WModule.h"
#include "../../kernel/WModuleInputData.h"
#include "../../kernel/modules/fiberDisplay/WRMROIRepresentation.h"
#include "../../kernel/WFiberSelector.h"
#include "WEEGEvent.h"
#include "WEEGSourceCalculator.h"
#include "WEEGViewHandler.h"
......@@ -235,7 +236,7 @@ private:
* m_event.
* Used to select the fibers around this dipole.
*/
boost::weak_ptr< WRMROIRepresentation > m_roi;
osg::ref_ptr< WROIBox > m_roi;
/**
* Bool flag which gets set when the data was changed.
......
# TODO(all): please enable this module again when ported to new ROI infrastructure.
#ADD_SUBDIRECTORY( eegView )
ADD_SUBDIRECTORY( eegView )
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