Class 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 Detail

      • 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

      • finalize

        public void finalize()
                      throws java.lang.Throwable
        Cleanup memory.
        Overrides:
        finalize in class java.lang.Object
        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.