From 8eb0e8ca8851c72d05702b19fe0eb6bc4c3a50e7 Mon Sep 17 00:00:00 2001 From: Don BURNS Date: Mon, 21 Mar 2005 00:33:37 +0000 Subject: [PATCH] Added getCameraByName method to viewer --- src/osgProducer/Viewer.cpp | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/src/osgProducer/Viewer.cpp b/src/osgProducer/Viewer.cpp index 6cc0442eb..ca602a229 100644 --- a/src/osgProducer/Viewer.cpp +++ b/src/osgProducer/Viewer.cpp @@ -913,6 +913,21 @@ bool Viewer::selectCameraManipulatorByName( const std::string &name ) return true; } +osgGA::MatrixManipulator *Viewer::getCameraManipulatorByName( const std::string &name ) +{ + osgGA::KeySwitchMatrixManipulator *ksm = getKeySwitchMatrixManipulator(); + osgGA::KeySwitchMatrixManipulator::KeyManipMap &kmmap = ksm->getKeyManipMap(); + osgGA::KeySwitchMatrixManipulator::KeyManipMap::iterator p; + for( p = kmmap.begin(); p != kmmap.end(); p++ ) + { + osgGA::KeySwitchMatrixManipulator::NamedManipulator nm = (*p).second; + if( nm.first == name ) + return nm.second.get(); + } + return 0L; +} + + void Viewer::requestRedraw() {