convexhull3d
Class SpatialPoint

java.lang.Object
  |
  +--convexhull3d.SpatialPoint

public class SpatialPoint
extends java.lang.Object

A 3D spatial point, used to represent both input points and hull vertices.

Author:
John E. Lloyd, Winter 2003

Field Summary
 double x
          The x coordinate.
 double y
          The y coordinate.
 double z
          The z coordinate.
 
Constructor Summary
SpatialPoint(double x, double y, double z, int idx)
          Constructs a SpatialPoint with the coordinates (x,y,z) and a point index given by idx.
 
Method Summary
 boolean epsilonEquals(SpatialPoint pnt, double epsilon)
          Returns true if this point equals another point within a prescribed tolerance.
 boolean equals(SpatialPoint pnt)
          Returns true if this point equals another point.
 double getCoord(int i)
          Returns the value of the i-th coordinate of the point.
 int getHullFaceIndex()
          Gets the hull face index for this point.
 int getMergedFaceIndex()
          Gets the merged face index for this point.
 int getPointIndex()
          Gets the point index for this point.
 void setHullFaceIndex(int idx)
          Sets the hull face index for this point.
 void setMergedFaceIndex(int idx)
          Sets the merged face index for this point.
 void setPointIndex(int idx)
          Sets the point index for this point.
 java.lang.String toString()
           
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

x

public double x
The x coordinate.


y

public double y
The y coordinate.


z

public double z
The z coordinate.

Constructor Detail

SpatialPoint

public SpatialPoint(double x,
                    double y,
                    double z,
                    int idx)
Constructs a SpatialPoint with the coordinates (x,y,z) and a point index given by idx. The point index should correspond to the location of the point within the input data.

Parameters:
x - the x coordinate
y - the y coordinate
z - the z coordinate
idx - the point index
Method Detail

getCoord

public double getCoord(int i)
Returns the value of the i-th coordinate of the point.

Parameters:
i - coordinate index (with 0,1,2 corresponding to x,y,z).
Returns:
coordinate value

setPointIndex

public void setPointIndex(int idx)
Sets the point index for this point. Not currently used.

Parameters:
idx - new point index

getPointIndex

public int getPointIndex()
Gets the point index for this point. This is nominally the location of the point within the input point set.

Returns:
point index

setHullFaceIndex

public void setHullFaceIndex(int idx)
Sets the hull face index for this point.

Parameters:
idx - new hull face index
See Also:
getHullFaceIndex()

getHullFaceIndex

public int getHullFaceIndex()
Gets the hull face index for this point. The hull face index is the location of the point within the hull face vertex list (i.e., the list returned by ConvexHull3D.getHullFaceVertices(). If this point is not associated with a hull face vertex, then -1 is returned.

Returns:
hull face index
See Also:
ConvexHull3D.getHullFaceVertices()

setMergedFaceIndex

public void setMergedFaceIndex(int idx)
Sets the merged face index for this point.

Parameters:
idx - new merged face index
See Also:
getMergedFaceIndex()

getMergedFaceIndex

public int getMergedFaceIndex()
Gets the merged face index for this point. The merged face index is the location of the point within the merged face vertex list (i.e., the list returned by ConvexHull3D.getMergedFaceVertices(). If this point is not associated with a merged face vertex, then -1 is returned.

Returns:
merged face index
See Also:
ConvexHull3D.getMergedFaceVertices()

equals

public boolean equals(SpatialPoint pnt)
Returns true if this point equals another point.

Parameters:
pnt - the other point
Returns:
true if the points are equal

epsilonEquals

public boolean epsilonEquals(SpatialPoint pnt,
                             double epsilon)
Returns true if this point equals another point within a prescribed tolerance.

Parameters:
pnt - the other point
epsilon - tolerance value
Returns:
true if the points are equal

toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object