|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||
java.lang.Objectcom.tensegrity.composite.util.CompositeHierarchyPath
This class provides functionalities useful when working with arrangements
of composites, especially when it comes to transforming coordinates from the
view to a Composite respectively a
CompositeContainer or vice versa.
CompositeHierarchyUtilities| Method Summary | |
Transform2D |
buildTransform(int type)
Returns a transformation that is defined through the constant given by type and can be used to
constant
transformation type
CompositeHierarchyUtilities.TRANSFORM_FROM_VIEW_TO_COMPOSITE
transform a coordinate from the coordinate system of the view into the
coordinate system of the composite
CompositeHierarchyUtilities.TRANSFORM_FROM_COMPOSITE_TO_VIEW
transform a coordinate from the coordinate system of the composite
into the coordinate system of the view
CompositeHierarchyUtilities.TRANSFORM_FROM_VIEW_TO_CONTAINER
transform a coordinate from the coordinate system of the view into the
coordinate system of the composites container
CompositeHierarchyUtilities.TRANSFORM_FROM_CONTAINER_TO_VIEW
transform a coordinate from the coordinate system of the composites
container into the coordinate system of the view
|
void |
clear()
Removes all elements from this CompositeHierarchyPath. |
BaseCompositeContainer |
getBaseCompositeContainer(int level)
Returns the BaseCompositeContainer at the level given by
level. |
BaseCompositeContainer[] |
getBaseCompositeContainerArray()
Returns an array with all BaseCompositeContainers that
belong to the CompositeHierarchyPath. |
java.util.List |
getCompositeList()
Returns a List holding the Composites within
this CompositeHierarchyPath. |
CompositeView |
getCompositeView()
Deprecated. since leveled hierarchies can be build starting from a CompositeGroup it is not ensured that the
BaseCompositeContainer at index 0 is a
CompositeView. Use #getBaseCompositeContainer(int) or
#getBaseCompositeContainerArray() instead. |
BaseCompositeContainer |
getDeepestBaseCompositeContainer()
Returns the deepest BaseCompositeContainer that can be found
in the CompositeHierarchyPath. |
BaseComposite |
getLastPathComposite()
Returns the last element from the CompositeHierarchyPath.
|
boolean |
isEmpty()
Returns a boolean that indicates whether the
CompositeHierarchyPath is empty or not. |
boolean |
isSubPath(CompositeHierarchyPath other)
Returns a boolean that indicates whether the
CompositeHierarchyPath given by other is a
subpath to this CompositeHierarchyPath. |
int |
length()
Returns the length of this path. |
java.lang.String |
toString()
|
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Method Detail |
public int length()
public java.util.List getCompositeList()
List holding the Composites within
this CompositeHierarchyPath.
List holding the Composites.public CompositeView getCompositeView()
CompositeGroup it is not ensured that the
BaseCompositeContainer at index 0 is a
CompositeView. Use #getBaseCompositeContainer(int) or
#getBaseCompositeContainerArray() instead.
CompositeView of the
CompositeHierarchyPath. The CompositeView is
the BaseCompositeContainer at index 0.
CompositeView of the pathpublic BaseCompositeContainer getBaseCompositeContainer(int level)
BaseCompositeContainer at the level given by
level. If the level is to high for this path
null is returned.
null is returned if the given level is to
high for the CompositeHierarchyPath.
level - the level to return the BaseCompositeContainer
for
BaseCompositeContainer at
the given level or nullpublic BaseCompositeContainer getDeepestBaseCompositeContainer()
BaseCompositeContainer that can be found
in the CompositeHierarchyPath. Usually this is the
BaseCompositeContainer that contains the
BaseComposite returned by #getLastPathComposite().
BaseCompositeContainer from the
CompositeHierarchyPathpublic BaseCompositeContainer[] getBaseCompositeContainerArray()
BaseCompositeContainers that
belong to the CompositeHierarchyPath.
BaseCompositeContainers of this
CompositeHierarchyPath.public BaseComposite getLastPathComposite()
CompositeHierarchyPath.
Last element means in this case the element with the highest level.
It always an instance of BaseComposite or a super class
and is in fact the one the CompositeHierarchyPath represents
the path to.
BaseComposite the
CompositeHierarchyPath represents the path topublic void clear()
CompositeHierarchyPath.
public boolean isEmpty()
boolean that indicates whether the
CompositeHierarchyPath is empty or not.
CompositeHierarchyPath is emptypublic boolean isSubPath(CompositeHierarchyPath other)
boolean that indicates whether the
CompositeHierarchyPath given by other is a
subpath to this CompositeHierarchyPath. A
CompositeHierarchyPath is a subpath to another exactly when
all elements of the path are part of the other one.
other - the CompositeHierarchyPath to check against
CompositeHierarchyPath is a subpath of this onepublic java.lang.String toString()
public Transform2D buildTransform(int type)
type and can be used to
| constant | transformation type |
| CompositeHierarchyUtilities.TRANSFORM_FROM_VIEW_TO_COMPOSITE | transform a coordinate from the coordinate system of the view into the coordinate system of the composite |
| CompositeHierarchyUtilities.TRANSFORM_FROM_COMPOSITE_TO_VIEW | transform a coordinate from the coordinate system of the composite into the coordinate system of the view |
| CompositeHierarchyUtilities.TRANSFORM_FROM_VIEW_TO_CONTAINER | transform a coordinate from the coordinate system of the view into the coordinate system of the composites container |
| CompositeHierarchyUtilities.TRANSFORM_FROM_CONTAINER_TO_VIEW | transform a coordinate from the coordinate system of the composites container into the coordinate system of the view |
type - the type of the Transform2D to be returned.
Transform2D of the given type.
|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||