ObserverNodePath
Go to the documentation of this file.
/* -*-c++-*- OpenSceneGraph - Copyright (C) 1998-2006 Robert Osfield
*
* This library is open source and may be redistributed and/or modified under
* the terms of the OpenSceneGraph Public License (OSGPL) version 0.0 or
* (at your option) any later version. The full license is in LICENSE file
* included with this distribution, and on the openscenegraph.org website.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* OpenSceneGraph Public License for more details.
*/
#ifndef OSG_OBSERVERNODEPATH
#define OSG_OBSERVERNODEPATH 1
#include <osg/Node>
#include <osg/observer_ptr>
#include <vector>
namespace osg {
typedef std::vector< osg::ref_ptr<osg::Node> > RefNodePath;
class OSG_EXPORT ObserverNodePath
{
public:
ObserverNodePath();
ObserverNodePath(const ObserverNodePath& rhs);
ObserverNodePath(const osg::NodePath& nodePath);
~ObserverNodePath();
ObserverNodePath& operator = (const ObserverNodePath& rhs);
void setNodePathTo(osg::Node* node);
void setNodePath(const osg::RefNodePath& nodePath);
void setNodePath(const osg::NodePath& nodePath);
void clearNodePath();
bool getRefNodePath(RefNodePath& refNodePath) const;
bool getNodePath(NodePath& nodePath) const;
bool empty() const
{
OpenThreads::ScopedLock<OpenThreads::Mutex> lock(_mutex);
return _nodePath.empty();
}
protected:
void _setNodePath(const osg::NodePath& nodePath);
void _clearNodePath();
typedef std::vector< osg::observer_ptr<osg::Node> > ObsNodePath;
mutable OpenThreads::Mutex _mutex;
ObsNodePath _nodePath;
};
}
#endif
Node
OpenThreads::Mutex
This class provides an object-oriented thread mutex interface.
Definition Mutex:31
OpenThreads::ScopedLock
Definition ScopedLock:25
osg::Node
Definition Node:72
osg::ObserverNodePath::_nodePath
ObsNodePath _nodePath
Definition ObserverNodePath:71
osg::ObserverNodePath::ObserverNodePath
ObserverNodePath(const osg::NodePath &nodePath)
osg::ObserverNodePath::ObsNodePath
std::vector< osg::observer_ptr< osg::Node > > ObsNodePath
Definition ObserverNodePath:69
osg::ObserverNodePath::ObserverNodePath
ObserverNodePath(const ObserverNodePath &rhs)
osg::ObserverNodePath::~ObserverNodePath
~ObserverNodePath()
osg::ObserverNodePath::setNodePath
void setNodePath(const osg::NodePath &nodePath)
osg::ObserverNodePath::_mutex
OpenThreads::Mutex _mutex
Definition ObserverNodePath:70
osg::ObserverNodePath::ObserverNodePath
ObserverNodePath()
osg::ObserverNodePath::getNodePath
bool getNodePath(NodePath &nodePath) const
osg::ObserverNodePath::_clearNodePath
void _clearNodePath()
osg::ObserverNodePath::_setNodePath
void _setNodePath(const osg::NodePath &nodePath)
osg::ObserverNodePath::empty
bool empty() const
Definition ObserverNodePath:58
osg::ObserverNodePath::getRefNodePath
bool getRefNodePath(RefNodePath &refNodePath) const
osg::ObserverNodePath::setNodePathTo
void setNodePathTo(osg::Node *node)
osg::ObserverNodePath::clearNodePath
void clearNodePath()
osg::ObserverNodePath::setNodePath
void setNodePath(const osg::RefNodePath &nodePath)
osg
Definition AlphaFunc:19
osg::RefNodePath
std::vector< osg::ref_ptr< osg::Node > > RefNodePath
Definition ObserverNodePath:23
osg::NodePath
std::vector< Node * > NodePath
Definition Node:47
observer_ptr
OSG_EXPORT
#define OSG_EXPORT
Definition osg/Export:39