edu.jhu.cs.cisst.algorithms.optimize.fmg.grid
Interface ConstGrid

All Superinterfaces:
java.lang.Cloneable
All Known Subinterfaces:
ConstBoundaryGrid, ConstNoBoundaryGrid
All Known Implementing Classes:
BoundaryGrid, FixedBoundaryGrid, Grid, NoBoundaryGrid, PeriodicBoundaryGrid, RepeatBoundaryGrid

public interface ConstGrid
extends java.lang.Cloneable

Interface to the constant methods of class Grid.

Author:
Gerald Loeffler (Gerald.Loeffler@univie.ac.at)
See Also:
Grid

Method Summary
 Grid add(ConstGrid grid)
          create a new grid that is the sum of this grid and the given grid.
 ConstGrid clone()
          clone this grid.
 double get(int x, int y, int z)
          returns the element at the specified position.
 int getCols()
          Gets the cols.
 int getLevel()
          Get the resolution level.
 int getRows()
          Gets the rows.
 int getSlices()
          Gets the slices.
 boolean isBoundary(int x, int y, int z)
          determines if the specified element is at the boundary of the grid.
 boolean isInterior(int x, int y, int z)
          determines if the specified element is in the interior of the grid.
 Grid newInstance(int sx, int sy, int sz, int level, double value)
          create a new grid with exactly the same handling of the boundary (i.e.
 void set(int x, int y, int z, double value)
          Set the value for a grid node.
 void setLevel(int level)
          Set the resolution level.
 

Method Detail

get

double get(int x,
           int y,
           int z)
returns the element at the specified position.

Parameters:
x - the x index of the element (0 <= x < size())
y - the y index of the element (0 <= y < size())
z - the z index of the element (0 <= z < size())
Returns:
the element (a double value) at the specified position

set

void set(int x,
         int y,
         int z,
         double value)
Set the value for a grid node.

Parameters:
sx - the dimension in X
sy - the dimension in Y
sz - the dimension in Z
level - the resolution level
value - the value

getRows

int getRows()
Gets the rows.

Returns:
the rows

getCols

int getCols()
Gets the cols.

Returns:
the cols

getSlices

int getSlices()
Gets the slices.

Returns:
the slices

isInterior

boolean isInterior(int x,
                   int y,
                   int z)
determines if the specified element is in the interior of the grid.

Parameters:
x - the x index of the element
y - the y index of the element
z - the z index of the element
Returns:
true if the element is in the interior of the grid, false otherwise

isBoundary

boolean isBoundary(int x,
                   int y,
                   int z)
determines if the specified element is at the boundary of the grid.

Parameters:
x - the x index of the element
y - the y index of the element
z - the z index of the element
Returns:
true if the element is at the boundary of the grid, false otherwise

newInstance

Grid newInstance(int sx,
                 int sy,
                 int sz,
                 int level,
                 double value)
create a new grid with exactly the same handling of the boundary (i.e. of the same tzpe as this object) but of an arbitrary size and set all interior elements to a given value.

Parameters:
value - the value to which all interior grid elements are to be set
sx - the sx
sy - the sy
sz - the sz
level - the level
Returns:
the newly constructed grid

getLevel

int getLevel()
Get the resolution level.

Returns:
level

setLevel

void setLevel(int level)
Set the resolution level.

Parameters:
level - the level

clone

ConstGrid clone()
clone this grid.

Returns:
the const grid

add

Grid add(ConstGrid grid)
create a new grid that is the sum of this grid and the given grid. Only the interiors of the two grids are added. The types of the two grids must be identical and the handling of the boundary is copied from this grid.

Parameters:
grid - the grid to add to this grid
Returns:
the newly constructed grid that is the sum of the grids