Class BSplineLattice2Df

java.lang.Object
gov.nih.mipav.model.structures.BSplineLattice2Df

public class BSplineLattice2Df extends Object
This class manages a 2D lattice of control points given a discretized B-Spline basis for each axis.
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    protected WildMagic.LibFoundation.Mathematics.Vector2f[][]
    DOCUMENT ME!
    protected WildMagic.LibFoundation.Curves.BSplineBasisDiscretef
    DOCUMENT ME!
    protected WildMagic.LibFoundation.Curves.BSplineBasisDiscretef
    DOCUMENT ME!
  • Constructor Summary

    Constructors
    Constructor
    Description
    BSplineLattice2Df(WildMagic.LibFoundation.Curves.BSplineBasisDiscretef kBasisX, WildMagic.LibFoundation.Curves.BSplineBasisDiscretef kBasisY)
    Create 2D lattice of control points given a discretized B-Spline basis for each axis.
  • Method Summary

    Modifier and Type
    Method
    Description
    createImageMap(int iSizeX, int iSizeY)
    Create an image of the specified dimensions and fill it to contain a mapping of the coordinates based on the 2D lattice of B-spline control points.
    void
    Cleanup memory.
    WildMagic.LibFoundation.Curves.BSplineBasisDiscretef
    Return the discretized B-Spline basis for the X axis.
    WildMagic.LibFoundation.Curves.BSplineBasisDiscretef
    Return the discretized B-Spline basis for the Y axis.
    void
    getControlPoint(int iControlX, int iControlY, WildMagic.LibFoundation.Mathematics.Vector2f kPoint)
    Retrieve the position of the specified control point.
    void
    getPosition(float fX, float fY, WildMagic.LibFoundation.Mathematics.Vector2f kPos)
    Return the B-Spline evaluation for the given input values.
    void
    getPosition(int iSampleX, int iSampleY, WildMagic.LibFoundation.Mathematics.Vector2f kPos)
    Return the B-Spline evaluation for the given input values.
    void
    setControlPoint(int iControlX, int iControlY, WildMagic.LibFoundation.Mathematics.Vector2f kPoint)
    Set the position of the specified control point.

    Methods inherited from class java.lang.Object

    clone, equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Field Details

    • m_aakControlPoint

      protected WildMagic.LibFoundation.Mathematics.Vector2f[][] m_aakControlPoint
      DOCUMENT ME!
    • m_kBasisX

      protected WildMagic.LibFoundation.Curves.BSplineBasisDiscretef m_kBasisX
      DOCUMENT ME!
    • m_kBasisY

      protected WildMagic.LibFoundation.Curves.BSplineBasisDiscretef m_kBasisY
      DOCUMENT ME!
  • Constructor Details

    • BSplineLattice2Df

      public BSplineLattice2Df(WildMagic.LibFoundation.Curves.BSplineBasisDiscretef kBasisX, WildMagic.LibFoundation.Curves.BSplineBasisDiscretef kBasisY)
      Create 2D lattice of control points given a discretized B-Spline basis for each axis. Initially, all of the control points are equally spaced.
      Parameters:
      kBasisX - BSplineBasisDiscretef B-Spline basis for the X axis.
      kBasisY - BSplineBasisDiscretef B-Spline basis for the Y axis.
  • Method Details

    • createImageMap

      public ModelSimpleImage[] createImageMap(int iSizeX, int iSizeY)
      Create an image of the specified dimensions and fill it to contain a mapping of the coordinates based on the 2D lattice of B-spline control points.
      Parameters:
      iSizeX - int Number of samples along x axis of image.
      iSizeY - int Number of samples along y axis of image.
      Returns:
      ModelSimpleImage[] Array of two ModelSimpleImage instances. The first one contains the x coordinate and the second contains the y coordinate for the map. Each image has default resolutions of 1 for each axis.
    • finalize

      public void finalize() throws Throwable
      Cleanup memory.
      Overrides:
      finalize in class Object
      Throws:
      Throwable - DOCUMENT ME!
    • getBasisX

      public WildMagic.LibFoundation.Curves.BSplineBasisDiscretef getBasisX()
      Return the discretized B-Spline basis for the X axis.
      Returns:
      BSplineBasisDiscretef B-Spline basis.
    • getBasisY

      public WildMagic.LibFoundation.Curves.BSplineBasisDiscretef getBasisY()
      Return the discretized B-Spline basis for the Y axis.
      Returns:
      BSplineBasisDiscretef B-Spline basis.
    • getControlPoint

      public void getControlPoint(int iControlX, int iControlY, WildMagic.LibFoundation.Mathematics.Vector2f kPoint)
      Retrieve the position of the specified control point.
      Parameters:
      iControlX - int Identifies control point in 2D lattice.
      iControlY - int Identifies control point in 2D lattice.
      kPoint - Point2f Where the current coordinates of the control point will be stored upon return.
    • getPosition

      public void getPosition(int iSampleX, int iSampleY, WildMagic.LibFoundation.Mathematics.Vector2f kPos)
      Return the B-Spline evaluation for the given input values. The evaluation is based on the 2D evaluation of the B-Spline basis (one for each axis) and the 2D lattice of control points.
      Parameters:
      iSampleX - int Sample index along X axis which determines an input value in the [0,1] for that axis' B-Spline basis evaluation.
      iSampleY - int Sample index along Y axis which determines an input value in the [0,1] for that axis' B-Spline basis evaluation.
      kPos - Point2f 2D coordinates resulting from evaluation.
    • getPosition

      public void getPosition(float fX, float fY, WildMagic.LibFoundation.Mathematics.Vector2f kPos)
      Return the B-Spline evaluation for the given input values. The evaluation is based on the 2D evaluation of the B-Spline basis (one for each axis) and the 2D lattice of control points. This method is used for interpolating between the discrete samples.
      Parameters:
      fX - float Sample in [0,1] range for the X axis evaluation of the B-Spline basis.
      fY - float Sample in [0,1] range for the Y axis evaluation of the B-Spline basis.
      kPos - Point2f 2D coordinates resulting from evaluation.
    • setControlPoint

      public void setControlPoint(int iControlX, int iControlY, WildMagic.LibFoundation.Mathematics.Vector2f kPoint)
      Set the position of the specified control point. No checks are made on the input coordinates of the control point.
      Parameters:
      iControlX - int Identifies control point in 2D lattice.
      iControlY - int Identifies control point in 2D lattice.
      kPoint - Point2f New coordinates of the control point.