com.partnersoft.geometry.xy
Class XyGridSystem

java.lang.Object
  extended by com.partnersoft.geometry.xy.XyGrid
      extended by com.partnersoft.geometry.xy.XyGridSystem
All Implemented Interfaces:
Immutable

public class XyGridSystem
extends XyGrid

Similar to a XyGrid. The XyGridSystem is a XyGrid with each internal cell divided by other XyGrids.

Additional layers are optional, but without extra XyGrids this class becomes a standard XyGrid.

Copyright 2008 Partner Software, Inc.

Version:
$Id$
Author:
Rich Stepanski

Constructor Summary
XyGridSystem(double cellSize)
           
XyGridSystem(double cellWidth, double cellHeight)
           
XyGridSystem(double originX, double originY, double cellSize)
           
XyGridSystem(double originX, double originY, double cellWidth, double cellHeight)
           
XyGridSystem(XyPoint origin, XySize cellSize)
           
XyGridSystem(XySize cellSize)
           
 
Method Summary
 void addLevel(int columns, int rows)
          Adds an internal XyGrid to be applied to each cell of the XyGrid above this XyGrid.
 XyGridCell[] allCellsContainingPoint(XyPoint point)
          Returns an array of all XyGridCells containing this point.
 XyGridCell cellContainingPoint(XyPoint point)
          Returns the innermost XyGridCell containing the passed XyPoint
 
Methods inherited from class com.partnersoft.geometry.xy.XyGrid
cellContainingPoint, getCellSize, getOrigin, listCellsIntersecting
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

XyGridSystem

public XyGridSystem(double originX,
                    double originY,
                    double cellWidth,
                    double cellHeight)

XyGridSystem

public XyGridSystem(double originX,
                    double originY,
                    double cellSize)

XyGridSystem

public XyGridSystem(double cellWidth,
                    double cellHeight)

XyGridSystem

public XyGridSystem(double cellSize)

XyGridSystem

public XyGridSystem(XyPoint origin,
                    XySize cellSize)

XyGridSystem

public XyGridSystem(XySize cellSize)
Method Detail

cellContainingPoint

public XyGridCell cellContainingPoint(XyPoint point)
Returns the innermost XyGridCell containing the passed XyPoint

Overrides:
cellContainingPoint in class XyGrid
Parameters:
point - - XyPoint to locate.
Returns:
- innermost XyGridCell containing point

allCellsContainingPoint

public XyGridCell[] allCellsContainingPoint(XyPoint point)
Returns an array of all XyGridCells containing this point. Broader XyGridCells are earlier in the array. ie, index 0 == the main XyGrid cell containing point.

Parameters:
point - - XyPoint to locate.
Returns:
- XyGridCell[] of all cells containing point.

addLevel

public void addLevel(int columns,
                     int rows)
Adds an internal XyGrid to be applied to each cell of the XyGrid above this XyGrid. Cell size for the new XyGrid is calculated by diving cell size by rows and columns.

Parameters:
rows - - Number of rows for internal XyGrid to have.
columns - - Number of columns for internal XyGrid to have.