|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||
java.lang.Objectcom.tensegrity.composite.geometry.GeometryService
This class contains static methods that are useful when dealing with
geometry-definitions. Method loadGeometriesFromResource loads
a geometry XML file. The various get-methods can be used to retrieve the
attributes defined in this file.
| Method Summary | |
static BaseComposite |
createElementFromItem(GeometryDescriptorItem item)
Returns a BaseComposite that is build from the given
GeometryDescriptorItem. |
static Primitive |
createPrimitiveFromItem(GeometryDescriptorItem item)
Returns a Primitive that is build from the given
GeometryDescriptorItem. |
static GeometryItemProvider |
getGeometryItemProvider()
|
static AttributeSet |
getItemAttributes(int itemType)
Returns an AttributeSet that contains attributes for the
specified itemType. |
static int |
getItemID(java.lang.String itemName)
Returns the corresponding id to the given itemName. |
static java.lang.String |
getItemName(int itemID)
Returns the name of the specified item. |
static void |
loadGeometriesFromResource(java.lang.String filename,
java.lang.Class resourceclass)
Loads the geometry definitions from the given file. |
static void |
loadGeometriesFromResource(java.lang.String filename,
java.lang.Class resourceclass,
boolean overwriteExisting)
Loads the geometry definitions from the given file. |
static void |
registerGeometryItemProvider(GeometryItemProvider provider)
|
static void |
registerItem(int itemID,
java.lang.String name)
Combines the given itemID with the given name. |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Method Detail |
public static final void registerItem(int itemID,
java.lang.String name)
itemID with the given name.
itemID - the id to register.name - the name to register the id with.public static final void registerGeometryItemProvider(GeometryItemProvider provider)
public static final GeometryItemProvider getGeometryItemProvider()
public static final java.lang.String getItemName(int itemID)
itemID - the id to look up the name for.
public static final void loadGeometriesFromResource(java.lang.String filename,
java.lang.Class resourceclass)
throws ReadException,
XMLParseException
filename - the relative filename.resourceclass - the resource class.
ReadException
XMLParseException
public static final void loadGeometriesFromResource(java.lang.String filename,
java.lang.Class resourceclass,
boolean overwriteExisting)
throws ReadException,
XMLParseException
filename - the relative filename.resourceclass - the resource class.overwriteExisting - overwrites existing definitions while
loading new
ReadException
XMLParseExceptionpublic static final int getItemID(java.lang.String itemName)
itemName.
itemName - the name for which to look up the id.
itemName.public static final AttributeSet getItemAttributes(int itemType)
AttributeSet that contains attributes for the
specified itemType.
itemType - the type to retrieve the AttributeSet for.
AttributeSet for the given type.
public static final Primitive createPrimitiveFromItem(GeometryDescriptorItem item)
throws GeometryItemCreationException
Primitive that is build from the given
GeometryDescriptorItem.
item - the GeometryDescriptorItem for the
Primitve.
Primitive that is build from the given
GeometryDescriptorItem.
GeometryItemCreationException - if the Primitive can
not be build.
public static final BaseComposite createElementFromItem(GeometryDescriptorItem item)
throws GeometryItemCreationException
BaseComposite that is build from the given
GeometryDescriptorItem.
item - the GeometryDescriptorItem for the
BaseComposite.
BaseComposite that is build from the given
GeometryDescriptorItem.
GeometryItemCreationException - if the BaseComposite
can not be build.
|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||