Class cynosurex.graphics3D.Polygon3D
All Packages Class Hierarchy This Package Previous Next Index
Class cynosurex.graphics3D.Polygon3D
java.lang.Object
|
+----cynosurex.graphics3D.Polygon3D
- public class Polygon3D
- extends Object
-
npoints
- The number of points in this polygon
-
xpoints
- The array of x coordinates.
-
XY_bounds
- XY bounds of the polygon.
-
XZ_bounds
- XZ bounds of the polygon.
-
ypoints
- The array of y coordinates.
-
YZ_bounds
- YZ bounds of the polygon.
-
zpoints
- The array of z coordinates.
-
Polygon3D()
- Creates an empty polygon.
-
Polygon3D(int[], int[], int[], int)
- Constructs and initializes a Polygon from the specified parameters.
-
addPoint(int, int, int)
- Appends a point to a polygon.
-
contains(int, int, int)
- Determines whether the point (x, y, z) is inside the Polygon.
-
contains(Point3D)
- Determines whether the 3D point is inside the Polygon.
-
getXYBounds()
- Returns the XY bounding box of the shape.
-
getXZBounds()
- Returns the XZ bounding box of the shape.
-
getYZBounds()
- Returns the YZ bounding box of the shape.
-
translate(int, int, int)
- Translates the vertices by deltaX, deltaY, and deltaZ.
npoints
public int npoints
- The number of points in this polygon
xpoints
public int xpoints[]
- The array of x coordinates.
ypoints
public int ypoints[]
- The array of y coordinates.
zpoints
public int zpoints[]
- The array of z coordinates.
XY_bounds
protected Rectangle XY_bounds
- XY bounds of the polygon.
YZ_bounds
protected Rectangle YZ_bounds
- YZ bounds of the polygon.
XZ_bounds
protected Rectangle XZ_bounds
- XZ bounds of the polygon.
Polygon3D
public Polygon3D()
- Creates an empty polygon.
Polygon3D
public Polygon3D(int xpoints[],
int ypoints[],
int zpoints[],
int npoints)
- Constructs and initializes a Polygon from the specified parameters.
- Parameters:
- xpoints - the array of x coordinates
- ypoints - the array of y coordinates
- zpoints - the array of z coordinates
- npoints - the total number of points in the Polygon
translate
public void translate(int deltaX,
int deltaY,
int deltaZ)
- Translates the vertices by deltaX, deltaY, and deltaZ.
- Parameters:
- deltaX - the amount to move the X coords
- deltaY - the amount to move the Y coords
- deltaZ - the amount to move the Z coords
addPoint
public void addPoint(int x,
int y,
int z)
- Appends a point to a polygon. If 'inside (x, y, z)' or another
operation that calculates the bounding box has already been
performed, this method updates the bounds accordingly.
- Parameters:
- x - the x coordinate of the point
- y - the y coordinate of the point
- z - the z coordinate of the piont
getXYBounds
public Rectangle getXYBounds()
- Returns the XY bounding box of the shape.
- Returns:
- a Rectangle defining the XY bounds of the Polygon.
getYZBounds
public Rectangle getYZBounds()
- Returns the YZ bounding box of the shape.
- Returns:
- a Rectangle defining the YZ bounds of the Polygon.
getXZBounds
public Rectangle getXZBounds()
- Returns the XZ bounding box of the shape.
- Returns:
- a Rectangle defining the XZ bounds of the Polygon.
contains
public boolean contains(Point3D p)
- Determines whether the 3D point is inside the Polygon.
- Parameters:
- x - the X coordinate of the point to be tested
- y - the Y coordinate of the point to be tested
- z - the z coordinate of the point to be tested
contains
public boolean contains(int x,
int y,
int z)
- Determines whether the point (x, y, z) is inside the Polygon.
- Parameters:
- x - the X coordinate of the point to be tested
- y - the Y coordinate of the point to be tested
- z - the z coordinate of the point to be tested
All Packages Class Hierarchy This Package Previous Next Index