com.hedgehog.math.functions
Class BivariateRationalBSplinePolynomialFunction

java.lang.Object
  extended by com.hedgehog.HObject
      extended by com.hedgehog.math.functions.Function
          extended by com.hedgehog.math.functions.BivariateRationalBSplinePolynomialFunction
All Implemented Interfaces:
java.lang.Comparable, java.util.Comparator

public class BivariateRationalBSplinePolynomialFunction
extends Function

Title: BivariateRationalBSplinePolynomialFunction - models a bivariate rational B-spline polynomial function

Description: Models a bivariate rational B-spline polynomial function, frequently used when modelling BSpline surfaces.

For further details refer to "The NURBS Book" by L Peigl and W Tiller, 2nd edition, Springer, 1997.

Copyright: Copyright (c) Hedgehog Software 2007-2009.

Company: Hedgehog Software

Since:
1.1
Version:
1.1

Field Summary
protected  int mpDegree
          Degree p in u-direction.
protected  int mqDegree
          Degree q in v-direction.
protected  KnotVector muKnotVector
          Knot vector in u-direction.
protected  KnotVector mvKnotVector
          Knot vector in v-direction.
protected  FloatingPointFullMatrix mWeights
          Control point weight matrix.
 
Fields inherited from class com.hedgehog.math.functions.Function
method
 
Fields inherited from class com.hedgehog.HObject
mID, mName
 
Constructor Summary
BivariateRationalBSplinePolynomialFunction()
          Default constructor.
BivariateRationalBSplinePolynomialFunction(BivariateRationalBSplinePolynomialFunction object)
          Copy constructor.
BivariateRationalBSplinePolynomialFunction(int pDegree, int qDegree, KnotVector uKnotVector, KnotVector vKnotVector, FloatingPointFullMatrix weights)
          Constructor.
 
Method Summary
 int getDegreeP()
          Returns the degree p.
 int getDegreeQ()
          Returns the degree q.
 KnotVector getKnotVectorU()
          Returns the knot vector in the u-direction.
 KnotVector getKnotVectorV()
          Returns the knot vector in the v-direction.
 double getValue(int i, int j, double u, double v)
          Returns the value of a bivariate rational B-spline polynomial given i, j, u and v
 FloatingPointFullMatrix getWeights()
          Returns the control point weight matrix.
 boolean isValid()
          Tests the validity of this object.
 void setDegreeP(int pDegree)
          Sets the degree p.
 void setDegreeQ(int qDegree)
          Sets the degree q.
 void setKnotVectorU(KnotVector uKnotVector)
          Sets the knot vector in the u-direction.
 void setKnotVectorV(KnotVector vKnotVector)
          Sets the knot vector in the v-direction.
 void setWeights(FloatingPointFullMatrix weights)
          Sets the control point weight matrix.
 java.lang.String toString()
          Returns a String representation of a BivariateRationalBSplinePolynomialFunction object.
 
Methods inherited from class com.hedgehog.math.functions.Function
getMethod, setMethod
 
Methods inherited from class com.hedgehog.HObject
clone, compare, compareTo, copy, equals, getID, getName, hashCode, hasID, hasName, setID, setName
 
Methods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, wait, wait, wait
 

Field Detail

mpDegree

protected int mpDegree
Degree p in u-direction.


mqDegree

protected int mqDegree
Degree q in v-direction.


muKnotVector

protected KnotVector muKnotVector
Knot vector in u-direction.


mvKnotVector

protected KnotVector mvKnotVector
Knot vector in v-direction.


mWeights

protected FloatingPointFullMatrix mWeights
Control point weight matrix.

Constructor Detail

BivariateRationalBSplinePolynomialFunction

public BivariateRationalBSplinePolynomialFunction()
Default constructor. Sets the p-degree and q-degree to 1. Creates new non-null but empty knot vectors. Creates a new non-null but empty control point matrix.


BivariateRationalBSplinePolynomialFunction

public BivariateRationalBSplinePolynomialFunction(int pDegree,
                                                  int qDegree,
                                                  KnotVector uKnotVector,
                                                  KnotVector vKnotVector,
                                                  FloatingPointFullMatrix weights)
                                           throws java.lang.IllegalArgumentException
Constructor.

Parameters:
pDegree - p-degree in the u-direction.
qDegree - q-degree in the u-direction.
uKnotVector - Knot vector in the u-direction.
vKnotVector - Knot vector in the v-direction.
weights - Control point weight matrix.
Throws:
java.lang.IllegalArgumentException - Thrown if pDegree or qDegree < 1, the knot vectors are of size < 1 or are not non-decreasing.

BivariateRationalBSplinePolynomialFunction

public BivariateRationalBSplinePolynomialFunction(BivariateRationalBSplinePolynomialFunction object)
Copy constructor.

Parameters:
object - Object to copy.
Method Detail

getDegreeP

public int getDegreeP()
Returns the degree p.

Returns:
The degree p.

setDegreeP

public void setDegreeP(int pDegree)
Sets the degree p.

Parameters:
pDegree - New degree p.

getDegreeQ

public int getDegreeQ()
Returns the degree q.

Returns:
The degree q.

setDegreeQ

public void setDegreeQ(int qDegree)
Sets the degree q.

Parameters:
qDegree - New degree q.

getKnotVectorU

public KnotVector getKnotVectorU()
Returns the knot vector in the u-direction.

Returns:
The knot vector in the u-direction.

getKnotVectorV

public KnotVector getKnotVectorV()
Returns the knot vector in the v-direction.

Returns:
The knot vector in the v-direction.

setKnotVectorU

public void setKnotVectorU(KnotVector uKnotVector)
Sets the knot vector in the u-direction.

Parameters:
uKnotVector - New knot vector in the u-direction.

setKnotVectorV

public void setKnotVectorV(KnotVector vKnotVector)
Sets the knot vector in the v-direction.

Parameters:
vKnotVector - New knot vector in the v-direction.

getWeights

public FloatingPointFullMatrix getWeights()
Returns the control point weight matrix.

Returns:
The control point weight matrix.

setWeights

public void setWeights(FloatingPointFullMatrix weights)
Sets the control point weight matrix.

Parameters:
weights - New control point weight matrix.

getValue

public double getValue(int i,
                       int j,
                       double u,
                       double v)
                throws java.lang.IllegalArgumentException,
                       InvalidObjectException
Returns the value of a bivariate rational B-spline polynomial given i, j, u and v

Parameters:
i - Index i.
j - Index j.
u - u-direction parametric variable.
v - v-direction parametric variable.
Returns:
Evaluation of the polynomial.
Throws:
java.lang.IllegalArgumentException - Thrown if either i, j, u or v are out of range.
InvalidObjectException - Thrown if the knot vectors are empty.

isValid

public boolean isValid()
Tests the validity of this object. Confirms that p>=1, q>=1, U and V knot vectors are not empty and non-decreasing and that w is not empty.

Specified by:
isValid in class Function
Returns:
Logical-true if a valid object, else logical-false.

toString

public java.lang.String toString()
Returns a String representation of a BivariateRationalBSplinePolynomialFunction object.

Overrides:
toString in class Function
Returns:
A String representation of a BivariateRationalBSplinePolynomialFunction object.