The Robot Application Programming Interface Delegate Project
RAPID Logo

FrameStore Class Reference

Collaboration diagram for FrameStore:

List of all members.

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< FrameTreeNodegetChildren (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< FrameTreeNodem_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.

Member Function Documentation

synchronized FrameTreeNode add ( String  name,
FrameTreeNode  parent,
Matrix4d  xfm 
) throws FrameStoreException
Parameters:
namename of frame, must not be null or empty
parentmay be null
xfmframe transform, may be null (transform will be set to identity)
Exceptions:
FrameStoreExceptionif 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.

Parameters:
node
parent
Exceptions:
FrameStoreExceptionif node is null or already part of the FrameStore. Or, if parent is not part of the FrameStore

Here is the call graph for this function:

synchronized void applyVisitorPreOrder ( IFrameVisitor  visitor)
Parameters:
visitor
synchronized void assertUnique ( String  name,
FrameTreeNode  parent 
) throws FrameStoreException [protected]
Parameters:
name
parent
Exceptions:
FrameStoreException

Here is the call graph for this function:

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.

Here is the call graph for this function:

synchronized void del ( FrameTreeNode  frame,
boolean  recursive 
)
Parameters:
frame
recursiveIf 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)

Here is the call graph for this function:

synchronized List<String> getFrameNames ( )
Returns:
list of fully qualified names of all frames.

Here is the call graph for this function:

static synchronized String getFullNameOf ( FrameTreeNode  frame) [static]
Parameters:
frame

Here is the call graph for this function:

synchronized String getNameOf ( FrameTreeNode  frame)
Parameters:
frame

Here is the call graph for this function:

synchronized FrameTreeNode getParent ( FrameTreeNode  frame)

Here is the call graph for this function:

synchronized FrameTreeNode getRoot ( FrameTreeNode  frame)

The frame-store can hold multiple-root nodes.

Parameters:
frame

Here is the call graph for this function:

synchronized Matrix4d getTransform ( FrameTreeNode  wrtFrame,
FrameTreeNode  source 
)
Parameters:
wrtFrame
source

Here is the call graph for this function:

synchronized Matrix4d getTransformOf ( FrameTreeNode  wrtFrame,
FrameTreeNode  source,
Matrix4d  loc 
)
Returns:
the transform from wrtFrame to loc.
Parameters:
wrtFrame
source
loctransform in the frame of source

Here is the call graph for this function:

synchronized boolean isAncestorOf ( FrameTreeNode  frame,
FrameTreeNode  pop 
)
Parameters:
frame
pop

Here is the call graph for this function:

synchronized boolean isLeaf ( FrameTreeNode  frame)

Test if frame is a leaf frame. That is, does not have any children.

Parameters:
frame

Here is the call graph for this function:

synchronized boolean isMember ( FrameTreeNode  node)

Here is the call graph for this function:

synchronized boolean isRoot ( FrameTreeNode  frame)

Test if frame is a root frame. That is, does not have a parent.

Parameters:
frame

Here is the call graph for this function:

FrameTreeNode lookup ( String  name)
See also:
FrameStore.lookup(String name, FrameTreeNode scope)

Here is the call graph for this function:

synchronized FrameTreeNode lookup ( String  name,
FrameTreeNode  scope 
)
Parameters:
nameNote 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.

Parameters:
scopeIf a non-NULL scope frame is passed as second parameter, the search is restricted to the sub-tree spawned by this frame.

Here is the call graph for this function:

static void mergeFrameTrees ( FrameTreeNode  srcTree,
FrameTreeNode  tgtTree 
) throws FrameStoreException [static]
Exceptions:
FrameStoreExceptionroot nodes of trees to be merged must match

Here is the call graph for this function:

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.

Parameters:
treethe FrameStore takes ownership of the passed sub-tree.
mergeRootThe 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)
Returns:
true if tree was merged, false if tree was added to forest
Exceptions:
FrameStoreException

Here is the call graph for this function:

synchronized void setLocationRel ( FrameTreeNode  frame,
Matrix4d  update 
)
Parameters:
frame
update

Here is the call graph for this function:

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.

Parameters:
frame
parent

Here is the call graph for this function:

synchronized void setTransform ( FrameTreeNode  frame,
FrameTreeNode  wrtFrame,
Matrix4d  update 
)
Parameters:
frame
wrtFrame
update

Here is the call graph for this function:

synchronized void updateFrames ( Collection<?extends IFrameUpdater updates)

Member Data Documentation

final ArrayList<FrameTreeNode> m_rootNodes = new ArrayList<FrameTreeNode>() [protected]

The documentation for this class was generated from the following file:
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Defines