~ubuntu-branches/ubuntu/trusty/openscenegraph/trusty

« back to all changes in this revision

Viewing changes to OpenSceneGraph/examples/osglauncher/osglauncher.cpp

  • Committer: Package Import Robot
  • Author(s): Dmitrijs Ledkovs
  • Date: 2013-11-12 02:21:14 UTC
  • mfrom: (31.1.3 trusty-proposed)
  • Revision ID: package-import@ubuntu.com-20131112022114-qaxfhdnhn88vnh10
Tags: 3.2.0~rc1-1ubuntu1
Fix deprecated url_feof.

Show diffs side-by-side

added added

removed removed

Lines of Context:
63
63
    
64
64
    bool handle(const osgGA::GUIEventAdapter& ea,osgGA::GUIActionAdapter& us);
65
65
 
66
 
    std::string pick(float x, float y);
 
66
    std::string pick(const osgGA::GUIEventAdapter& event);
67
67
    
68
68
    void highlight(const std::string& name)
69
69
    {
83
83
    case(osgGA::GUIEventAdapter::FRAME):
84
84
    case(osgGA::GUIEventAdapter::MOVE):
85
85
    {
86
 
        //osg::notify(osg::NOTICE)<<"MOVE "<<ea.getX()<<ea.getY()<<std::endl;
87
 
        std::string picked_name = pick(ea.getX(),ea.getY());
 
86
        // osg::notify(osg::NOTICE)<<"MOVE "<<ea.getX()<<", "<<ea.getY()<<std::endl;
 
87
        std::string picked_name = pick(ea);
88
88
        highlight(picked_name);
89
89
        return false;
90
90
    }
91
91
    case(osgGA::GUIEventAdapter::PUSH):
92
92
    {
93
 
        //osg::notify(osg::NOTICE)<<"PUSH "<<ea.getX()<<ea.getY()<<std::endl;
94
 
        std::string picked_name = pick(ea.getX(),ea.getY());
 
93
        // osg::notify(osg::NOTICE)<<"PUSH "<<ea.getX()<<", "<<ea.getY()<<std::endl;
 
94
        std::string picked_name = pick(ea);
95
95
        if (!picked_name.empty())
96
96
        {
97
97
            runApp(picked_name);
108
108
}
109
109
 
110
110
 
111
 
std::string PickHandler::pick(float x, float y)
 
111
std::string PickHandler::pick(const osgGA::GUIEventAdapter& event)
112
112
{
113
113
    osgUtil::LineSegmentIntersector::Intersections intersections;
114
 
    if (_viewer->computeIntersections(x, y, intersections))
 
114
    if (_viewer->computeIntersections(event, intersections))
115
115
    {
116
116
        for(osgUtil::LineSegmentIntersector::Intersections::iterator hitr = intersections.begin();
117
117
            hitr != intersections.end();