OSG  3.4.0
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
ObserverNodePath.h
Go to the documentation of this file.
1 /* -*-c++-*- OpenSceneGraph - Copyright (C) 1998-2006 Robert Osfield
2  *
3  * This library is open source and may be redistributed and/or modified under
4  * the terms of the OpenSceneGraph Public License (OSGPL) version 0.0 or
5  * (at your option) any later version. The full license is in LICENSE file
6  * included with this distribution, and on the openscenegraph.org website.
7  *
8  * This library is distributed in the hope that it will be useful,
9  * but WITHOUT ANY WARRANTY; without even the implied warranty of
10  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11  * OpenSceneGraph Public License for more details.
12 */
13 
14 #ifndef OSG_OBSERVERNODEPATH
15 #define OSG_OBSERVERNODEPATH 1
16 
17 #include <osg/Node>
18 #include <osg/observer_ptr>
19 #include <vector>
20 
21 namespace osg {
22 
23 typedef std::vector< osg::ref_ptr<osg::Node> > RefNodePath;
24 
28 {
29  public:
31 
33 
34  ObserverNodePath(const osg::NodePath& nodePath);
35 
37 
38  ObserverNodePath& operator = (const ObserverNodePath& rhs);
39 
41  void setNodePathTo(osg::Node* node);
42 
43  void setNodePath(const osg::RefNodePath& nodePath);
44 
45  void setNodePath(const osg::NodePath& nodePath);
46 
47  void clearNodePath();
48 
50  bool getRefNodePath(RefNodePath& refNodePath) const;
51 
56  bool getNodePath(NodePath& nodePath) const;
57 
58  bool empty() const
59  {
61  return _nodePath.empty();
62  }
63 
64  protected:
65 
66  void _setNodePath(const osg::NodePath& nodePath);
67  void _clearNodePath();
68 
69  typedef std::vector< osg::observer_ptr<osg::Node> > ObsNodePath;
71  ObsNodePath _nodePath;
72 };
73 
74 }
75 
76 #endif
#define OSG_EXPORT
Definition: Export.h:43
This class provides an object-oriented thread mutex interface.
Definition: Mutex.h:31
std::vector< osg::ref_ptr< osg::Node > > RefNodePath
OpenThreads::Mutex _mutex
Definition: Node.h:71
Definition: AlphaFunc.h:19
std::vector< osg::observer_ptr< osg::Node > > ObsNodePath
std::vector< Node * > NodePath
Definition: Node.h:44