Added an empty() method

This commit is contained in:
Robert Osfield 2010-02-22 17:41:35 +00:00
parent bb35fcc980
commit 9a45538db9

View File

@ -59,6 +59,13 @@ class OSG_EXPORT ObserverNodePath : public osg::Observer
* of the NodePath. return true if NodePath is valid.*/ * of the NodePath. return true if NodePath is valid.*/
bool getNodePath(NodePath& nodePath) const; bool getNodePath(NodePath& nodePath) const;
bool empty() const
{
if (!_valid) return true;
OpenThreads::ScopedLock<OpenThreads::Mutex> lock(*getObserverMutex());
return _nodePath.empty();
}
protected: protected:
void _setNodePath(const osg::NodePath& nodePath); void _setNodePath(const osg::NodePath& nodePath);