osgEarth 2.1.1
Public Member Functions | Public Attributes

ViewpointHandler Struct Reference

List of all members.

Public Member Functions

 ViewpointHandler (const std::vector< Viewpoint > &viewpoints)
bool handle (const osgGA::GUIEventAdapter &ea, osgGA::GUIActionAdapter &aa)

Public Attributes

std::vector< Viewpoint_viewpoints

Detailed Description

Definition at line 283 of file osgearth_viewer.cpp.


Constructor & Destructor Documentation

ViewpointHandler::ViewpointHandler ( const std::vector< Viewpoint > &  viewpoints) [inline]

Definition at line 285 of file osgearth_viewer.cpp.

        : _viewpoints( viewpoints ) { }

Member Function Documentation

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;
    }

Here is the call graph for this function:


Member Data Documentation

Definition at line 312 of file osgearth_viewer.cpp.


The documentation for this struct was generated from the following file:
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines