root/OpenSceneGraph/trunk/include/osg/NodeTrackerCallback @ 7102

Revision 7102, 1.9 kB (checked in by robert, 7 years ago)

Fixed typo

  • Property svn:eol-style set to native
  • Property svn:keywords set to Author Date Id Revision
RevLine 
[5328]1/* -*-c++-*- OpenSceneGraph - Copyright (C) 1998-2006 Robert Osfield
[4593]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_NODETRACKERCALLBACK
15#define OSG_NODETRACKERCALLBACK 1
16
17#include <osg/Node>
18#include <osg/NodeCallback>
[5016]19#include <osg/observer_ptr>
[4593]20
21namespace osg
22{
23
24class OSG_EXPORT NodeTrackerCallback : public NodeCallback
25{
26    public:
27
28
[7102]29        typedef std::vector< observer_ptr<Node> >   ObserverNodePath;
[4593]30
[5375]31        void setTrackNodePath(const osg::NodePath& nodePath)
32        {
33           _trackNodePath.clear();
34           _trackNodePath.reserve(nodePath.size());
35           std::copy(nodePath.begin(), nodePath.end(), std::back_inserter(_trackNodePath));
36        }
37
[7102]38        void setTrackNodePath(const ObserverNodePath& nodePath) { _trackNodePath = nodePath; }
39        ObserverNodePath& getTrackNodePath() { return _trackNodePath; }
[4593]40
41        void setTrackNode(osg::Node* node);
42        osg::Node* getTrackNode() { return _trackNodePath.empty() ? 0 : _trackNodePath.back().get(); }
43        const osg::Node* getTrackNode() const { return _trackNodePath.empty() ? 0 : _trackNodePath.back().get(); }
44
45        /** Implements the callback. */
46        virtual void operator()(Node* node, NodeVisitor* nv);
47
[4657]48        /** Update the node to track the nodepath.*/
[4593]49        void update(osg::Node& node);
50
[5016]51
[4657]52        bool validateNodePath() const;
[4593]53
54    protected:
55
[7102]56        ObserverNodePath _trackNodePath;
[4593]57
58};
59
60}
61
62#endif
Note: See TracBrowser for help on using the browser.