From 7f454bef3e4a108c5bdcc3cf94dadf6487e94ed0 Mon Sep 17 00:00:00 2001 From: Robert Osfield Date: Sat, 20 Feb 2010 17:36:55 +0000 Subject: [PATCH] Converted View across to use ObserverNodePath. --- include/osgViewer/View | 3 +-- src/osgViewer/View.cpp | 14 +++----------- 2 files changed, 4 insertions(+), 13 deletions(-) diff --git a/include/osgViewer/View b/include/osgViewer/View index 24eff3e35..9784859eb 100644 --- a/include/osgViewer/View +++ b/include/osgViewer/View @@ -228,8 +228,7 @@ class OSGVIEWER_EXPORT View : public osg::View, public osgGA::GUIActionAdapter osg::ref_ptr _cameraManipulator; EventHandlers _eventHandlers; - typedef std::vector< osg::observer_ptr > ObserverNodePath; - ObserverNodePath _coordinateSystemNodePath; + osg::ObserverNodePath _coordinateSystemNodePath; osg::ref_ptr _displaySettings; osgUtil::SceneView::FusionDistanceMode _fusionDistanceMode; diff --git a/src/osgViewer/View.cpp b/src/osgViewer/View.cpp index 591581b78..3e42e88bb 100644 --- a/src/osgViewer/View.cpp +++ b/src/osgViewer/View.cpp @@ -215,7 +215,7 @@ void View::take(osg::View& rhs) rhs_osgViewer->_cameraManipulator = 0; rhs_osgViewer->_eventHandlers.clear(); - rhs_osgViewer->_coordinateSystemNodePath.clear(); + rhs_osgViewer->_coordinateSystemNodePath.clearNodePath(); rhs_osgViewer->_displaySettings = 0; } @@ -386,21 +386,13 @@ void View::removeEventHandler(osgGA::GUIEventHandler* eventHandler) void View::setCoordinateSystemNodePath(const osg::NodePath& nodePath) { - _coordinateSystemNodePath.clear(); - std::copy(nodePath.begin(), - nodePath.end(), - std::back_inserter(_coordinateSystemNodePath)); + _coordinateSystemNodePath.setNodePath(nodePath); } osg::NodePath View::getCoordinateSystemNodePath() const { osg::NodePath nodePath; - for(ObserverNodePath::const_iterator itr = _coordinateSystemNodePath.begin(); - itr != _coordinateSystemNodePath.end(); - ++itr) - { - nodePath.push_back(const_cast(itr->get())); - } + _coordinateSystemNodePath.getNodePath(nodePath); return nodePath; }