|
osgEarth 2.1.1
|
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 |
Definition at line 1762 of file Controls.cpp.
| 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 ); }
| 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:Definition at line 1801 of file Controls.cpp.
| osg::ref_ptr<osg::NodeCallback> osgEarth::Util::Controls::CanvasInstaller::_oldCallback |
Definition at line 1802 of file Controls.cpp.
1.7.3