private void init ( DelaunayTriangulation delaunay , int xCellCount , int yCellCount , BoundingBox region ) { indexDelaunay = delaunay ; indexRegion = region ; x_size = region . getWidth ( ) / yCellCount ; y_size = region . getHeight ( ) / xCellCount ; // The grid will hold a trinagle for each cell, so a point (x,y) will lie // in the cell representing the grid partition of region to a // xCellCount on yCellCount grid grid = new Triangle [ xCellCount ] [ yCellCount ] ; Triangle colStartTriangle = indexDelaunay . find ( middleOfCell ( 0 , 0 ) ) ; updateCellValues ( 0 , 0 , xCellCount - 1 , yCellCount - 1 , colStartTriangle ) ; }
Initialize the grid index