osgEarth 2.1.1
|
Public Member Functions | |
ViewpointHandler (const std::vector< Viewpoint > &viewpoints) | |
bool | handle (const osgGA::GUIEventAdapter &ea, osgGA::GUIActionAdapter &aa) |
Public Attributes | |
std::vector< Viewpoint > | _viewpoints |
Definition at line 283 of file osgearth_viewer.cpp.
ViewpointHandler::ViewpointHandler | ( | const std::vector< Viewpoint > & | viewpoints | ) | [inline] |
Definition at line 285 of file osgearth_viewer.cpp.
: _viewpoints( viewpoints ) { }
bool ViewpointHandler::handle | ( | const osgGA::GUIEventAdapter & | ea, |
osgGA::GUIActionAdapter & | aa | ||
) | [inline] |
Definition at line 288 of file osgearth_viewer.cpp.
{ if ( ea.getEventType() == ea.KEYDOWN ) { int index = (int)ea.getKey() - (int)'1'; if ( index >= 0 && index < (int)_viewpoints.size() ) { s_manip->setViewpoint( _viewpoints[index], 4.5 ); } else if ( ea.getKey() == 'v' ) { Viewpoint vp = s_manip->getViewpoint(); XmlDocument xml( vp.getConfig() ); xml.store( std::cout ); std::cout << std::endl; } else if ( ea.getKey() == '?' ) { s_controlPanel->setVisible( !s_controlPanel->visible() ); } } return false; }
std::vector<Viewpoint> ViewpointHandler::_viewpoints |
Definition at line 312 of file osgearth_viewer.cpp.