Class nurbs.Knot
All Packages  Class Hierarchy  This Package  Previous  Next  Index

Class nurbs.Knot

java.lang.Object
   |
   +----nurbs.Knot

public class Knot
extends Object
implements Cloneable
Sequence of basis functions for use by Nurbs

Variable Index

 o knot
 o numControlPoints
 o numKnots
 o order
 o TOLERANCE

Constructor Index

 o Knot(int, int)
Constructor.
 o Knot(int, int, float[])
Constructor.

Method Index

 o clone()
Performs a deep copy of this Knot.
 o getKnots()
Accessor method for the knot[] array
 o getNumControlPoints()
Return number of control points.
 o interval(float[], float)
Determine where in the knot sequence t lies.
 o makeKnots(float, float)
Produce numKnots knots between tmin and tmax, with tmin, tmax repeated order times and the remaining knots distributed uniformly between.
 o setKnots(float[])
Accessor method for the knot[] array
 o toString()
Creates a String representation for the Knot
 o unionKnots(Knot)
Merge the knot sequence knot2 into the current knot.

Variables

 o order
  protected int order
 o numControlPoints
  protected int numControlPoints
 o numKnots
  protected int numKnots
 o knot
  protected float knot[]
 o TOLERANCE
  public final static float TOLERANCE

Constructors

 o Knot
  public Knot(int order,
              int numControlPoints)
Constructor.
Parameters:
order - the order of the Knot
numControlPoints - the number of control points
 o Knot
  public Knot(int order,
              int numControlPoints,
              float knot[])
Constructor.
Parameters:
order - the order of the Knot
numControlPoints - the number of control points
knot - the array of knot values
Throws: IllegalArgumentException
when the number of knots does not equal the order plus the number of control points

Methods

 o getNumControlPoints
  public int getNumControlPoints()
Return number of control points.
Returns:
the number of control points
 o setKnots
  public void setKnots(float knot[])
Accessor method for the knot[] array
Parameters:
knot - the array of knots
 o getKnots
  public float[] getKnots()
Accessor method for the knot[] array
Returns:
an array of knots
 o interval
  protected static int interval(float knot[],
                                float t)
Determine where in the knot sequence t lies. The knot parameter t must lie within the half-open interval knot[0] <= t < knot[knot.length-1].
Parameters:
knot - the array of knot values
t - the value to compare
Returns:
the array index of the highest-index knot which is less than or equal to t
Throws: IllegalArgumentException
when the knot parameter t is not within the half-open interval
 o makeKnots
  protected void makeKnots(float tmin,
                           float tmax)
Produce numKnots knots between tmin and tmax, with tmin, tmax repeated order times and the remaining knots distributed uniformly between. Existing knot sequence will be overwritten.
Parameters:
tmin - the minimum knot value
tmax - the maximum knot value
 o unionKnots
  protected Knot unionKnots(Knot knot2)
Merge the knot sequence knot2 into the current knot. Do not add knot parameters from knot2 which duplicate parameters already in this knot.
Parameters:
knot2 - the Knot to merge into this
Returns:
a new Knot
 o clone
  public Object clone()
Performs a deep copy of this Knot.
Returns:
a new instance of Knot
Overrides:
clone in class Object
 o toString
  public String toString()
Creates a String representation for the Knot
Returns:
a string representation of the Knot
Overrides:
toString in class Object

All Packages  Class Hierarchy  This Package  Previous  Next  Index