Commit 86394df2 authored by Sebastian Eichelbaum's avatar Sebastian Eichelbaum
Browse files

[FIX #252] changed nodemask in the pick handler to avoid very slow picking of the tube-mode quads

parent 5b2eeb73
...@@ -242,7 +242,7 @@ void WPickHandler::pick( osgViewer::View* view, const osgGA::GUIEventAdapter& ea ...@@ -242,7 +242,7 @@ void WPickHandler::pick( osgViewer::View* view, const osgGA::GUIEventAdapter& ea
return; return;
} }
bool intersetionsExist = view->computeIntersections( x, y, intersections ); bool intersetionsExist = view->computeIntersections( x, y, intersections, 0xFFFFFFF0 );
// if something is picked, get the right thing from the list, because it might be hidden. // if something is picked, get the right thing from the list, because it might be hidden.
bool startPickIsStillInList = false; bool startPickIsStillInList = false;
......
...@@ -389,8 +389,13 @@ void WMFiberDisplay::moduleMain() ...@@ -389,8 +389,13 @@ void WMFiberDisplay::moduleMain()
// create the fiber geode // create the fiber geode
osg::ref_ptr< osg::Geode > geode = new osg::Geode(); osg::ref_ptr< osg::Geode > geode = new osg::Geode();
osg::ref_ptr< osg::Geode > endCapGeode = new osg::Geode(); osg::ref_ptr< osg::Geode > endCapGeode = new osg::Geode();
// this avoids that the pick handler tries to pick in millions if lines and quads
geode->setName( "_Line Geode" ); geode->setName( "_Line Geode" );
endCapGeode->setName( "_Tube Cap Geode" ); endCapGeode->setName( "_Tube Cap Geode" );
geode->setNodeMask( 0x0000000F );
endCapGeode->setNodeMask( 0x0000000F );
createFiberGeode( fibers, geode, endCapGeode ); createFiberGeode( fibers, geode, endCapGeode );
// Apply the shader. This is for clipping. // Apply the shader. This is for clipping.
...@@ -721,8 +726,6 @@ void WMFiberDisplay::createFiberGeode( boost::shared_ptr< WDataSetFibers > fiber ...@@ -721,8 +726,6 @@ void WMFiberDisplay::createFiberGeode( boost::shared_ptr< WDataSetFibers > fiber
void WMFiberDisplay::geometryUpdate( osg::Drawable* geometry ) void WMFiberDisplay::geometryUpdate( osg::Drawable* geometry )
{ {
osg::Geometry* g = static_cast< osg::Geometry* >( geometry );
if( m_fiberSelectorChanged ) if( m_fiberSelectorChanged )
{ {
m_fiberSelectorChanged = false; m_fiberSelectorChanged = false;
...@@ -765,7 +768,7 @@ void WMFiberDisplay::geometryUpdate( osg::Drawable* geometry ) ...@@ -765,7 +768,7 @@ void WMFiberDisplay::geometryUpdate( osg::Drawable* geometry )
); );
} }
} }
g->setSecondaryColorArray( attribs ); static_cast< osg::Geometry* >( geometry )->setSecondaryColorArray( attribs );
} }
} }
......
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