|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectcom.kuka.geometry.SpatialObjectUtils
public final class SpatialObjectUtils
Provides utility methods for spatial objects.
| Method Summary | |
|---|---|
static LoadData |
calculateCombinedLoadData(Frame reference,
Collection<? extends SpatialObject> objects)
Calculates the combined load data (mass, center of mass and inertia) of all given spatial objects with respect to the given reference frame (only the objects in the collection will be taken into account for the calculation, not the respective child objects). |
static LoadData |
calculateCombinedLoadData(ObjectFrame reference)
Calculates the load data (mass, center of mass and inertia) of all spatial objects directly or indirectly attached to the given frame's owner object. |
static ObjectFrame |
findFirstFrame(SpatialObject owner,
String name)
Searches the first ObjectFrame with the given name in the given owner SpatialObject. |
static SpatialObject |
findFirstObject(SpatialObject root,
String name)
Searches the first SpatialObject with the given name in the object tree below the given root
SpatialObject. |
static List<ObjectFrame> |
findFrames(SpatialObject owner,
String name)
Searches all ObjectFrame with the given name in the given owner SpatialObject. |
static List<SpatialObject> |
findObjects(SpatialObject root,
String name)
Searches all SpatialObject with the given name in the object tree below the given root
SpatialObject. |
static Frame |
findRootFrame(Frame frame)
Searches for the root frame. |
static ObjectFrame |
findRootFrame(SpatialObject object)
Searches for the root frame of the root spatial object. |
static SpatialObject |
findRootObject(Frame frame)
Searches the root SpatialObject in the object tree where the frame is connected to. |
static boolean |
isRootFrame(ObjectFrame frame)
Checks whether or not the given frame is a root frame. |
static ObjectFrame |
tryGetFrame(SpatialObject owner,
String path)
Searches the ObjectFrame with the given path relative to the given SpatialObject. |
static SpatialObject |
tryGetObject(SpatialObject root,
String path)
Searches the SpatialObject with the given path relative to the given SpatialObject. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Method Detail |
|---|
public static LoadData calculateCombinedLoadData(ObjectFrame reference)
reference - a child frame of an object whose recursive children objects
should be part of the calculation. Also the reference frame
for the calculated load data.
IllegalArgumentException - if the argument is null
IllegalStateException - if the relation between the involved frames could not be determined
ThreadInterruptedException - if the thread was interrupted during execution. The thread interrupt flag will
be set if the thread was interrupted (that is, Thread.isInterrupted() will return
true)
public static LoadData calculateCombinedLoadData(Frame reference,
Collection<? extends SpatialObject> objects)
SpatialObject.getLoadData() returns null) are ignored in
the calculation.
reference - the reference frame for the calculated load dataobjects - a collection of spatial objects that must have a static
connection to the reference frame
IllegalArgumentException - if any argument is null, or if there is no connection or an unknown connection type
between the reference frame and the root frame of any of the given objects.
IllegalStateException - if the relation between the involved frames could not be determined
ThreadInterruptedException - if the thread was interrupted during execution. The thread interrupt flag will
be set if the thread was interrupted (that is, Thread.isInterrupted() will return
true)public static SpatialObject findRootObject(Frame frame)
SpatialObject in the object tree where the frame is connected to.
frame - the Frame to start from
SpatialObject of the frame.
If the frame is not connected to any SpatialObject in its parents then null is
returned.
IllegalArgumentException - if the given object is nullpublic static ObjectFrame findRootFrame(SpatialObject object)
object - the spatial object to start from
IllegalArgumentException - if the given object is nullpublic static Frame findRootFrame(Frame frame)
frame - the frame to start from
IllegalArgumentException - if the given frame is null
public static SpatialObject tryGetObject(SpatialObject root,
String path)
SpatialObject with the given path relative to the given SpatialObject.
root - the SpatialObject to start the search frompath - the path to search for
SpatialObject with the given path. If it does not exist, null is returned.
IllegalArgumentException - if either root or path is null
public static List<SpatialObject> findObjects(SpatialObject root,
String name)
SpatialObject with the given name in the object tree below the given root
SpatialObject.
root - the SpatialObject to start the search fromname - the name to search for
SpatialObject with the given name below the given root SpatialObject
IllegalArgumentException - if either root or name is null
public static SpatialObject findFirstObject(SpatialObject root,
String name)
SpatialObject with the given name in the object tree below the given root
SpatialObject.
If multiple objects with the same name exists, any of these could be returned.
root - the SpatialObject to start the search fromname - the name to search for
SpatialObject with the given name below the given root SpatialObject. If it
does not exist, null is returned.
IllegalArgumentException - if either root or name is null
public static ObjectFrame tryGetFrame(SpatialObject owner,
String path)
ObjectFrame with the given path relative to the given SpatialObject.
owner - the SpatialObject owning the framepath - the path to search for
ObjectFrame with the given path. If it does not exist, null is returned.
IllegalArgumentException - if either owner or path is null
public static List<ObjectFrame> findFrames(SpatialObject owner,
String name)
ObjectFrame with the given name in the given owner SpatialObject.
owner - the SpatialObject to search inname - the name to search for
ObjectFrame with the given name in the given owner SpatialObject
IllegalArgumentException - if either owner or name is null
public static ObjectFrame findFirstFrame(SpatialObject owner,
String name)
ObjectFrame with the given name in the given owner SpatialObject.
If multiple frames with the same name exists, any of these could be returned.
owner - the SpatialObject to search inname - the name to search for
ObjectFrame with the given name in the given owner SpatialObject. If it
does not exist, null is returned.
IllegalArgumentException - if either owner or name is nullpublic static boolean isRootFrame(ObjectFrame frame)
frame - the frame to be checked
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||