|
bool CLabelControlEventHandler::handle(const osgGA::GUIEventAdapter& ea,osgGA::GUIActionAdapter& aa)
{
osgViewer::Viewer *viewer = dynamic_cast<osgViewer::Viewer*> (&aa);
if(viewer)
{
if(ea.getEventType() == ea.MOVE || ea.getEventType() == ea.DRAG)
{
osgUtil:ineSegmentIntersector::Intersections inters1;
osg::Vec3d m_TempPoint1;
osg::Vec3d lla;
osgEarth::GeoPoint ConvertPoint;
osgEarth::SpatialReference* m_pGeoSRS = 0;
if(viewer->computeIntersections(ea.getX(),ea.getY(),inters1))
{
osgUtil::LineSegmentIntersector::Intersections::iterator iter1 = inters1.begin();
m_TempPoint1.set(iter1->getWorldIntersectPoint().x(),iter1->getWorldIntersectPoint().y(),iter1->getWorldIntersectPoint().z());
m_pGeoSRS->getGeographicSRS();
ConvertPoint.fromWorld(m_pGeoSRS,m_TempPoint1);
}
}
}
return false;
}
获取鼠标点的经纬度和高程信息,程序如上,编译通过但是运行出错,求大神帮忙看一看。。 |
|