|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectus.ihmc.graphics3DAdapter.graphics.Graphics3DObject
public class Graphics3DObject
Field Summary | |
---|---|
static Axis |
X
|
static Axis |
Y
|
static Axis |
Z
|
Constructor Summary | |
---|---|
Graphics3DObject()
Default no-arg constructor. |
|
Graphics3DObject(java.util.ArrayList<Graphics3DPrimitiveInstruction> graphics3DInstructions)
|
Method Summary | |
---|---|
Graphics3DAddMeshDataInstruction |
addArcTorus(double startAngle,
double endAngle,
double majorRadius,
double minorRadius)
Creates an ArcTorus centered on the current coordinate system. |
Graphics3DAddMeshDataInstruction |
addArcTorus(double startAngle,
double endAngle,
double majorRadius,
double minorRadius,
AppearanceDefinition arcTorusApp)
Creates an ArcTorus centered on the current coordinate system with the specified appearance. |
void |
addArrow(double length,
AppearanceDefinition baseAppearance,
AppearanceDefinition headAppearance)
|
Graphics3DAddMeshDataInstruction |
addCone(double height,
double radius)
Adds a cone with the given height and radius centered on the origin of the current coordinate system. |
Graphics3DAddMeshDataInstruction |
addCone(double height,
double radius,
AppearanceDefinition 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,
AppearanceDefinition arrowAppearance)
|
void |
addCoordinateSystem(double length,
AppearanceDefinition xAxisAppearance,
AppearanceDefinition yAxisAppearance,
AppearanceDefinition zAxisAppearance,
AppearanceDefinition arrowAppearance)
Creates a graphical representation of the x, y, and z axis of the current coordinate system centered at its origin. |
Graphics3DAddMeshDataInstruction |
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. |
Graphics3DAddMeshDataInstruction |
addCube(double lx,
double ly,
double lz,
AppearanceDefinition cubeApp)
Adds a solid cube with the given dimensions and appearance centered on the origin of the current coordinate system. |
Graphics3DAddMeshDataInstruction |
addCylinder(double height,
double radius)
Adds a soild cylinder with the given radius and height centered on the origin of the current coordinate system. |
Graphics3DAddMeshDataInstruction |
addCylinder(double height,
double radius,
AppearanceDefinition cylApp)
Adds a soild cylinder with the given radius, height and appearance centered on the origin of the current coordinate system. |
Graphics3DAddMeshDataInstruction |
addEllipsoid(double xRadius,
double yRadius,
double zRadius)
Adds a solid ellipsoid with the given radii centered on the origin of the current coordinate system. |
Graphics3DAddMeshDataInstruction |
addEllipsoid(double xRadius,
double yRadius,
double zRadius,
AppearanceDefinition ellipsoidApp)
Adds a solid ellipsoid with the given radii and appearance centered on the origin of the current coordinate system. |
Graphics3DAddMeshDataInstruction |
addExtrudedPolygon(java.util.List<javax.vecmath.Point2d> polygonPoints,
double height)
|
Graphics3DAddMeshDataInstruction |
addExtrudedPolygon(java.util.List<javax.vecmath.Point2d> polygonPoints,
double height,
AppearanceDefinition appearance)
|
Graphics3DAddExtusionInstruction |
addExtrusion(java.awt.image.BufferedImage bufferedImageToExtrude,
double thickness,
AppearanceDefinition appearance)
Create an extrusion of a BufferedImage. |
Graphics3DAddMeshDataInstruction |
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. |
Graphics3DAddMeshDataInstruction |
addGenTruncatedCone(double height,
double bx,
double by,
double tx,
double ty,
AppearanceDefinition 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. |
Graphics3DInstruction |
addHeightMap(HeightMap heightMap,
int xPointsPerSide,
int yPointsPerSide,
AppearanceDefinition appearance)
|
Graphics3DAddMeshDataInstruction |
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. |
Graphics3DAddMeshDataInstruction |
addHemiEllipsoid(double xRad,
double yRad,
double zRad,
AppearanceDefinition hEApp)
Adds a hemi ellipsoid with the given appearance and x, y and z radii centered on the current coordinate system. |
void |
addInstruction(Graphics3DPrimitiveInstruction instruction)
|
Graphics3DAddMeshDataInstruction |
addMeshData(MeshDataHolder meshData,
AppearanceDefinition meshAppearance)
|
void |
addModelFile(java.lang.String fileName)
Adds the specified model file to the center of the current coordinate system with a default appearance. |
Graphics3DAddModelFileInstruction |
addModelFile(java.lang.String fileName,
AppearanceDefinition app)
|
Graphics3DAddModelFileInstruction |
addModelFile(java.lang.String fileName,
java.util.ArrayList<java.lang.String> resourceDirectories,
AppearanceDefinition app)
|
Graphics3DAddModelFileInstruction |
addModelFile(java.lang.String fileName,
java.lang.String submesh,
boolean centerSubmesh,
java.util.ArrayList<java.lang.String> resourceDirectories,
AppearanceDefinition app)
|
void |
addModelFile(java.net.URL fileURL)
Adds the specified 3DS Max file to the center of the current coordinate system with a default appearance. |
void |
addModelFile(java.net.URL fileURL,
AppearanceDefinition yoAppearanceDefinition)
Adds the specified 3DS Max file to the center of the current coordinate system with the given appearance. |
Graphics3DAddMeshDataInstruction |
addPolygon(AppearanceDefinition yoAppearance,
javax.vecmath.Point3d... polygonPoints)
|
Graphics3DAddMeshDataInstruction |
addPolygon(java.util.ArrayList<javax.vecmath.Point3d> polygonPoints)
|
Graphics3DAddMeshDataInstruction |
addPolygon(java.util.ArrayList<javax.vecmath.Point3d> polygonPoints,
AppearanceDefinition yoAppearance)
Creates a polygon centered at the current coordinate system with the given vertices. |
Graphics3DAddMeshDataInstruction |
addPolygon(javax.vecmath.Point3d[] polygonPoint)
Creates a polygon centered at the current coordinate system with the given vertices. |
Graphics3DAddMeshDataInstruction |
addPolygon(javax.vecmath.Point3d[] polygonPoints,
AppearanceDefinition yoAppearance)
Creates a polygon centered at the current coordinate system with the given vertices. |
Graphics3DAddMeshDataInstruction |
addPyramidCube(double lx,
double ly,
double lz,
double lh)
Creates a pyramid cube centered on the origin of the current coordinate system. |
Graphics3DAddMeshDataInstruction |
addPyramidCube(double lx,
double ly,
double lz,
double lh,
AppearanceDefinition cubeApp)
Creates a pyramid cube with the specified appearance centered on the origin of the current coordinate system. |
Graphics3DAddMeshDataInstruction |
addSphere(double radius)
Adds a solid sphere with the given radius centered on the origin of the current coordinate system. |
Graphics3DAddMeshDataInstruction |
addSphere(double radius,
AppearanceDefinition sphereApp)
Adds a solid sphere with the given radius and appearance centered on the origin of the current coordinate system. |
Graphics3DInstruction |
addTeaPot(AppearanceDefinition appearance)
|
Graphics3DAddExtusionInstruction |
addText(java.lang.String text,
double thickness,
AppearanceDefinition yoAppearance)
|
Graphics3DAddMeshDataInstruction |
addWedge(double lx,
double ly,
double lz)
Adds a solid wedge with the given dimensions centered on the origin of the current coordinate system. |
Graphics3DAddMeshDataInstruction |
addWedge(double lx,
double ly,
double lz,
AppearanceDefinition wedgeApp)
Adds a solid wedge with the given dimensions and appearance centered on the origin of the current coordinate system. |
void |
combine(Graphics3DObject Graphics3DObject)
Merge this with the specified Graphics3DObject. |
void |
createInertiaEllipsoid(javax.vecmath.Matrix3d momentOfInertia,
javax.vecmath.Vector3d comOffset,
double mass,
AppearanceDefinition appearance)
|
java.util.ArrayList<Graphics3DPrimitiveInstruction> |
getGraphics3DInstructions()
|
void |
identity()
Resets the coordinate system to the joint origin. |
boolean |
isChangeable()
|
void |
notifySelectedListeners(Graphics3DNode graphics3dNode,
ModifierKeyInterface modifierKeyHolder,
javax.vecmath.Point3d location,
javax.vecmath.Point3d cameraPosition,
javax.vecmath.Quat4d cameraRotation)
|
void |
registerSelectedListener(SelectedListener selectedListener)
|
void |
rotate(javax.vecmath.AxisAngle4d rotationAxisAngle)
|
void |
rotate(double rotationAngle,
Axis rotationAxis)
Rotates the coordinate system counter clockwise around the specified axis by the given angle in radians. |
void |
rotate(double rotationAngle,
javax.vecmath.Vector3d rotationAxis)
Rotates the coordinate system counter clockwise around the specified axis by the given angle in radians. |
void |
rotate(javax.vecmath.Matrix3d rotationMatrix)
Rotates the coordinate system as described by the given rotation matrix. |
Graphics3DScaleInstruction |
scale(double scaleFactor)
Scales the coordinate system by the specified scale factor. |
Graphics3DScaleInstruction |
scale(javax.vecmath.Vector3d scaleFactors)
Scales the coordinate system by the specified scale factor. |
void |
setChangeable(boolean changeable)
|
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 |
Field Detail |
---|
public static final Axis X
public static final Axis Y
public static final Axis Z
Constructor Detail |
---|
public Graphics3DObject(java.util.ArrayList<Graphics3DPrimitiveInstruction> graphics3DInstructions)
public Graphics3DObject()
Method Detail |
---|
public java.util.ArrayList<Graphics3DPrimitiveInstruction> getGraphics3DInstructions()
public void combine(Graphics3DObject Graphics3DObject)
graphics3DObject
- Graphics3DObject to combine with.public void addInstruction(Graphics3DPrimitiveInstruction instruction)
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 rotationAngle, Axis rotationAxis)
rotationAngle
- the angle to rotate around the specified axis in radians.rotationAxis
- Axis around which to rotate. Either Link.X, Link.Y or Link.Zpublic void rotate(double rotationAngle, javax.vecmath.Vector3d rotationAxis)
roationAngle
- the angle to rotate around the specified axis in radians.rotationAxis
- Vector3d describing the axis of rotation.public void rotate(javax.vecmath.Matrix3d rotationMatrix)
rotationMatrix
- Matrix3d describing the rotation to be applied.public void rotate(javax.vecmath.AxisAngle4d rotationAxisAngle)
public Graphics3DScaleInstruction 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 Graphics3DScaleInstruction scale(javax.vecmath.Vector3d scaleFactors)
scaleFactors
- Vector3d describing the scaling factors in each dimension.
public void identity()
public void addModelFile(java.net.URL fileURL)
fileURL
- URL pointing to the desired 3ds file.public void addModelFile(java.net.URL fileURL, AppearanceDefinition yoAppearanceDefinition)
fileURL
- URL pointing to the desired 3ds file.yoAppearanceDefinition
- Appearance to use with the 3ds model once imported.public void addModelFile(java.lang.String fileName)
fileName
- File path of the desired 3ds file.public Graphics3DAddModelFileInstruction addModelFile(java.lang.String fileName, AppearanceDefinition app)
fileName
- app
-
public Graphics3DAddModelFileInstruction addModelFile(java.lang.String fileName, java.lang.String submesh, boolean centerSubmesh, java.util.ArrayList<java.lang.String> resourceDirectories, AppearanceDefinition app)
public Graphics3DAddModelFileInstruction addModelFile(java.lang.String fileName, java.util.ArrayList<java.lang.String> resourceDirectories, AppearanceDefinition app)
public void addCoordinateSystem(double length)
public void addCoordinateSystem(double length, AppearanceDefinition arrowAppearance)
public void addCoordinateSystem(double length, AppearanceDefinition xAxisAppearance, AppearanceDefinition yAxisAppearance, AppearanceDefinition zAxisAppearance, AppearanceDefinition arrowAppearance)
length
- the length in meters of each axis arrow.public void addArrow(double length, AppearanceDefinition baseAppearance, AppearanceDefinition headAppearance)
public Graphics3DAddMeshDataInstruction 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 Graphics3DAddMeshDataInstruction addCube(double lx, double ly, double lz, AppearanceDefinition 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 Graphics3DAddMeshDataInstruction 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 Graphics3DAddMeshDataInstruction addWedge(double lx, double ly, double lz, AppearanceDefinition 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 Graphics3DAddMeshDataInstruction addSphere(double radius)
linkGraphics.addCoordinateSystem(0.5);
linkGraphics.addSphere(0.25);
radius
- radius of the new sphere in meters.public Graphics3DAddMeshDataInstruction addSphere(double radius, AppearanceDefinition 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 Graphics3DAddMeshDataInstruction addMeshData(MeshDataHolder meshData, AppearanceDefinition meshAppearance)
public Graphics3DAddMeshDataInstruction addEllipsoid(double xRadius, double yRadius, double zRadius)
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 Graphics3DAddMeshDataInstruction addEllipsoid(double xRadius, double yRadius, double zRadius, AppearanceDefinition 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 Graphics3DAddMeshDataInstruction 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 Graphics3DAddMeshDataInstruction addCylinder(double height, double radius, AppearanceDefinition 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 Graphics3DAddMeshDataInstruction 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 Graphics3DAddMeshDataInstruction addCone(double height, double radius, AppearanceDefinition 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 Graphics3DAddMeshDataInstruction 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 Graphics3DAddMeshDataInstruction addGenTruncatedCone(double height, double bx, double by, double tx, double ty, AppearanceDefinition 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 Graphics3DAddMeshDataInstruction 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 Graphics3DAddMeshDataInstruction addHemiEllipsoid(double xRad, double yRad, double zRad, AppearanceDefinition 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 Graphics3DAddMeshDataInstruction 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 Graphics3DAddMeshDataInstruction addArcTorus(double startAngle, double endAngle, double majorRadius, double minorRadius, AppearanceDefinition 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 Graphics3DAddMeshDataInstruction 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 Graphics3DAddMeshDataInstruction addPyramidCube(double lx, double ly, double lz, double lh, AppearanceDefinition 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 Graphics3DAddMeshDataInstruction addPolygon(java.util.ArrayList<javax.vecmath.Point3d> polygonPoints)
public Graphics3DAddMeshDataInstruction addPolygon(java.util.ArrayList<javax.vecmath.Point3d> polygonPoints, AppearanceDefinition yoAppearance)
polygonPoints
- ArrayList containing the points.appearance
- Appearance to be used with the new polygon. See YoAppearance
for implementations.public Graphics3DAddMeshDataInstruction addPolygon(javax.vecmath.Point3d[] polygonPoint)
polygonPoint
- Array containing Point3d's to be used when generating the shape.public Graphics3DAddMeshDataInstruction addPolygon(javax.vecmath.Point3d[] polygonPoints, AppearanceDefinition yoAppearance)
polygonPoints
- Array containing the pointsappearance
- Appearance to be used with the new polygon. See YoAppearance
for implementations.public Graphics3DAddMeshDataInstruction addPolygon(AppearanceDefinition yoAppearance, javax.vecmath.Point3d... polygonPoints)
public Graphics3DAddMeshDataInstruction addExtrudedPolygon(java.util.List<javax.vecmath.Point2d> polygonPoints, double height)
public Graphics3DAddMeshDataInstruction addExtrudedPolygon(java.util.List<javax.vecmath.Point2d> polygonPoints, double height, AppearanceDefinition appearance)
public Graphics3DAddExtusionInstruction addExtrusion(java.awt.image.BufferedImage bufferedImageToExtrude, double thickness, AppearanceDefinition appearance)
bufferedImageToExtrude
- BufferedImage to extrudethickness
- Thinkness of extrusionappearance
- Appearancepublic Graphics3DAddExtusionInstruction addText(java.lang.String text, double thickness, AppearanceDefinition yoAppearance)
public void createInertiaEllipsoid(javax.vecmath.Matrix3d momentOfInertia, javax.vecmath.Vector3d comOffset, double mass, AppearanceDefinition appearance)
public Graphics3DInstruction addTeaPot(AppearanceDefinition appearance)
public Graphics3DInstruction addHeightMap(HeightMap heightMap, int xPointsPerSide, int yPointsPerSide, AppearanceDefinition appearance)
public void notifySelectedListeners(Graphics3DNode graphics3dNode, ModifierKeyInterface modifierKeyHolder, javax.vecmath.Point3d location, javax.vecmath.Point3d cameraPosition, javax.vecmath.Quat4d cameraRotation)
public void registerSelectedListener(SelectedListener selectedListener)
public boolean isChangeable()
public void setChangeable(boolean changeable)
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |