com.partnersoft.geometry
Class GridSystem

java.lang.Object
  extended by com.partnersoft.geometry.GridSystem

public class GridSystem
extends java.lang.Object

A system of grids within grids. Very common in utility mapping systems; this class is primarily designed to support the kind of grid nomenclatures used in map books.

Author:
Paul Reavis Copyright 2005 Partner Software, Inc.

Constructor Summary
GridSystem()
           
GridSystem(double originX, double originY, double width, double height)
           
 
Method Summary
 void addLevel(int columns, int rows)
           
 int[] cellContaining(double x, double y)
          Returns an array of numbers describing the cell with the given XY.
 double getHeight()
          Gets the value of height
 double getOriginX()
          Gets the value of originX
 double getOriginY()
          Gets the value of originY
 double getWidth()
          Gets the value of width
 void setHeight(double argHeight)
          Sets the value of height
 void setOriginX(double argOriginX)
          Sets the value of originX
 void setOriginY(double argOriginY)
          Sets the value of originY
 void setWidth(double argWidth)
          Sets the value of width
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

GridSystem

public GridSystem()

GridSystem

public GridSystem(double originX,
                  double originY,
                  double width,
                  double height)
Method Detail

addLevel

public void addLevel(int columns,
                     int rows)

cellContaining

public int[] cellContaining(double x,
                            double y)
Returns an array of numbers describing the cell with the given XY. Each number in the array is for the next finer gridding - cell[0] is the number of the cell of the top-level grid, cell[1] for its subgrid, cell[2] for cell[1]'s subgrid, etc. The numbers start at zero for the top left cell and go from left to right, top to bottom just like written English. For example:
012
345
678
If the coordinate is outside the grid, returns null so be careful.


getOriginX

public double getOriginX()
Gets the value of originX

Returns:
the value of originX

setOriginX

public void setOriginX(double argOriginX)
Sets the value of originX

Parameters:
argOriginX - Value to assign to this.originX

getOriginY

public double getOriginY()
Gets the value of originY

Returns:
the value of originY

setOriginY

public void setOriginY(double argOriginY)
Sets the value of originY

Parameters:
argOriginY - Value to assign to this.originY

getWidth

public double getWidth()
Gets the value of width

Returns:
the value of width

setWidth

public void setWidth(double argWidth)
Sets the value of width

Parameters:
argWidth - Value to assign to this.width

getHeight

public double getHeight()
Gets the value of height

Returns:
the value of height

setHeight

public void setHeight(double argHeight)
Sets the value of height

Parameters:
argHeight - Value to assign to this.height