org.mbari.siam.moos.utils.chart.graph
Class IsoCurve

java.lang.Object
  extended by org.mbari.siam.moos.utils.chart.graph.IsoCurve

public class IsoCurve
extends java.lang.Object

This class will calculate the constant curve of a given value passing through a grid of values.

Version:
$Revision: 1.1 $, $Date: 2008/11/04 22:17:54 $.
Author:
Leigh Brookshaw

Field Summary
protected  java.util.Vector cells
          Vector of cells that the contour passes through.
protected  double[] curve
          Array that holds the points of the contour
protected  double[] grid
          Array holding the data grid.
protected  int nx
          X Dimension of data grid
protected  int ny
          Y Dimension of data grid
protected  int size
          Number of points in the contour
protected  double value
          Contour value to be found
 
Constructor Summary
IsoCurve()
          Instantiate the class and initialize all the variables
IsoCurve(double[] grid, int nx, int ny)
          Instantiate the class and initialize all the variables.
 
Method Summary
protected  void addDataPoint(double x, double y)
          Add a data point to the contour curve.
protected  void addDataPoint(int wall, int icell, int jcell)
          Add a data point to the contour curve.
protected  void createCells()
          Create the vector of all cells that contain the contour.
protected  void getcurve()
          Traverse the cells and find One connect countour.
 double[] getCurve()
          Return a contour curve.
protected  double[] getPoint(int wall, int icell, int jcell)
          Return the (x,y) position where the contour cross the cell wall.
protected  org.mbari.siam.moos.utils.chart.graph.Cell search(int icell, int jcell)
          Search for a cell in the contour cell list
 void setGrid(double[] grid, int nx, int ny)
          Set the grid to be contoured
 void setValue(double value)
          Set the value to contour
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

cells

protected java.util.Vector cells
Vector of cells that the contour passes through.


grid

protected double[] grid
Array holding the data grid.


nx

protected int nx
X Dimension of data grid


ny

protected int ny
Y Dimension of data grid


curve

protected double[] curve
Array that holds the points of the contour


size

protected int size
Number of points in the contour


value

protected double value
Contour value to be found

Constructor Detail

IsoCurve

public IsoCurve()
Instantiate the class and initialize all the variables


IsoCurve

public IsoCurve(double[] grid,
                int nx,
                int ny)
Instantiate the class and initialize all the variables.

Parameters:
grid - An nx by ny Array containing the grid to contour
nx - X dimension of the grid.
ny - Y dimension of the grid.
Method Detail

setGrid

public void setGrid(double[] grid,
                    int nx,
                    int ny)
Set the grid to be contoured

Parameters:
nx - X dimension of the grid.
ny - Y dimension of the grid.

setValue

public void setValue(double value)
Set the value to contour

Parameters:
value - the contour level

getCurve

public double[] getCurve()
Return a contour curve. If null is returned it means that all the contour curves have been found.

Returns:
The array containing the (x,y) pairs of the contour curve.

createCells

protected void createCells()
Create the vector of all cells that contain the contour.


getcurve

protected void getcurve()
Traverse the cells and find One connect countour.


getPoint

protected double[] getPoint(int wall,
                            int icell,
                            int jcell)
Return the (x,y) position where the contour cross the cell wall.

Parameters:
wall - The cell wall the contour crosses.
icell - The x index of the cell position.
jcell - The y index of the cell position.

addDataPoint

protected void addDataPoint(int wall,
                            int icell,
                            int jcell)
Add a data point to the contour curve.

Parameters:
wall - The cell wall the contour crosses.
icell - The x index of the cell position.
jcell - The y index of the cell position.

addDataPoint

protected void addDataPoint(double x,
                            double y)
Add a data point to the contour curve.

Parameters:
x - The x position of the point.
y - The y position of the point.

search

protected org.mbari.siam.moos.utils.chart.graph.Cell search(int icell,
                                                            int jcell)
Search for a cell in the contour cell list

Parameters:
icell - the x index of the cell
jcell - the y index of the cell


Copyright © 2003 MBARI.

The Monterey Bay Aquarium Research Institute (MBARI) provides this documentation and code "as is", with no warranty, express or implied, of its quality or consistency. It is provided without support and without obligation on the part of MBARI to assist in its use, correction, modification, or enhancement.