Converted View across to use ObserverNodePath.

This commit is contained in:
Robert Osfield
2010-02-20 17:36:55 +00:00
parent 4acaaa3274
commit 7f454bef3e
2 changed files with 4 additions and 13 deletions

View File

@@ -228,8 +228,7 @@ class OSGVIEWER_EXPORT View : public osg::View, public osgGA::GUIActionAdapter
osg::ref_ptr<osgGA::MatrixManipulator> _cameraManipulator;
EventHandlers _eventHandlers;
typedef std::vector< osg::observer_ptr<osg::Node> > ObserverNodePath;
ObserverNodePath _coordinateSystemNodePath;
osg::ObserverNodePath _coordinateSystemNodePath;
osg::ref_ptr<osg::DisplaySettings> _displaySettings;
osgUtil::SceneView::FusionDistanceMode _fusionDistanceMode;

View File

@@ -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<osg::Node*>(itr->get()));
}
_coordinateSystemNodePath.getNodePath(nodePath);
return nodePath;
}