com.kuka.roboticsAPI.geometricModel
Class SceneGraphObject

java.lang.Object
  extended by com.kuka.common.TaggableObject
      extended by com.kuka.roboticsAPI.geometricModel.SceneGraphObject
All Implemented Interfaces:
com.kuka.common.ITaggable
Direct Known Subclasses:
SpatialObject, World

public abstract class SceneGraphObject
extends com.kuka.common.TaggableObject

Base class for all objects that build up the scene graph.

The Robotics API always assumes the translation part of transformations to be given in [mm].

This element is an undocumented internal feature. It is not intended to be used by applications as it might change or be removed in future versions.

Constructor Summary
protected SceneGraphObject()
          Creates a new instance of SceneGraphObject without a root frame and with an empty name.
protected SceneGraphObject(String name)
          Creates a new instance of SceneGraphObject which creates a new ObjectFrame as root frame.
 
Method Summary
 ObjectFrame addChildFrame(String name)
          Adds a new frame with the given name and transformation = MatrixTransformation = IDENTITY from the root frame of this object.
 ObjectFrame addChildFrame(String name, ITransformation offset)
          Adds a new frame with the given name and transformation from the root frame of this object.
 ObjectFrame addChildFrame(String name, ObjectFrame parent)
          Adds a new frame with the given name and transformation = MatrixTransformation = IDENTITY to the given parent frame.
 ObjectFrame addChildFrame(String name, ObjectFrame parent, ITransformation offset)
          Adds a new frame with the given name and transformation from the given parent frame.
 ObjectFrame addChildFrame(String name, ObjectFrame parent, ITransformationProvider provider)
          Adds a new frame with the given name and transformation to the root frame of this object.
 ObjectFrame addChildFrame(String id, String name, ObjectFrame parent, ITransformation offset)
          Adds a new frame with the given name and transformation from the given parent frame.
 List<SceneGraphObject> allObjects()
          Gets a list of all child objects of this object and the object itself.
protected  void changeFrameParent(ObjectFrame frame, ObjectFrame newParent)
          Changes the frames parent to newParent.
 void changeFramePosition(ObjectFrame frame, ITransformation newOffset)
          Changes the frame position in the object relative to its parent..
protected abstract  void changeParent(ObjectFrame frame)
          Changes the parent of this object.
 List<SceneGraphObject> findMembersOfGroup()
          Gets a list of all objects that are in a group with the calling object, including the root object of the group.
 Robot findRobot()
          Finds the robot to which the object is connected.
 List<ObjectFrame> getAllFrames()
          Gets a list of all frames of the object.
 Map<String,Object> getAllUserParameters()
          Gets unmodifiable map containing all user parameters.
 SceneGraphObject getChild(String name)
          Gets the child object with the given name.
protected  Object getChildFrameLock()
           
 List<SceneGraphObject> getChildren()
          Gets a list of all child objects of the calling object.
 ObjectFrame getFrame(String path)
          Gets the object frame with the given path from the object frame to the root of this object.
 String getName()
          Gets the name of this object.
 SceneGraphObject getParent()
          Gets the parent object of this object.
 ObjectFrame getRootFrame()
          Gets the root frame of this object.
 SceneGraphObject getRootOfGroup()
          Gets the root member of the group of the calling object.
 Object getUserParameter(String key)
          Gets user parameter value for the given key.
 void groupToParent()
          Sets the group flag for this spatial object.
 boolean isDescendantOf(SceneGraphObject other)
          Checks if the object is a descendant of the specified object.
 boolean isGroupedToParent()
          Checks if the spatial object is grouped to its parent.
 boolean isMemberOfGroup()
          Checks if the spatial object belongs to a group of objects.
 boolean isRootOfGroup()
          Checks if the spatial object is the root element of the group it belongs to.
 void removeFrame(ObjectFrame frame)
          Removes the specified child frame and sets the owner of all its children to null.
 void renameFrame(ObjectFrame frame, String newName)
          Changes the name of the specified frame.
protected  void setName(String name)
          Sets the given name as the name of this object and its root frame.
protected  void setRootFrame(ObjectFrame frame)
          Sets the root frame of this object, if frame is not null and no root frame for this object exists.
 void setUserParameter(String key, Object value)
          Sets given user parameter value for the given key.
 String toString()
          
 void ungroupFromParent()
          Removes the group flag from the spatial object.
 
Methods inherited from class com.kuka.common.TaggableObject
getTag, setTag
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

SceneGraphObject

protected SceneGraphObject(String name)
Creates a new instance of SceneGraphObject which creates a new ObjectFrame as root frame.

The name of the created object and its root frame is the specified name.

Parameters:
name - the SceneGraphObject's and root frame's name.

SceneGraphObject

protected SceneGraphObject()
Creates a new instance of SceneGraphObject without a root frame and with an empty name.

Method Detail

getName

public String getName()
Gets the name of this object.

Returns:
the object name.
This element is an undocumented internal feature. It is not intended to be used by applications as it might change or be removed in future versions.

setName

protected void setName(String name)
Sets the given name as the name of this object and its root frame.

Parameters:
name - the new SceneGraphObject and root frame name.

setRootFrame

protected void setRootFrame(ObjectFrame frame)
Sets the root frame of this object, if frame is not null and no root frame for this object exists.

Parameters:
frame - the new root frame
Throws:
IllegalStateException - if the root frame already exists

getRootFrame

public ObjectFrame getRootFrame()
Gets the root frame of this object.

Returns:
the root frame
This element is an undocumented internal feature. It is not intended to be used by applications as it might change or be removed in future versions.

getFrame

public ObjectFrame getFrame(String path)
Gets the object frame with the given path from the object frame to the root of this object. The given path needs to be formatted like "/MyFrame/MySubFrame". (The leading slash is optional)

Parameters:
path - the full qualified path
Returns:
the frame with the given name. If the frame does not exist null will be returned.
This element is an undocumented internal feature. It is not intended to be used by applications as it might change or be removed in future versions.

findMembersOfGroup

public List<SceneGraphObject> findMembersOfGroup()
Gets a list of all objects that are in a group with the calling object, including the root object of the group.

Returns:
membersOfGroup the group members in a list
This element is an undocumented internal feature. It is not intended to be used by applications as it might change or be removed in future versions.

getParent

public SceneGraphObject getParent()
Gets the parent object of this object.

The parent object of this object is the object to which belongs the parent of this object's frame.

Returns:
the parent object, or null if there are no parent object.
This element is an undocumented internal feature. It is not intended to be used by applications as it might change or be removed in future versions.

getChild

public SceneGraphObject getChild(String name)
Gets the child object with the given name.

Parameters:
name - the name of the child object
Returns:
the child object with the given name
This element is an undocumented internal feature. It is not intended to be used by applications as it might change or be removed in future versions.

allObjects

public List<SceneGraphObject> allObjects()
Gets a list of all child objects of this object and the object itself.

Returns:
A list of all child objects and the object itself.
This element is an undocumented internal feature. It is not intended to be used by applications as it might change or be removed in future versions.

getChildren

public List<SceneGraphObject> getChildren()
Gets a list of all child objects of the calling object.

Returns:
children the child objects in a list
This element is an undocumented internal feature. It is not intended to be used by applications as it might change or be removed in future versions.

addChildFrame

public ObjectFrame addChildFrame(String name,
                                 ObjectFrame parent,
                                 ITransformation offset)
Adds a new frame with the given name and transformation from the given parent frame. Sets the owner of the new frame to the parents owner.

Parameters:
name - the name of the new frame.
parent - the parent frame of the new frame. The parent frame should belong to this object.
offset - the transformation between the given parent and the created frame.
Returns:
the new frame.
Throws:
IllegalArgumentException - the parent frame does not belong to the same object or null.
IllegalArgumentException - if the name is not unique
This element is an undocumented internal feature. It is not intended to be used by applications as it might change or be removed in future versions.

addChildFrame

public ObjectFrame addChildFrame(String id,
                                 String name,
                                 ObjectFrame parent,
                                 ITransformation offset)
Adds a new frame with the given name and transformation from the given parent frame. Sets the owner of the new frame to the parents owner.

Parameters:
id - the id of the new frame.
name - the name of the new frame.
parent - the parent frame of the new frame. The parent frame should belong to this object.
offset - the transformation between the given parent and the created frame.
Returns:
the new frame.
Throws:
IllegalArgumentException - the parent frame does not belong to the same object or null.
IllegalArgumentException - if the name is not unique
This element is an undocumented internal feature. It is not intended to be used by applications as it might change or be removed in future versions.

addChildFrame

public ObjectFrame addChildFrame(String name,
                                 ITransformation offset)
Adds a new frame with the given name and transformation from the root frame of this object. Sets the owner of the new frame to the root owner.

Parameters:
name - the name of the new frame.
offset - the transformation between the new frame an the root frame.
Returns:
the new frame.
Throws:
IllegalArgumentException - the parent frame does not belong to the same object.
IllegalArgumentException - if the name is not unique
This element is an undocumented internal feature. It is not intended to be used by applications as it might change or be removed in future versions.

addChildFrame

public ObjectFrame addChildFrame(String name,
                                 ObjectFrame parent,
                                 ITransformationProvider provider)
Adds a new frame with the given name and transformation to the root frame of this object. Sets the owner of the new frame to the root owner.

Parameters:
name - the name of the new frame. Must be unique for the current frame node.
parent - parent frame for the created frame, should belong to this object
provider - the transformation provider that should provide transformation from the parent frame to the created frame.
Returns:
the new frame.
Throws:
IllegalArgumentException - the parent frame does not belong to the same object or null.
IllegalArgumentException - if the name is not unique
This element is an undocumented internal feature. It is not intended to be used by applications as it might change or be removed in future versions.

addChildFrame

public ObjectFrame addChildFrame(String name)
Adds a new frame with the given name and transformation = MatrixTransformation = IDENTITY from the root frame of this object. Sets the owner of the new frame to this object.

Parameters:
name - the name of the new frame.
Returns:
the new frame.
Throws:
IllegalArgumentException - the parent frame does not belong to the same object.
IllegalArgumentException - if the name is not unique
This element is an undocumented internal feature. It is not intended to be used by applications as it might change or be removed in future versions.

addChildFrame

public ObjectFrame addChildFrame(String name,
                                 ObjectFrame parent)
Adds a new frame with the given name and transformation = MatrixTransformation = IDENTITY to the given parent frame. Sets the owner of the new frame to the root owner.

Parameters:
name - the name of the new frame.
parent - the parent frame of the new frame.
Returns:
the new frame.
Throws:
IllegalArgumentException - if name is null.
IllegalArgumentException - the parent frame does not belong to the same object.
IllegalArgumentException - if the name is not unique
This element is an undocumented internal feature. It is not intended to be used by applications as it might change or be removed in future versions.

removeFrame

public void removeFrame(ObjectFrame frame)
Removes the specified child frame and sets the owner of all its children to null.

Parameters:
frame - the frame that should be removed.
This element is an undocumented internal feature. It is not intended to be used by applications as it might change or be removed in future versions.

groupToParent

public void groupToParent()
Sets the group flag for this spatial object.

If a grouped object is attached to a new parent with the attachTo() or the switchParent() method, the whole group will be attached to the new parent. This means that the root member of the group will be attached to the new parent object, not the calling object.

This element is an undocumented internal feature. It is not intended to be used by applications as it might change or be removed in future versions.

ungroupFromParent

public void ungroupFromParent()
Removes the group flag from the spatial object.

This element is an undocumented internal feature. It is not intended to be used by applications as it might change or be removed in future versions.

findRobot

public Robot findRobot()
Finds the robot to which the object is connected.

Returns:
the robot, or null if no robot found.
This element is an undocumented internal feature. It is not intended to be used by applications as it might change or be removed in future versions.

isGroupedToParent

public boolean isGroupedToParent()
Checks if the spatial object is grouped to its parent. This is not true for the root object of a group.

Returns:
true if the object is grouped to its parent.
This element is an undocumented internal feature. It is not intended to be used by applications as it might change or be removed in future versions.

isMemberOfGroup

public boolean isMemberOfGroup()
Checks if the spatial object belongs to a group of objects. This includes the root object of a group.

Returns:
true if the object is part of a group.
This element is an undocumented internal feature. It is not intended to be used by applications as it might change or be removed in future versions.

getRootOfGroup

public SceneGraphObject getRootOfGroup()
Gets the root member of the group of the calling object. If the given object is not part of a group, null is returned.

Returns:
the root object of the group.
This element is an undocumented internal feature. It is not intended to be used by applications as it might change or be removed in future versions.

isRootOfGroup

public boolean isRootOfGroup()
Checks if the spatial object is the root element of the group it belongs to.

Returns:
true if the object is the root element.
This element is an undocumented internal feature. It is not intended to be used by applications as it might change or be removed in future versions.

getAllFrames

public List<ObjectFrame> getAllFrames()
Gets a list of all frames of the object.

Returns:
list of all frames
This element is an undocumented internal feature. It is not intended to be used by applications as it might change or be removed in future versions.

changeParent

protected abstract void changeParent(ObjectFrame frame)
Changes the parent of this object. Parent of the root frame of this object (or of parent of the group if grouped) should be changed.

Parameters:
frame - new parent frame for the object root.

changeFramePosition

public void changeFramePosition(ObjectFrame frame,
                                ITransformation newOffset)
Changes the frame position in the object relative to its parent..

Parameters:
frame - the frame whose position should be changed.
newOffset - the new transformation from frame parent to the frame.
Throws:
IllegalStateException - if the given frame does not belong to the object.
This element is an undocumented internal feature. It is not intended to be used by applications as it might change or be removed in future versions.

renameFrame

public void renameFrame(ObjectFrame frame,
                        String newName)
Changes the name of the specified frame.

Parameters:
frame - frame to rename.
newName - new name for the frame. The name should be unique for the current frame node.
Throws:
IllegalArgumentException - if the name is not unique
This element is an undocumented internal feature. It is not intended to be used by applications as it might change or be removed in future versions.

changeFrameParent

protected void changeFrameParent(ObjectFrame frame,
                                 ObjectFrame newParent)
Changes the frames parent to newParent.

Parameters:
frame - the frame whose parent should be changed.
newParent - the frames new parent.
Throws:
IllegalStateException - if the frame or the new parent do not belong to the object.

toString

public String toString()

Overrides:
toString in class Object
This element is an undocumented internal feature. It is not intended to be used by applications as it might change or be removed in future versions.

getChildFrameLock

protected Object getChildFrameLock()
Returns:
the childFrameLock

isDescendantOf

public boolean isDescendantOf(SceneGraphObject other)
Checks if the object is a descendant of the specified object.

Parameters:
other - The other object. null is not allowed.
Returns:
true if the object is a child of the given object.
This element is an undocumented internal feature. It is not intended to be used by applications as it might change or be removed in future versions.

getUserParameter

public Object getUserParameter(String key)
Gets user parameter value for the given key.

Parameters:
key - The key. null is not allowed.
Returns:
The data stored under the given key or null if not found.

setUserParameter

public void setUserParameter(String key,
                             Object value)
Sets given user parameter value for the given key.

This data can be retrieved later from the object through the method getUserParameter(String).

Parameters:
key - The key. null is not allowed.
value - The value. May be null.

getAllUserParameters

public Map<String,Object> getAllUserParameters()
Gets unmodifiable map containing all user parameters.

Returns:
unmodifiable map containing all user parameters; empty map if no user parameters are defined for this object


Copyright © 2019. All rights reserved.