vclip
Class ClosestPointPair

java.lang.Object
  extended byvclip.ClosestPointPair

public class ClosestPointPair
extends java.lang.Object

Describes a pair of closest points and features between two polyhedra or polytrees.

Author:
John E. Lloyd

Field Summary
 double dist
          Distance between the two points
 Feature feat1
          Closest feature on the first polyhedron.
 Feature feat2
          Closest feature on the second polyhedron.
 javax.vecmath.Vector3d nrml
          Normal (in coordinates of the first polyhedron).
 javax.vecmath.Point3d pnt1
          Closest point on the first polyhedron.
 javax.vecmath.Point3d pnt2
          Closest point on the second polyhedron.
 
Constructor Summary
ClosestPointPair()
          Creates a ClosestPointPair and initializes it as being empty.
ClosestPointPair(ClosestPointPair pair)
          Creates a ClosestPointPair which is a copy of an existing one.
 
Method Summary
 void clear()
          Clears the values in this pair.
 boolean epsilonEquals(ClosestPointPair pair, double eps)
          Returns true if the contact points for this pair are within epsilon of the contact points of the argument pair.
 boolean featureEquals(ClosestPointPair pair)
          Returns true if this pair has the same features as the argument pair.
 boolean isClear()
          Returns true if this pair has no set value.
 void set(ClosestPointPair pair)
          Sets this pair to the value of another one.
 void setFeatures(Feature f1, Feature f2)
          Sets the closest features.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

pnt1

public javax.vecmath.Point3d pnt1
Closest point on the first polyhedron.


pnt2

public javax.vecmath.Point3d pnt2
Closest point on the second polyhedron.


nrml

public javax.vecmath.Vector3d nrml
Normal (in coordinates of the first polyhedron).


feat1

public Feature feat1
Closest feature on the first polyhedron.


feat2

public Feature feat2
Closest feature on the second polyhedron.


dist

public double dist
Distance between the two points

Constructor Detail

ClosestPointPair

public ClosestPointPair()
Creates a ClosestPointPair and initializes it as being empty.


ClosestPointPair

public ClosestPointPair(ClosestPointPair pair)
Creates a ClosestPointPair which is a copy of an existing one.

Parameters:
pair - pair to copy from
Method Detail

set

public void set(ClosestPointPair pair)
Sets this pair to the value of another one.

Parameters:
pair - pair to copy from

clear

public void clear()
Clears the values in this pair.


isClear

public boolean isClear()
Returns true if this pair has no set value.

Returns:
true if this pair has no set value

setFeatures

public void setFeatures(Feature f1,
                        Feature f2)
Sets the closest features.

Parameters:
f1 - First feature
f2 - Second feature

featureEquals

public boolean featureEquals(ClosestPointPair pair)
Returns true if this pair has the same features as the argument pair.

Parameters:
pair - pair to check features against
Returns:
true if this pair and the supplied pair have the same features

epsilonEquals

public boolean epsilonEquals(ClosestPointPair pair,
                             double eps)
Returns true if the contact points for this pair are within epsilon of the contact points of the argument pair. The comparison is performed using an L-infinity metric.

Parameters:
pair - pair to check features against
eps - tolerance for comparing points
Returns:
true if the contact points of this pair and the supplied pair are within eps of each other