OpenFrames
|
Remembers each frame of a tracked frame. More...
#include <SubtreeTracker.hpp>
Public Member Functions | |
SubtreeTracker (ReferenceFrame *frame) | |
virtual void | childAdded (ReferenceFrame *child, ReferenceFrame *parent) |
virtual void | childRemoved (ReferenceFrame *child, ReferenceFrame *parent) |
virtual void | setRoot (ReferenceFrame *frame) |
virtual void | rescan () |
ReferenceFrame * | getFrame (const std::string &name) |
void | printFrameList () |
![]() | |
FrameTracker (ReferenceFrame *frame) | |
ReferenceFrame * | getRoot () |
Protected Member Functions | |
void | _addAllChildren (ReferenceFrame *frame) |
void | _removeAllChildren (ReferenceFrame *frame) |
Protected Attributes | |
FrameMap | _frames |
![]() | |
osg::ref_ptr< ReferenceFrame > | _root |
Remembers each frame of a tracked frame.
Implements a simple FrameTracker that remembers each frame in the tracked frame's subtree, by name. This allows for quick lookups of frames by their names without having to traverse the subtree. Note that if there are multiple frames with the same name, then only the first encountered frame will be remembered. All other frames with the same name (and their subtrees) will be ignored.
|
virtual |
Called when a frame is added/removed from a tracked frame
Implements OpenFrames::FrameTracker.
ReferenceFrame* OpenFrames::SubtreeTracker::getFrame | ( | const std::string & | name | ) |
Lookup a frame based on its name
void OpenFrames::SubtreeTracker::printFrameList | ( | ) |
Print a list (to std::cout) of all tracked frames
|
virtual |
Rescan the root's subtree to check if there are any previously untracked frames that can now be tracked. This should be called if a frame is removed from root's subtree, in case there are different frames with the same name in the root's subtree.
|
virtual |
Set which frame to track
Reimplemented from OpenFrames::FrameTracker.