|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectcynosurex.graphics3D.Polygon3D
public class Polygon3D
A polygon consists of a list of x, y, and z coordinates.
| Field Summary | |
|---|---|
int |
npoints
The number of points in this polygon |
int[] |
xpoints
The array of x coordinates. |
protected java.awt.Rectangle |
XY_bounds
XY bounds of the polygon. |
protected java.awt.Rectangle |
XZ_bounds
XZ bounds of the polygon. |
int[] |
ypoints
The array of y coordinates. |
protected java.awt.Rectangle |
YZ_bounds
YZ bounds of the polygon. |
int[] |
zpoints
The array of z coordinates. |
| Fields inherited from interface cynosurex.internal.CommonInterface |
|---|
copyright, copyrightYears, notice, program, version |
| Fields inherited from interface cynosurex.internal.AuthorCommon |
|---|
author, copyrightSymbol, noticeMsg, rights |
| Fields inherited from interface cynosurex.internal.CompanyCommon |
|---|
company, email, website |
| Constructor Summary | |
|---|---|
Polygon3D()
Creates an empty polygon. |
|
Polygon3D(int[] xpoints,
int[] ypoints,
int[] zpoints,
int npoints)
Constructs and initializes a Polygon from the specified parameters. |
|
| Method Summary | |
|---|---|
void |
addPoint(int x,
int y,
int z)
Appends a point to a polygon. |
boolean |
contains(int x,
int y,
int z)
Determines whether the point (x, y, z) is inside the Polygon. |
boolean |
contains(Point3D p)
Determines whether the 3D point is inside the Polygon. |
java.awt.Rectangle |
getXYBounds()
Returns the XY bounding box of the shape. |
java.awt.Rectangle |
getXZBounds()
Returns the XZ bounding box of the shape. |
java.awt.Rectangle |
getYZBounds()
Returns the YZ bounding box of the shape. |
void |
translate(int deltaX,
int deltaY,
int deltaZ)
Translates the vertices by deltaX, deltaY, and deltaZ. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
public int npoints
public int[] xpoints
public int[] ypoints
public int[] zpoints
protected java.awt.Rectangle XY_bounds
protected java.awt.Rectangle YZ_bounds
protected java.awt.Rectangle XZ_bounds
| Constructor Detail |
|---|
public Polygon3D()
public Polygon3D(int[] xpoints,
int[] ypoints,
int[] zpoints,
int npoints)
xpoints - the array of x coordinatesypoints - the array of y coordinateszpoints - the array of z coordinatesnpoints - the total number of points in the Polygon| Method Detail |
|---|
public void translate(int deltaX,
int deltaY,
int deltaZ)
deltaX - the amount to move the X coordsdeltaY - the amount to move the Y coordsdeltaZ - the amount to move the Z coords
public void addPoint(int x,
int y,
int z)
x - the x coordinate of the pointy - the y coordinate of the pointz - the z coordinate of the piontpublic java.awt.Rectangle getXYBounds()
public java.awt.Rectangle getYZBounds()
public java.awt.Rectangle getXZBounds()
public boolean contains(Point3D p)
p - the point to be tested
public boolean contains(int x,
int y,
int z)
x - the X coordinate of the point to be testedy - the Y coordinate of the point to be testedz - the z coordinate of the point to be tested
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||