Commit e6990231 by Alexander Wiebel

[REFAC] extract method

parent a164568a
......@@ -219,10 +219,6 @@ void WMPickingDVR::moduleMain()
m_rootNode = osg::ref_ptr< WGEManagedGroupNode >( new WGEManagedGroupNode( m_active ) );
WKernel::getRunningKernel()->getGraphicsEngine()->getScene()->insert( m_rootNode );
//Get Camera and Register the callback
boost::shared_ptr< WGraphicsEngine > graphicsEngine = WGraphicsEngine::getGraphicsEngine();
boost::shared_ptr< WGEViewer > mainView = graphicsEngine->getViewerByName( "Main View" );
// Main loop
while( !m_shutdownFlag() )
{
......@@ -235,27 +231,7 @@ void WMPickingDVR::moduleMain()
break;
}
if( m_externalScreenPos->isConnected() == 0 )
{
if( !m_pickHandlerConnected )
{
// Register PickHandler
mainView->getPickHandler()->getPickSignal()->connect( boost::bind( &WMPickingDVR::pickHandler, this, _1 ) );
m_pickHandlerConnected = true;
}
}
else
{
if( m_pickHandlerConnected )
{
// Register PickHandler
mainView->getPickHandler()->getPickSignal()->disconnect( boost::bind( &WMPickingDVR::pickHandler, this, _1 ) );
m_pickHandlerConnected = false;
}
}
setPickPositionSource();
std::string pickingMode;
......@@ -418,6 +394,33 @@ void WMPickingDVR::pickHandler( WPickInfo pickInfo )
}
}
void WMPickingDVR::setPickPositionSource()
{
// Get Camera and Register the callback
boost::shared_ptr< WGraphicsEngine > graphicsEngine = WGraphicsEngine::getGraphicsEngine();
boost::shared_ptr< WGEViewer > mainView = graphicsEngine->getViewerByName( "Main View" );
if( m_externalScreenPos->isConnected() == 0 )
{
if( !m_pickHandlerConnected )
{
// Register PickHandler
mainView->getPickHandler()->getPickSignal()->connect( boost::bind( &WMPickingDVR::pickHandler, this, _1 ) );
m_pickHandlerConnected = true;
}
}
else
{
if( m_pickHandlerConnected )
{
// Register PickHandler
mainView->getPickHandler()->getPickSignal()->disconnect( boost::bind( &WMPickingDVR::pickHandler, this, _1 ) );
m_pickHandlerConnected = false;
}
}
}
void WMPickingDVR::updateModuleGUI( std::string pickingMode )
{
const bool picking = ( m_selectionType->get( true ).getItemIndexOfSelected( 0 ) == 0 );
......
......@@ -106,14 +106,17 @@ private:
void pickHandler( WPickInfo pickInfo );
/**
* Check if a \ref WSinglePosition is connected and dis/connects pick signal from clicking accordingly.
*/
void setPickPositionSource();
/**
* Shows and hide relevant properties according to chosen picking mode.
*
* \param pickingMode The type of picking criterion used
*/
void updateModuleGUI( std::string pickingMode );
/**
* Calculates which interval is the most visible according
* to WYSIWYP (http://dx.doi.org/10.1109/TVCG.2012.292)
......
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