| 237 | | osgUtil::PolytopeIntersector::Intersections& intersections = picker->getIntersections(); |
| 238 | | |
| 239 | | for (osgUtil::PolytopeIntersector::Intersections::iterator it=intersections.begin(); |
| 240 | | it!=intersections.end(); ++it) { |
| 241 | | osgUtil::PolytopeIntersector::Intersection intersection=*it; |
| 242 | | |
| 243 | | osg::NodePath& nodePath = intersection.nodePath; |
| 244 | | node = (nodePath.size()>=1)?nodePath[nodePath.size()-1]:0; |
| 245 | | parent = (nodePath.size()>=2)?dynamic_cast<osg::Group*>(nodePath[nodePath.size()-2]):0; |
| 246 | | |
| 247 | | if (node) std::cout<<" Hits "<<node->className()<<" nodePath size"<<nodePath.size()<<std::endl; |
| 248 | | toggleScribe(parent, node); |
| 249 | | } |
| 250 | | |
| | 237 | osgUtil::PolytopeIntersector::Intersection intersection = picker->getFirstIntersection(); |
| | 238 | |
| | 239 | osg::notify(osg::NOTICE)<<"Picked "<<intersection.localIntersectionPoint<<std::endl |
| | 240 | <<" Distance to ref. plane "<<intersection.distance |
| | 241 | <<", max. dist "<<intersection.maxDistance |
| | 242 | <<", primitive index "<<intersection.primitiveIndex |
| | 243 | <<", numIntersectionPoints " |
| | 244 | <<intersection.numIntersectionPoints |
| | 245 | <<std::endl; |
| | 246 | |
| | 247 | osg::NodePath& nodePath = intersection.nodePath; |
| | 248 | node = (nodePath.size()>=1)?nodePath[nodePath.size()-1]:0; |
| | 249 | parent = (nodePath.size()>=2)?dynamic_cast<osg::Group*>(nodePath[nodePath.size()-2]):0; |
| | 250 | |
| | 251 | if (node) std::cout<<" Hits "<<node->className()<<" nodePath size "<<nodePath.size()<<std::endl; |
| | 252 | toggleScribe(parent, node); |