The Robot Application Programming Interface Delegate Project
|
![]() |
A frame-tree is expected to adhere to the following requirements: * Frame names of children of a node are unique. More...
Public Member Functions | |
FrameTreeNode (Frame frame) | |
Create a new FrameTreeNode with null parent and assigned frame. | |
FrameTreeNode (String frameName) | |
Create a new FrameTreeNode with null parent and a new Frame with name frameName. | |
FrameTreeNode (String frameName, Matrix4d xfm) | |
Create a new FrameTreeNode with null parent and a new Frame with name frameName. | |
FrameTreeNode | set (FrameTreeNode toCopy) |
Set the Frame data to toCopy Only payload data is copied, not children or parent. | |
FrameTreeNode | clone (FrameTreeNode parent) |
Clone node and its offsprings. | |
Frame | getData () |
for compatibility with c++ api | |
Frame | getFrame () |
FrameTreeNode | attachChild (FrameTreeNode node) |
Attach a child node. | |
FrameTreeNode | mergeChild (FrameTreeNode node) |
Merge a child. | |
FrameTreeNode | findChild (String name) |
Find a child with matching name. | |
boolean | removeChild (FrameTreeNode node) |
Remove node from list of children and set it's parent to null. | |
void | detachFromParent () |
void | setParent (FrameTreeNode newParent) |
Set the parent of the node. | |
FrameTreeNode | getParent () |
boolean | isRoot () |
boolean | isLeaf () |
FrameTreeNode | getRoot () |
Search upward in tree to find root. | |
boolean | isAncestorOf (FrameTreeNode node) |
List< FrameTreeNode > | getAncestry () |
Get an ordered list of ancestors which begins at root and ends at (and includes) this node. | |
List< FrameTreeNode > | getAncestry (List< FrameTreeNode > store) |
FrameTreeNode | getLastCommonAncestor (FrameTreeNode that) |
Calculate the last common ancestor. | |
FrameTreeNode | getLastCommonAncestor (FrameTreeNode that, List< FrameTreeNode > thisAncestors, List< FrameTreeNode > thatAncestors) |
List< FrameTreeNode > | getChildren () |
List< FrameTreeNode > | getChildren (boolean sortByName) |
int | getNumChildren () |
get the number of direct decendants of this node | |
int | getNumOffspring () |
Recursively count number of nodes underneath this node. | |
boolean | traverseBreadthFirst (IFrameVisitor visitor) |
Breadth first traversal. | |
boolean | traversePreOrder (IFrameVisitor visitor) |
Depth first, pre-order traversal. | |
boolean | traversePreOrder (IFrameVisitor visitor, boolean sortByName) |
boolean | traversePostOrder (IFrameVisitor visitor) |
Depth first, post-order traversal. | |
boolean | equals (Object o) |
If the contained Frame name matches this one, return equal. | |
Protected Member Functions | |
FrameTreeNode (FrameTreeNode parent, String frameName) | |
Create a new node with the given name and assigned it a parent. | |
FrameTreeNode (FrameTreeNode parent, String frameName, Matrix4d xfm) | |
Create a new node with the given name, parent and transform. | |
Protected Attributes | |
Frame | m_data |
FrameTreeNode | m_parent |
final ArrayList< FrameTreeNode > | m_children = new ArrayList<FrameTreeNode>() |
* Frame names do not contain the character '/'. * Frames are not named ".", "..", nor "...". * The transform has an invertible matrix.
These requirements are not checked explicitly in the FrameTreeNode interface. Only the FrameStore interface explicitly checks these requirements and flags errors if frames are added to the frame-store, that do not meet these assumptions.
FrameTreeNode | ( | Frame | frame | ) |
frame |
FrameTreeNode | ( | String | frameName | ) |
frameName | name for new Frame |
FrameTreeNode | ( | FrameTreeNode | parent, |
String | frameName | ||
) | [protected] |
parent | |
frameName |
FrameTreeNode | ( | FrameTreeNode | parent, |
String | frameName, | ||
Matrix4d | xfm | ||
) | [protected] |
parent | |
frameName | |
xfm |
FrameTreeNode | ( | String | frameName, |
Matrix4d | xfm | ||
) |
frameName | name for new Frame |
FrameTreeNode attachChild | ( | FrameTreeNode | node | ) |
If the node has an existing parent, it is re-parented to this. XXX FIXME XXX what do we do when a child with the same name is attached? Throw an exception or merge?
FrameTreeNode clone | ( | FrameTreeNode | parent | ) |
The new node is becoming a child of parent. Default is NULL, which creates a new root node.
parent |
void detachFromParent | ( | ) |
boolean equals | ( | Object | o | ) |
FrameTreeNode findChild | ( | String | name | ) |
name |
List<FrameTreeNode> getAncestry | ( | ) |
List<FrameTreeNode> getAncestry | ( | List< FrameTreeNode > | store | ) |
List<FrameTreeNode> getChildren | ( | ) |
List<FrameTreeNode> getChildren | ( | boolean | sortByName | ) |
Frame getData | ( | ) |
Frame getFrame | ( | ) |
FrameTreeNode getLastCommonAncestor | ( | FrameTreeNode | that | ) |
FrameTreeNode getLastCommonAncestor | ( | FrameTreeNode | that, |
List< FrameTreeNode > | thisAncestors, | ||
List< FrameTreeNode > | thatAncestors | ||
) |
int getNumChildren | ( | ) |
int getNumOffspring | ( | ) |
FrameTreeNode getParent | ( | ) |
FrameTreeNode getRoot | ( | ) |
Linear time.
boolean isAncestorOf | ( | FrameTreeNode | node | ) |
boolean isLeaf | ( | ) |
boolean isRoot | ( | ) |
FrameTreeNode mergeChild | ( | FrameTreeNode | node | ) |
If a matching child exists, perform a FrameTree.mergeFrameTrees, otherwise, attachChild();
node |
boolean removeChild | ( | FrameTreeNode | node | ) |
FrameTreeNode set | ( | FrameTreeNode | toCopy | ) |
Shouldn't this method call something like setFrame, or have a different signature like set(Frame)
void setParent | ( | FrameTreeNode | newParent | ) |
This call re-parents the sub-tree. If the node had a parent before, it gets removed from the previous parent's list of children.
Setting the parent to NULL makes the node a root-node.
boolean traverseBreadthFirst | ( | IFrameVisitor | visitor | ) |
The visitor's up() and down() methods are not called.
boolean traversePostOrder | ( | IFrameVisitor | visitor | ) |
boolean traversePreOrder | ( | IFrameVisitor | visitor | ) |
boolean traversePreOrder | ( | IFrameVisitor | visitor, |
boolean | sortByName | ||
) |
final ArrayList<FrameTreeNode> m_children = new ArrayList<FrameTreeNode>() [protected] |
FrameTreeNode m_parent [protected] |