The Robot Application Programming Interface Delegate Project
|
Public Member Functions | |
synchronized FrameTreeNode | cloneTree (FrameTreeNode rootFrame) |
Get a copy of the frame tree. | |
synchronized String | getNameOf (FrameTreeNode frame) |
Get name of frame. | |
synchronized List< String > | getFrameNames () |
synchronized void | applyVisitorPreOrder (IFrameVisitor visitor) |
Apply visitor to all root nodes in the forest. | |
synchronized FrameTreeNode | getParent (FrameTreeNode frame) |
Return the parent Frame. | |
synchronized List< FrameTreeNode > | getChildren (FrameTreeNode frame) |
Get the list of direct children of a frame. | |
synchronized FrameTreeNode | lookup (String name, FrameTreeNode scope) |
Lookup a frame by name. | |
FrameTreeNode | lookup (String name) |
synchronized FrameTreeNode | add (String name, FrameTreeNode parent, Matrix4d xfm) throws FrameStoreException |
Add a new frame to the frame store. | |
synchronized FrameTreeNode | add (FrameTreeNode node, FrameTreeNode parent) throws FrameStoreException |
Add a branch to the frame store. | |
synchronized boolean | mergeTree (FrameTreeNode tree, FrameTreeNode mergeRoot) throws FrameStoreException |
Merging a tree with the the frame store. | |
synchronized void | del (FrameTreeNode frame, boolean recursive) |
Delete frame from tree. | |
synchronized void | setParent (FrameTreeNode frame, FrameTreeNode parent) |
Reparent a frame. | |
synchronized FrameTreeNode | getRoot (FrameTreeNode frame) |
Return root node of specified frame. | |
synchronized Matrix4d | getTransform (FrameTreeNode wrtFrame, FrameTreeNode source) |
Return the location of source expressed relative to wrtFrame. | |
synchronized Matrix4d | getTransformOf (FrameTreeNode wrtFrame, FrameTreeNode source, Matrix4d loc) |
synchronized void | setTransform (FrameTreeNode frame, FrameTreeNode wrtFrame, Matrix4d update) |
Set the transform of frame to update, which is expressed relative to wrtFrame. | |
synchronized void | setLocationRel (FrameTreeNode frame, Matrix4d update) |
Update the location of frame to update, expressed relative to parent. | |
synchronized void | updateFrames (Collection<?extends IFrameUpdater > updates) |
Update a set of frames at once. | |
synchronized boolean | isRoot (FrameTreeNode frame) |
Public predicates. | |
synchronized boolean | isLeaf (FrameTreeNode frame) |
Public predicates. | |
synchronized boolean | isAncestorOf (FrameTreeNode frame, FrameTreeNode pop) |
Test if frame is somewhere up in the chain of parents of pop. | |
synchronized boolean | isMember (FrameTreeNode node) |
Test if the frame belongs to this FrameStore instance. | |
Static Public Member Functions | |
static synchronized String | getFullNameOf (FrameTreeNode frame) |
Get fully qualified name of frame, including path of all parent frames. | |
static void | mergeFrameTrees (FrameTreeNode srcTree, FrameTreeNode tgtTree) throws FrameStoreException |
Merge two unmanaged trees. | |
Protected Member Functions | |
synchronized void | assertUnique (String name, FrameTreeNode parent) throws FrameStoreException |
assert uniqueness of name | |
Protected Attributes | |
final ArrayList< FrameTreeNode > | m_rootNodes = new ArrayList<FrameTreeNode>() |
The vector of root nodes. | |
Package Functions | |
void | clone_tree (FrameTree tree, FrameTreeNode rootFrame) |
Get a copy of the frame tree. |
synchronized FrameTreeNode add | ( | String | name, |
FrameTreeNode | parent, | ||
Matrix4d | xfm | ||
) | throws FrameStoreException |
name | name of frame, must not be null or empty |
parent | may be null |
xfm | frame transform, may be null (transform will be set to identity) |
FrameStoreException | if parent is not part of the FrameStore, or name is illegal |
synchronized FrameTreeNode add | ( | FrameTreeNode | node, |
FrameTreeNode | parent | ||
) | throws FrameStoreException |
The FrameStore takes ownership of the passed sub-tree.
node | |
parent |
FrameStoreException | if node is null or already part of the FrameStore. Or, if parent is not part of the FrameStore |
synchronized void applyVisitorPreOrder | ( | IFrameVisitor | visitor | ) |
visitor |
synchronized void assertUnique | ( | String | name, |
FrameTreeNode | parent | ||
) | throws FrameStoreException [protected] |
void clone_tree | ( | FrameTree | tree, |
FrameTreeNode | rootFrame | ||
) | [package] |
The vector holds a set of FrameTreeNode objects, which describe all tree(s) of the FrameStore. The FrameStore is copied in pre-order, so the first element of the vector is the root node of the first tree.
Note that the FrameTreeNodes have a completely different interface than the FrameStore. FrameTreeNodes don't have locking, so this is a static snapshot of the tree.
synchronized FrameTreeNode cloneTree | ( | FrameTreeNode | rootFrame | ) |
The rootFrame is required to be non-NULL, otherwise FrameStoreException is thrown.
synchronized void del | ( | FrameTreeNode | frame, |
boolean | recursive | ||
) |
frame | |
recursive | If recursive is set to false, all children of the frame will be added as root-frames to the FrameStore. |
synchronized List<FrameTreeNode> getChildren | ( | FrameTreeNode | frame | ) |
synchronized List<String> getFrameNames | ( | ) |
static synchronized String getFullNameOf | ( | FrameTreeNode | frame | ) | [static] |
frame |
synchronized String getNameOf | ( | FrameTreeNode | frame | ) |
frame |
synchronized FrameTreeNode getParent | ( | FrameTreeNode | frame | ) |
synchronized FrameTreeNode getRoot | ( | FrameTreeNode | frame | ) |
The frame-store can hold multiple-root nodes.
frame |
synchronized Matrix4d getTransform | ( | FrameTreeNode | wrtFrame, |
FrameTreeNode | source | ||
) |
wrtFrame | |
source |
synchronized Matrix4d getTransformOf | ( | FrameTreeNode | wrtFrame, |
FrameTreeNode | source, | ||
Matrix4d | loc | ||
) |
wrtFrame | |
source | |
loc | transform in the frame of source |
synchronized boolean isAncestorOf | ( | FrameTreeNode | frame, |
FrameTreeNode | pop | ||
) |
frame | |
pop |
synchronized boolean isLeaf | ( | FrameTreeNode | frame | ) |
Test if frame is a leaf frame. That is, does not have any children.
frame |
synchronized boolean isMember | ( | FrameTreeNode | node | ) |
synchronized boolean isRoot | ( | FrameTreeNode | frame | ) |
Test if frame is a root frame. That is, does not have a parent.
frame |
FrameTreeNode lookup | ( | String | name | ) |
synchronized FrameTreeNode lookup | ( | String | name, |
FrameTreeNode | scope | ||
) |
name | Note our special lookup naming semantics: Frame names are alphanumeric only. . and / are reserved characters. A frame name can be specified by giving it's absolute or relative path in Unix file-system convention: /rootNode/myNode or ../../grandParent/uncleFrame. |
A special wild-card is the ... which starts a breadth-first expansion of the tree. So .../myNode will return the first node named myNode beneath the scope-node in a bread-first expansion. As the ordering of children is not defined, it is not guaranteed which node is returned if multiple nodes with the same name are specified at the same depth level.
scope | If a non-NULL scope frame is passed as second parameter, the search is restricted to the sub-tree spawned by this frame. |
static void mergeFrameTrees | ( | FrameTreeNode | srcTree, |
FrameTreeNode | tgtTree | ||
) | throws FrameStoreException [static] |
FrameStoreException | root nodes of trees to be merged must match |
synchronized boolean mergeTree | ( | FrameTreeNode | tree, |
FrameTreeNode | mergeRoot | ||
) | throws FrameStoreException |
The root node names of tree and mergeRoot must match, otherwise this is not a valid merge.
tree | the FrameStore takes ownership of the passed sub-tree. |
mergeRoot | The start-node for the merge operation. The root is required to have the same name as the node. If null, a merge will be attempted with the first tree managed by the FrameStore that has a matching root name. If no root names match, tree will be added to the list of root nodes (i.e. the forest) |
FrameStoreException |
synchronized void setLocationRel | ( | FrameTreeNode | frame, |
Matrix4d | update | ||
) |
frame | |
update |
synchronized void setParent | ( | FrameTreeNode | frame, |
FrameTreeNode | parent | ||
) |
If the node had a parent before, it gets removed from the previous parent's list of children.
frame | |
parent |
synchronized void setTransform | ( | FrameTreeNode | frame, |
FrameTreeNode | wrtFrame, | ||
Matrix4d | update | ||
) |
frame | |
wrtFrame | |
update |
synchronized void updateFrames | ( | Collection<?extends IFrameUpdater > | updates | ) |
final ArrayList<FrameTreeNode> m_rootNodes = new ArrayList<FrameTreeNode>() [protected] |