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

[CHANGE] refactored some code into separate function

parent 75a5a032
......@@ -162,6 +162,19 @@ std::string extractSuitableName( osgUtil::LineSegmentIntersector::Intersections:
return ""; // This line will not be reached.
}
void WPickHandler::updatePickInfoModifierKeys( WPickInfo* pickInfo )
{
if( m_shift )
{
pickInfo->setModifierKey( WPickInfo::SHIFT );
}
if ( m_ctrl )
{
pickInfo->setModifierKey( WPickInfo::STRG );
}
}
void WPickHandler::pick( osgViewer::View* view, const osgGA::GUIEventAdapter& ea )
{
osgUtil::LineSegmentIntersector::Intersections intersections;
......@@ -171,15 +184,7 @@ void WPickHandler::pick( osgViewer::View* view, const osgGA::GUIEventAdapter& ea
WPickInfo pickInfo;
if( m_shift )
{
pickInfo.setModifierKey( WPickInfo::SHIFT );
}
if ( m_ctrl )
{
pickInfo.setModifierKey( WPickInfo::STRG );
}
updatePickInfoModifierKeys( &pickInfo );
// if we are in another viewer than the main view we just need the pixel position
if ( m_viewerName != "" && m_viewerName != "main" )
......
......@@ -128,7 +128,14 @@ protected:
private:
boost::signals2::signal1<void, WPickInfo > m_pickSignal; //!< One can register to this signal to receive pick events.
/**
* Sets the current modifiers to the provided pickInfo
*
* \param pickInfo This pickInfo will be updated.
*/
void updatePickInfoModifierKeys( WPickInfo* pickInfo );
boost::signals2::signal1< void, WPickInfo > m_pickSignal; //!< One can register to this signal to receive pick events.
};
#endif // WPICKHANDLER_H
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