Package WildMagic.LibFoundation.Curves
Class BSplineBasisDiscretef
- java.lang.Object
-
- WildMagic.LibFoundation.Curves.BSplineBasisf
-
- WildMagic.LibFoundation.Curves.BSplineBasisDiscretef
-
- All Implemented Interfaces:
java.io.Serializable
public class BSplineBasisDiscretef extends BSplineBasisf implements java.io.Serializable
This class is an implementation of an open uniform B-Spline with equally spaced samples taken over the input [0,1] interval. The basis function evaluations are pre-computed at each sample and for each control point so that getting the position for an input value is simply a table lookup and does not involve any calculations.- See Also:
- Serialized Form
-
-
Field Summary
Fields Modifier and Type Field Description protected float[][]
m_aafSampleD0
Positionprotected float[][]
m_aafSampleD1
First derivativeprotected float[][]
m_aafSampleD2
Second derivativeprotected int[]
m_aiControlPointSampleIndexMax
sample maxprotected int[]
m_aiControlPointSampleIndexMin
sample minprotected int
m_iNumSamples
num samplesprivate static long
serialVersionUID
-
Fields inherited from class WildMagic.LibFoundation.Curves.BSplineBasisf
m_aafBD0, m_aafBD1, m_aafBD2, m_aafBD3, m_afKnot, m_bOpen, m_bUniform, m_iDegree, m_iNumCtrlPoints, m_iNumKnots
-
-
Constructor Summary
Constructors Constructor Description BSplineBasisDiscretef(int iNumCtrlPoints, int iDegree, int iNumSamples)
Create a set of B-Spline uniform open basis functions for the given number of control points and degree of the basis functions.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
dispose()
Cleanup memory.int
GetControlPointSampleIndexMax(int iControl)
Return the maximum index of the range of samples affected by the specified control point.int
GetControlPointSampleIndexMin(int iControl)
Return the minimum index of the range of samples affected by the specified control point.float
GetD0(int iControl, int iSample)
Return the position basis function evaluation which determines how much the specified control point affects the specified sample.float
GetD1(int iControl, int iSample)
Return the first derivative basis function evaluation which determines how much the specified control point affects the specified sample.float
GetD2(int iControl, int iSample)
Return the second derivative basis function evaluation which determines how much the specified control point affects the specified sample.int
GetNumSamples()
Return the number of samples specified in the constructor.-
Methods inherited from class WildMagic.LibFoundation.Curves.BSplineBasisf
Compute, Compute, Create, Create, GetD0, GetD1, GetD2, GetD3, GetDegree, GetKey, GetKnot, GetKnotIndex, GetMinNumControlPoints, GetNumCtrlPoints, IsOpen, IsSameAs, IsUniform, SetKnot
-
-
-
-
Field Detail
-
serialVersionUID
private static final long serialVersionUID
- See Also:
- Constant Field Values
-
m_aafSampleD0
protected float[][] m_aafSampleD0
Position
-
m_aafSampleD1
protected float[][] m_aafSampleD1
First derivative
-
m_aafSampleD2
protected float[][] m_aafSampleD2
Second derivative
-
m_aiControlPointSampleIndexMax
protected int[] m_aiControlPointSampleIndexMax
sample max
-
m_aiControlPointSampleIndexMin
protected int[] m_aiControlPointSampleIndexMin
sample min
-
m_iNumSamples
protected int m_iNumSamples
num samples
-
-
Constructor Detail
-
BSplineBasisDiscretef
public BSplineBasisDiscretef(int iNumCtrlPoints, int iDegree, int iNumSamples)
Create a set of B-Spline uniform open basis functions for the given number of control points and degree of the basis functions. These basis functions have been sampled equally over the [0,1] input interval.- Parameters:
iNumCtrlPoints
- Number of control points.iDegree
- B-Spline degree of basis functions.iNumSamples
- Number of equally spaced samples.- Throws:
java.lang.IllegalArgumentException
- if iNumSamples > iNumCtrlPoints
-
-
Method Detail
-
dispose
public void dispose()
Cleanup memory.- Overrides:
dispose
in classBSplineBasisf
- Throws:
java.lang.Throwable
- DOCUMENT ME!
-
GetControlPointSampleIndexMax
public int GetControlPointSampleIndexMax(int iControl)
Return the maximum index of the range of samples affected by the specified control point.- Parameters:
iControl
- Index of a specified control point.- Returns:
- Maximum index of affected sample range.
-
GetControlPointSampleIndexMin
public int GetControlPointSampleIndexMin(int iControl)
Return the minimum index of the range of samples affected by the specified control point.- Parameters:
iControl
- Index of a specified control point.- Returns:
- Minimum index of affected sample range.
-
GetD0
public float GetD0(int iControl, int iSample)
Return the position basis function evaluation which determines how much the specified control point affects the specified sample.- Parameters:
iControl
- Index of a specified control point.iSample
- Index of a specified sample.- Returns:
- Associated position basis function evaluation.
-
GetD1
public float GetD1(int iControl, int iSample)
Return the first derivative basis function evaluation which determines how much the specified control point affects the specified sample.- Parameters:
iControl
- Index of a specified control point.iSample
- Index of a specified sample.- Returns:
- float Associated first derivative basis function evaluation.
-
GetD2
public float GetD2(int iControl, int iSample)
Return the second derivative basis function evaluation which determines how much the specified control point affects the specified sample.- Parameters:
iControl
- Index of a specified control point.iSample
- Index of a specified sample.- Returns:
- float Associated second derivative basis function evaluation.
-
GetNumSamples
public int GetNumSamples()
Return the number of samples specified in the constructor.- Returns:
- Number of samples.
-
-