osgEarth 2.1.1
Public Member Functions | Static Public Member Functions | Public Attributes

osgEarth::Util::Controls::CanvasInstaller Struct Reference

List of all members.

Public Member Functions

 CanvasInstaller (ControlCanvas *canvas, osg::Camera *camera)
void operator() (osg::Node *node, osg::NodeVisitor *nv)

Static Public Member Functions

static void install (osgViewer::View *view2, ControlCanvas *canvas)

Public Attributes

osg::ref_ptr< ControlCanvas_canvas
osg::ref_ptr< osg::NodeCallback > _oldCallback

Detailed Description

Definition at line 1762 of file Controls.cpp.


Constructor & Destructor Documentation

osgEarth::Util::Controls::CanvasInstaller::CanvasInstaller ( ControlCanvas canvas,
osg::Camera *  camera 
) [inline]

Definition at line 1764 of file Controls.cpp.

            : _canvas( canvas )
        {
            _oldCallback = camera->getUpdateCallback();
            camera->setUpdateCallback( this );
        }

Member Function Documentation

static void osgEarth::Util::Controls::CanvasInstaller::install ( osgViewer::View *  view2,
ControlCanvas canvas 
) [inline, static]

Definition at line 1779 of file Controls.cpp.

        {
            osg::Node* node = view2->getSceneData();
            osg::Group* group = new osg::Group();
            if ( node )
                group->addChild( node );
            group->addChild( canvas );
            
            // must save the manipulator matrix b/c calling setSceneData causes
            // the view to call home() on the manipulator.
            osg::Matrixd savedMatrix;
            osgGA::MatrixManipulator* manip = view2->getCameraManipulator();
            if ( manip )
                savedMatrix = manip->getMatrix();

            view2->setSceneData( group );

            // restore it
            if ( manip )
                manip->setByMatrix( savedMatrix );
        }

Here is the caller graph for this function:

void osgEarth::Util::Controls::CanvasInstaller::operator() ( osg::Node *  node,
osg::NodeVisitor *  nv 
) [inline]

Definition at line 1771 of file Controls.cpp.

        {
            osg::Camera* camera = static_cast<osg::Camera*>(node);
            osgViewer::View* view2 = dynamic_cast<osgViewer::View*>(camera->getView());
            install( view2, _canvas.get() );
            camera->setUpdateCallback( _oldCallback.get() );
        }

Here is the call graph for this function:


Member Data Documentation

Definition at line 1801 of file Controls.cpp.

Definition at line 1802 of file Controls.cpp.


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