org.geotools.grid.hexagon
Class HexagonBuilder
Object
PolygonBuilder
HexagonBuilder
public class HexagonBuilder
- extends PolygonBuilder
Used by Hexagons
class to build grids.
- Since:
- 2.7
- Author:
- mbedward
Methods inherited from class Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
HexagonBuilder
public HexagonBuilder(ReferencedEnvelope gridBounds,
double sideLen,
HexagonOrientation orientation)
isValidNeighbor
public boolean isValidNeighbor(Neighbor neighbor)
- Tests whether a neighbor position is valid for a given orientation.
Since the
Hexagon
class is intended to work within a grid
(ie. a perfect tesselation) some combinations of neighbour position
and hexagon orientation are invalid. For example, a FLAT
hexagon does not have a LEFT
, rather it has UPPER_LEFT
and LOWER_LEFT
.
- Specified by:
isValidNeighbor
in class PolygonBuilder
- Parameters:
orientation
- hexagon orientationneighbor
- neighbor position
- Returns:
true
if the combination is valid; false
otherwise
createNeighbor
public Hexagon createNeighbor(PolygonElement el,
Neighbor neighbor)
- Creates a new
Hexagon
positioned at the given neighbor position
relative to the reference element.
- Specified by:
createNeighbor
in class PolygonBuilder
- Parameters:
el
- the reference hexagonneighbor
- a valid neighbour position given the reference hexagon's
orientation
- Returns:
- a new
Hexagon
object
- Throws:
IllegalArgumentException
- if either argument is null
or
if el
is not an instance of Hexagon
or
if the neighbor position is not valid for the reference hexagon's
orientation- See Also:
#isValidNeighbor(Hexagon.Orientation, Hexagon.Neighbor)
getFirstElement
public PolygonElement getFirstElement()
- Specified by:
getFirstElement
in class PolygonBuilder
getNextXElement
public PolygonElement getNextXElement(PolygonElement el)
- Specified by:
getNextXElement
in class PolygonBuilder
getNextYElement
public PolygonElement getNextYElement(PolygonElement el)
- Specified by:
getNextYElement
in class PolygonBuilder
isValidDenseVertexSpacing
public boolean isValidDenseVertexSpacing(double v)
- Specified by:
isValidDenseVertexSpacing
in class PolygonBuilder
Copyright © 1996-2014 Geotools. All Rights Reserved.