|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.yobotics.simulationconstructionset.LinkGraphics
public class LinkGraphics
Title: SimulationConstructionSet
Description:
Copyright: Copyright (c) 2000
Company: Yobotics, Inc.
Constructor Summary | |
---|---|
LinkGraphics()
Default no-arg constructor. |
|
LinkGraphics(LinkGraphicsDefinition linkGraphicsDefinition)
|
Method Summary | |
---|---|
void |
add3DSFile(java.lang.String fileName)
Adds the specified 3DS Max file to the center of the current coordinate system with a default appearance. |
void |
add3DSFile(java.lang.String fileName,
javax.media.j3d.Appearance app)
Adds the specified 3DS Max file to the center of the current coordinate system with the given appearance. |
void |
add3DSFile(java.net.URL fileURL)
Adds the specified 3DS Max file to the center of the current coordinate system with a default appearance. |
void |
add3DSFile(java.net.URL fileURL,
javax.media.j3d.Appearance app)
Adds the specified 3DS Max file to the center of the current coordinate system with the given appearance. |
void |
addArcTorus(double startAngle,
double endAngle,
double majorRadius,
double minorRadius)
Creates an ArcTorus centered on the current coordinate system. |
void |
addArcTorus(double startAngle,
double endAngle,
double majorRadius,
double minorRadius,
javax.media.j3d.Appearance arcTorusApp)
Creates an ArcTorus centered on the current coordinate system with the specified appearance. |
void |
addBranchGroup(javax.media.j3d.BranchGroup branchGroup)
Adds the specified BranchGroup to the origin of the current coordinate system. |
void |
addCone(double height,
double radius)
Adds a cone with the given height and radius centered on the origin of the current coordinate system. |
void |
addCone(double height,
double radius,
javax.media.j3d.Appearance coneApp)
Adds a cone with the given height, radius and appearance centered on the origin of the current coordinate system. |
void |
addCoordinateSystem(double length)
|
void |
addCoordinateSystem(double length,
javax.media.j3d.Appearance arrowAppearance)
|
void |
addCoordinateSystem(double length,
javax.media.j3d.Appearance xAxisAppearance,
javax.media.j3d.Appearance yAxisAppearance,
javax.media.j3d.Appearance zAxisAppearance,
javax.media.j3d.Appearance arrowAppearance)
Creates a graphical representation of the x, y, and z axis of the current coordinate system centered at its origin. |
void |
addCube(double lx,
double ly,
double lz)
Adds a solid black cube with the specified dimensions centered around the origin of the current coordinate system. |
void |
addCube(double lx,
double ly,
double lz,
javax.media.j3d.Appearance cubeApp)
Adds a solid cube with the given dimensions and appearance centered on the origin of the current coordinate system. |
void |
addCylinder(double height,
double radius)
Adds a soild cylinder with the given radius and height centered on the origin of the current coordinate system. |
void |
addCylinder(double height,
double radius,
javax.media.j3d.Appearance cylApp)
Adds a soild cylinder with the given radius, height and appearance centered on the origin of the current coordinate system. |
void |
addEllipsoid(double xRad,
double yRad,
double zRad)
Adds a solid ellipsoid with the given radii centered on the origin of the current coordinate system. |
void |
addEllipsoid(double xRad,
double yRad,
double zRad,
javax.media.j3d.Appearance ellipsoidApp)
Adds a solid ellipsoid with the given radii and appearance centered on the origin of the current coordinate system. |
void |
addGenTruncatedCone(double height,
double bx,
double by,
double tx,
double ty)
Adds a truncated cone with the given height, base width x, base width y, top width x, and top width y centered on the origin of the current coordinate system. |
void |
addGenTruncatedCone(double height,
double bx,
double by,
double tx,
double ty,
javax.media.j3d.Appearance coneApp)
Adds a truncated cone with the given height, base width x, base width y, top width x, top width y, and appearance centered on the origin of the current coordinate system. |
void |
addGroup(javax.media.j3d.Group group)
Adds the specified group to the origin of the current coordinate system. |
void |
addHemiEllipsoid(double xRad,
double yRad,
double zRad)
Adds a hemi ellipsoid with the given x, y and z radii centered on the current coordinate system. |
void |
addHemiEllipsoid(double xRad,
double yRad,
double zRad,
javax.media.j3d.Appearance hEApp)
Adds a hemi ellipsoid with the given appearance and x, y and z radii centered on the current coordinate system. |
void |
addPolygon(java.util.ArrayList<javax.vecmath.Point3d> polygonPoints,
javax.media.j3d.Appearance appearance)
Creates a polygon centered at the current coordinate system with the given vertices. |
void |
addPolygon(javax.vecmath.Point3d[] polygonPoint)
Creates a polygon centered at the current coordinate system with the given vertices. |
void |
addPolygon(javax.vecmath.Point3d[] polygonPoints,
javax.media.j3d.Appearance appearance)
Creates a polygon centered at the current coordinate system with the given vertices. |
void |
addPolygon(javax.vecmath.Point3f[] polygonPoint)
Creates a polygon centered at the current coordinate system with the given vertices. |
void |
addPolygon(javax.vecmath.Point3f[] polygonPoints,
javax.media.j3d.Appearance appearance)
Creates a polygon centered at the current coordinate system with the given vertices. |
void |
addPyramidCube(double lx,
double ly,
double lz,
double lh)
Creates a pyramid cube centered on the origin of the current coordinate system. |
void |
addPyramidCube(double lx,
double ly,
double lz,
double lh,
javax.media.j3d.Appearance cubeApp)
Creates a pyramid cube with the specified appearance centered on the origin of the current coordinate system. |
void |
addShape(javax.media.j3d.Geometry geometry,
javax.media.j3d.Appearance appearance)
Adds the given geometry with the specified appearance to the origin of the current coordinate system. |
void |
addShape(javax.media.j3d.Shape3D shape)
Adds the specified shape to the origin of the current coordinate system. |
void |
addSphere(double radius)
Adds a solid sphere with the given radius centered on the origin of the current coordinate system. |
void |
addSphere(double radius,
javax.media.j3d.Appearance sphereApp)
Adds a solid sphere with the given radius and appearance centered on the origin of the current coordinate system. |
void |
addVRMLFile(java.lang.String fileName)
Adds the specified VRML file to the center of the current coordinate system using the default appearance. |
void |
addVRMLFile(java.lang.String fileName,
javax.media.j3d.Appearance app)
Adds the specified VRML file to the center of the current coordinate system using the provided appearance. |
void |
addVRMLFile(java.net.URL fileURL)
Adds the specified VRML file to the center of the current coordinate system using the default appearance. |
void |
addVRMLFile(java.net.URL fileURL,
javax.media.j3d.Appearance app)
Adds the specified VRML file to the center of the current coordinate system using the provided appearance. |
void |
addWedge(double lx,
double ly,
double lz)
Adds a solid wedge with the given dimensions centered on the origin of the current coordinate system. |
void |
addWedge(double lx,
double ly,
double lz,
javax.media.j3d.Appearance wedgeApp)
Adds a solid wedge with the given dimensions and appearance centered on the origin of the current coordinate system. |
void |
combine(LinkGraphics linkGraphics)
Merge this with the specified LinkGraphics. |
void |
createInertiaEllipsoid(Link link,
javax.media.j3d.Appearance appearance)
|
javax.vecmath.Color3f |
getColor(javax.media.j3d.Appearance app)
gets a color from an appearance |
LinkGraphicsDefinition |
getLinkGraphicsDefinition()
|
javax.media.j3d.SharedGroup |
getSharedGroup()
Retrieves the shared group containing all of the graphical elements for this link. |
void |
identity()
Resets the coordinate system to the joint origin. |
void |
rotate(double rotAng,
int rotAxis)
Rotates the coordinate system counter clockwise around the specified axis by the given angle in radians. |
void |
rotate(double rotAng,
javax.vecmath.Vector3d rotAxis)
Rotates the coordinate system counter clockwise around the specified axis by the given angle in radians. |
void |
rotate(javax.vecmath.Matrix3d rot)
Rotates the coordinate system as described by the given rotation matrix. |
void |
scale(double scaleFactor)
Scales the coordinate system by the specified scale factor. |
void |
scale(javax.vecmath.Vector3d scaleFactors)
Scales the coordinate system by the specified scale factor. |
void |
translate(double tx,
double ty,
double tz)
Translates from the current position by the specified distances. |
void |
translate(javax.vecmath.Vector3d translation)
Translates from the current position by the specified distances. |
Methods inherited from class java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public LinkGraphics(LinkGraphicsDefinition linkGraphicsDefinition)
public LinkGraphics()
Method Detail |
---|
public LinkGraphicsDefinition getLinkGraphicsDefinition()
public javax.vecmath.Color3f getColor(javax.media.j3d.Appearance app)
public void combine(LinkGraphics linkGraphics)
linkGraphics
- LinkGraphics to combine with.public void translate(double tx, double ty, double tz)
Identity
resets back to the joint origin.
tx
- distance translated in the x directionty
- distance translated in the y directiontz
- distance translated in the z directionpublic void translate(javax.vecmath.Vector3d translation)
Identity
resets back to the joint origin.
translation
- Vector3d representing the translation.public void rotate(double rotAng, int rotAxis)
rotAng
- the angle to rotate around the specified axis in radians.rotAxis
- Axis around which to rotate. Either Link.X, Link.Y or Link.Zpublic void rotate(double rotAng, javax.vecmath.Vector3d rotAxis)
rotAng
- the angle to rotate around the specified axis in radians.rotAxis
- Vector3d describing the axis of rotation.public void rotate(javax.vecmath.Matrix3d rot)
rot
- Matrix3d describing the rotation to be applied.public void scale(double scaleFactor)
scaleFactor
- Factor by which the coordinate system is scaled. For example, 0.5 would
reduce future objects size by 50% whereas 2 would double it.public void scale(javax.vecmath.Vector3d scaleFactors)
scaleFactors
- Vector3d describing the scaling factors in each dimension.public void identity()
public void addShape(javax.media.j3d.Geometry geometry, javax.media.j3d.Appearance appearance)
YoAppearance
and YoGeometry
classes provide a number of basic appearances
and shapes respectively. For more detailed information see the Java3d API.
geometry
- Geometry of the new shape.appearance
- Appearance of the new shape.public void addShape(javax.media.j3d.Shape3D shape)
shape
- Shape3D to be added.public void addBranchGroup(javax.media.j3d.BranchGroup branchGroup)
branchGroup
- BranchGroup to be added.public void addGroup(javax.media.j3d.Group group)
group
- Group to be added.public void addVRMLFile(java.net.URL fileURL)
fileURL
- URL describing the location of the VMRL file.public void addVRMLFile(java.net.URL fileURL, javax.media.j3d.Appearance app)
fileURL
- URL describing the location of the VRML file.app
- Appearance to use in the creation of this shape.public void addVRMLFile(java.lang.String fileName, javax.media.j3d.Appearance app)
fileName
- Path to the desired file.app
- Appearance to use with the VRML file.public void addVRMLFile(java.lang.String fileName)
fileName
- Stringpublic void add3DSFile(java.net.URL fileURL)
fileURL
- URL pointing to the desired 3ds file.public void add3DSFile(java.net.URL fileURL, javax.media.j3d.Appearance app)
fileURL
- URL pointing to the desired 3ds file.app
- Appearance to use with the 3ds model once imported.public void add3DSFile(java.lang.String fileName)
fileName
- File path of the desired 3ds file.public void add3DSFile(java.lang.String fileName, javax.media.j3d.Appearance app)
fileName
- File path to the desired 3ds file.app
- Appearance to use with the model once imported.public void addCoordinateSystem(double length)
public void addCoordinateSystem(double length, javax.media.j3d.Appearance arrowAppearance)
public void addCoordinateSystem(double length, javax.media.j3d.Appearance xAxisAppearance, javax.media.j3d.Appearance yAxisAppearance, javax.media.j3d.Appearance zAxisAppearance, javax.media.j3d.Appearance arrowAppearance)
length
- the length in meters of each axis arrow.public void addCube(double lx, double ly, double lz)
linkGraphics.addCoordinateSystem(0.5);
linkGraphics.addCube(0.25, 0.25, 0.25);
lx
- length of the cube in the x direction.ly
- length of the cube in the y direction.lz
- length of the cube in the z direction.public void addCube(double lx, double ly, double lz, javax.media.j3d.Appearance cubeApp)
linkGraphics.addCoordinateSystem(0.5);
linkGraphics.addCube(0.1, 0.35, 0.2, YoAppearance.Yellow());
lx
- length of the cube in the x direction.ly
- length of the cube in the y direction.lz
- length of the cube in the z direction.cubeApp
- Appearance of the cube. See YoAppearance
for implementations.public void addWedge(double lx, double ly, double lz)
linkGraphics.addCoordinateSystem(0.5);
linkGraphics.addWedge(0.25, 0.25, 0.25);
lx
- length of the wedge in the x direction.ly
- length of the wedge in the y direction.lz
- length of the wedge in the z direction.public void addWedge(double lx, double ly, double lz, javax.media.j3d.Appearance wedgeApp)
linkGraphics.addCoordinateSystem(0.5);
linkGraphics.addWedge(0.35, 0.3, 0.1, YoAppearance.GREEN());
lx
- length of the wedge in the x direction.ly
- length of the wedge in the y direction.lz
- length of the wedge in the z direction.wedgeApp
- Appearance of the wedge. See YoAppearance
for implementations.public void addSphere(double radius)
linkGraphics.addCoordinateSystem(0.5);
linkGraphics.addSphere(0.25);
radius
- radius of the new sphere in meters.public void addSphere(double radius, javax.media.j3d.Appearance sphereApp)
linkGraphics.addCoordinateSystem(0.5);
linkGraphics.addSphere(0.15, YoAppearance.Blue());
radius
- radius of the new sphere in meters.sphereApp
- Appearance to be used with the new sphere. See YoAppearance
for implementations.public void addEllipsoid(double xRad, double yRad, double zRad)
linkGraphics.addCoordinateSystem(0.5);
linkGraphics.addEllipsoid(0.3, 0.2, 0.1);
xRad
- x direction radius in metersyRad
- y direction radius in meterszRad
- z direction radius in meterspublic void addEllipsoid(double xRad, double yRad, double zRad, javax.media.j3d.Appearance ellipsoidApp)
linkGraphics.addCoordinateSystem(0.5);
linkGraphics.addEllipsoid(0.2, 0.2, 0.1, YoAppearance.Red());
xRad
- x direction radius in metersyRad
- y direction radius in meterszRad
- z direction radius in metersellipsoidApp
- Appearance to be used with the new ellipsoid. See YoAppearance
for implementations.public void addCylinder(double height, double radius)
linkGraphics.addCoordinateSystem(0.5);
linkGraphics.addCylinder(0.4, 0.2);
height
- cylinder height in meters.radius
- cylinder radius in meters.public void addCylinder(double height, double radius, javax.media.j3d.Appearance cylApp)
linkGraphics.addCoordinateSystem(0.5);
linkGraphics.addCylinder(0.1, 0.3, YoAppearance.Maroon());
height
- cylinder height in meters.radius
- cylinder radius in meters.cylApp
- Appearance to be used with the new cylinder. See YoAppearance
for implementations.public void addCone(double height, double radius)
linkGraphics.addCoordinateSystem(0.5);
linkGraphics.addCone(0.35, 0.15);
height
- cone height in meters.radius
- cone radius in meters.public void addCone(double height, double radius, javax.media.j3d.Appearance coneApp)
linkGraphics.addCoordinateSystem(0.5);
linkGraphics.addCone(0.2, 0.4, YoAppearance.DarkGreen());
height
- cone height in meters.radius
- cone radius in meters.coneApp
- Appearance to be used with the new cone. See YoAppearance
for implementations.public void addGenTruncatedCone(double height, double bx, double by, double tx, double ty)
linkGraphics.addCoordinateSystem(0.5);
linkGraphics.addGenTruncatedCone(0.3, 0.25, 0.2, 0.15, 0.1);
height
- in metersbx
- x direction width of the base in metersby
- y direction width of the base in meterstx
- x direction width of the top in metersty
- y direction width of the top in meterspublic void addGenTruncatedCone(double height, double bx, double by, double tx, double ty, javax.media.j3d.Appearance coneApp)
linkGraphics.addCoordinateSystem(0.5);
linkGraphics.addGenTruncatedCone(0.25, 0.15, 0.15, 0.05, 0.1, YoAppearance.Navy());
height
- in metersbx
- x direction width of the base in metersby
- y direction width of the base in meterstx
- x direction width of the top in metersty
- y direction width of the top in metersconeApp
- Appearance to be used with the new truncated cone. See YoAppearance
for implementations.public void addHemiEllipsoid(double xRad, double yRad, double zRad)
linkGraphics.addCoordinateSystem(0.5);
linkGraphics.addHemiEllipsoid(0.25, 0.15, 0.35);
xRad
- radius of the ellipsoid in the x direction.yRad
- radius of the ellipsoid in the y direction.zRad
- radius of the ellipsoid in the z direction.public void addHemiEllipsoid(double xRad, double yRad, double zRad, javax.media.j3d.Appearance hEApp)
linkGraphics.addCoordinateSystem(0.5);
linkGraphics.addHemiEllipsoid(0.15, 0.2, 0.4, YoAppearance.DarkRed());
xRad
- radius of the ellipsoid in the x direction.yRad
- radius of the ellipsoid in the y direction.zRad
- radius of the ellipsoid in the z direction.hEApp
- Appearance to be used with the new hemi ellipsoid. See YoAppearance
for implementations.public void addArcTorus(double startAngle, double endAngle, double majorRadius, double minorRadius)
linkGraphics.addCoordinateSystem(0.5);
linkGraphics.addArcTorus(3*Math.PI/2, 5*Math.PI/2, 0.25, 0.15);
startAngle
- Angle in radians at which the torus begins.endAngle
- Angle in radians at which the torus endsmajorRadius
- Distance from the origin to the center of the torusminorRadius
- Distance from the center of the torus to the walls on either side.public void addArcTorus(double startAngle, double endAngle, double majorRadius, double minorRadius, javax.media.j3d.Appearance arcTorusApp)
linkGraphics.addCoordinateSystem(0.5);
linkGraphics.addArcTorus(0, 3*Math.PI/2, 0.30, 0.05);
startAngle
- Angle in radians at which the torus begins.endAngle
- Angle in radians at which the torus ends.majorRadius
- Distance from the origin to the center of the torus.minorRadius
- Distance from the center of the torus to the walls on either side.arcTorusApp
- Appearance to be used with the new arctorus. See YoAppearance
for implementations.public void addPyramidCube(double lx, double ly, double lz, double lh)
linkGraphics.addCoordinateSystem(0.5);
linkGraphics.addPyramidCube(0.2, 0.2, 0.2, 0.2);
lx
- Length in meters of the cube. (x direction)ly
- Width in meters of the cube. (y direction)lz
- Height of the cube in meters. (z direction)lh
- Height of the pyramids in meters.public void addPyramidCube(double lx, double ly, double lz, double lh, javax.media.j3d.Appearance cubeApp)
linkGraphics.addCoordinateSystem(0.5);
linkGraphics.addPyramidCube(0.2, 0.2, 0.2, 0.2);
lx
- Length in meters of the cube. (x direction)ly
- Width in meters of the cube. (y direction)lz
- Height of the cube in meters. (z direction)lh
- Height of the pyramids in meters.cubeApp
- Appearance to be used with the new pyramid cube. See YoAppearance
for implementations.public void addPolygon(javax.vecmath.Point3f[] polygonPoint)
polygonPoint
- Point3f array containing the desired points.public void addPolygon(javax.vecmath.Point3f[] polygonPoints, javax.media.j3d.Appearance appearance)
polygonPoints
- Point3f array containing the desired points.appearance
- Appearance to be used with the new polygon. See YoAppearance
for implementations.public void addPolygon(java.util.ArrayList<javax.vecmath.Point3d> polygonPoints, javax.media.j3d.Appearance appearance)
polygonPoints
- ArrayList containing the points.appearance
- Appearance to be used with the new polygon. See YoAppearance
for implementations.public void addPolygon(javax.vecmath.Point3d[] polygonPoint)
polygonPoint
- Array containing Point3d's to be used when generating the shape.public void addPolygon(javax.vecmath.Point3d[] polygonPoints, javax.media.j3d.Appearance appearance)
polygonPoints
- Array containing the pointsappearance
- Appearance to be used with the new polygon. See YoAppearance
for implementations.public void createInertiaEllipsoid(Link link, javax.media.j3d.Appearance appearance)
public javax.media.j3d.SharedGroup getSharedGroup()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |