public class GeoConvexPolygon extends GeoBaseExtendedShape implements GeoMembershipShape
Modifier and Type | Field and Description |
---|---|
protected GeoPoint[] |
edgePoints |
protected SidedPlane[] |
edges |
protected double |
fullDistance |
protected boolean[] |
internalEdges |
protected BitSet |
isInternalEdges |
protected GeoPoint[][] |
notableEdgePoints |
protected List<GeoPoint> |
points |
NORTH_POLE, SOUTH_POLE
Constructor and Description |
---|
GeoConvexPolygon(double startLatitude,
double startLongitude)
Create a convex polygon, with a starting latitude and longitude.
|
GeoConvexPolygon(List<GeoPoint> pointList)
Create a convex polygon from a list of points.
|
GeoConvexPolygon(List<GeoPoint> pointList,
BitSet internalEdgeFlags,
boolean returnEdgeInternal)
Create a convex polygon from a list of points, keeping track of which boundaries
are internal.
|
Modifier and Type | Method and Description |
---|---|
void |
addPoint(double latitude,
double longitude,
boolean isInternalEdge)
Add a point to the polygon.
|
protected void |
createCenterPoint() |
void |
donePoints(boolean isInternalReturnEdge)
Finish the polygon, by connecting the last added point with the starting point.
|
boolean |
equals(Object o)
Equals
|
Bounds |
getBounds(Bounds bounds)
Compute longitude/latitude bounds for the shape.
|
GeoPoint[] |
getEdgePoints()
Return a sample point that is on the edge of the shape.
|
int |
hashCode() |
boolean |
intersects(Plane p,
GeoPoint[] notablePoints,
Membership... bounds)
Assess whether a plane, within the provided bounds, intersects
with the shape.
|
boolean |
isWithin(double x,
double y,
double z)
Check if a point is within this shape.
|
boolean |
isWithin(Vector point)
Check if a point is within this shape.
|
protected int |
legalIndex(int index) |
String |
toString() |
protected final BitSet isInternalEdges
protected SidedPlane[] edges
protected boolean[] internalEdges
protected GeoPoint[][] notableEdgePoints
protected GeoPoint[] edgePoints
protected double fullDistance
public GeoConvexPolygon(List<GeoPoint> pointList)
public GeoConvexPolygon(List<GeoPoint> pointList, BitSet internalEdgeFlags, boolean returnEdgeInternal)
public GeoConvexPolygon(double startLatitude, double startLongitude)
-PI/2 -> PI/2
, lon: -PI -> PI
public void addPoint(double latitude, double longitude, boolean isInternalEdge)
-PI/2 -> PI/2
, lon: -PI -> PI
latitude
- is the latitude of the next point.longitude
- is the longitude of the next point.isInternalEdge
- is true if the edge just added should be considered "internal", and not
intersected as part of the intersects() operation.public void donePoints(boolean isInternalReturnEdge)
protected void createCenterPoint()
protected int legalIndex(int index)
public boolean isWithin(Vector point)
GeoBaseExtendedShape
isWithin
in interface Membership
isWithin
in class GeoBaseExtendedShape
point
- is the point to check.public boolean isWithin(double x, double y, double z)
GeoBaseExtendedShape
isWithin
in interface Membership
isWithin
in class GeoBaseExtendedShape
x
- is x coordinate of point to check.y
- is y coordinate of point to check.z
- is z coordinate of point to check.public GeoPoint[] getEdgePoints()
GeoBaseExtendedShape
getEdgePoints
in interface GeoShape
getEdgePoints
in class GeoBaseExtendedShape
public boolean intersects(Plane p, GeoPoint[] notablePoints, Membership... bounds)
GeoBaseExtendedShape
intersects
in interface GeoShape
intersects
in class GeoBaseExtendedShape
p
- is the plane to assess for intersection with the shape's edges or
bounding curves.notablePoints
- represents the intersections of the plane with the supplied
bounds. These are used to disambiguate when two planes are identical and it needs
to be determined whether any points exist that fulfill all the bounds.bounds
- are a set of bounds that define an area that an
intersection must be within in order to qualify (provided by a GeoArea).public Bounds getBounds(Bounds bounds)
getBounds
in interface GeoShape
getBounds
in class GeoBaseExtendedShape
bounds
- is the optional input bounds object. If this is null,
a bounds object will be created. Otherwise, the input object will be modified.Copyright © 2000-2015 Apache Software Foundation. All Rights Reserved.