public class PolygonType extends java.lang.Object implements Renderer2DPainter
Modifier and Type | Class and Description |
---|---|
static class |
PolygonType.Vertex |
Modifier and Type | Field and Description |
---|---|
protected java.awt.geom.GeneralPath |
coverage |
protected PathElement |
elem |
protected boolean |
filled |
protected java.util.ArrayList<PolygonType.Vertex> |
vertices |
Constructor and Description |
---|
PolygonType() |
Modifier and Type | Method and Description |
---|---|
void |
addVertex(double latDegs,
double lonDegs)
Add a polygon vertex
|
void |
addVertex(int index,
LocationType loc) |
void |
addVertex(LocationType loc)
Add new vertex given its LocationType
|
void |
clearVertices()
Remove all polygon vertices
|
PolygonType |
clone() |
boolean |
containsPoint(LocationType loc) |
double |
getArea() |
LocationType |
getCentroid()
Given a list of locations, calculates and returns its centroid's location
|
java.util.ArrayList<LocationType> |
getCoveragePath(double angle,
double swathWidth,
int corner) |
java.util.ArrayList<LocationType> |
getCoveragePath(double swathWidth,
int corner) |
double |
getDiameter() |
Pair<java.lang.Double,java.lang.Double> |
getDiameterAndAngle() |
java.lang.String |
getId() |
double |
getPathLength(double angle,
double swathWidth,
int corner) |
double |
getPathLength(double swathWidth,
int corner) |
java.util.List<PolygonType.Vertex> |
getVertices()
Retrieve an unmodifiable list of vertices
|
int |
getVerticesSize() |
static void |
main(java.lang.String[] args) |
void |
paint(java.awt.Graphics2D g,
StateRenderer2D renderer) |
void |
recomputePath() |
void |
removeVertex(PolygonType.Vertex v) |
void |
rotate(double yawRads)
Rotate this polygon by yaw rads
|
void |
setColor(java.awt.Color c) |
void |
setFilled(boolean filled) |
void |
setId(java.lang.String id) |
java.util.ArrayList<PolygonType> |
split(double areaSize) |
java.util.ArrayList<PolygonType> |
subAreas(int numAreas,
double angle) |
java.lang.String |
toString() |
void |
translate(double offsetNorth,
double offsetEast) |
protected java.util.ArrayList<PolygonType.Vertex> vertices
protected PathElement elem
protected boolean filled
protected java.awt.geom.GeneralPath coverage
public java.lang.String getId()
public void setId(java.lang.String id)
public void addVertex(double latDegs, double lonDegs)
latDegs
- the latitude of the vertex to addlonDegs
- the longitude of the vertex to addpublic void addVertex(LocationType loc)
public void addVertex(int index, LocationType loc)
public void clearVertices()
public java.util.List<PolygonType.Vertex> getVertices()
public void removeVertex(PolygonType.Vertex v)
public int getVerticesSize()
public void setColor(java.awt.Color c)
public final void setFilled(boolean filled)
filled
- the filled to setpublic void paint(java.awt.Graphics2D g, StateRenderer2D renderer)
paint
in interface Renderer2DPainter
Renderer2DPainter
public void recomputePath()
public boolean containsPoint(LocationType loc)
public java.lang.String toString()
toString
in class java.lang.Object
public PolygonType clone()
clone
in class java.lang.Object
public LocationType getCentroid()
public void translate(double offsetNorth, double offsetEast)
public void rotate(double yawRads)
public Pair<java.lang.Double,java.lang.Double> getDiameterAndAngle()
public double getDiameter()
public double getArea()
public java.util.ArrayList<PolygonType> subAreas(int numAreas, double angle)
public java.util.ArrayList<PolygonType> split(double areaSize)
public java.util.ArrayList<LocationType> getCoveragePath(double angle, double swathWidth, int corner)
public java.util.ArrayList<LocationType> getCoveragePath(double swathWidth, int corner)
public double getPathLength(double swathWidth, int corner)
public double getPathLength(double angle, double swathWidth, int corner)
public static void main(java.lang.String[] args)
Copyright © 2004-2020 FEUP-LSTS and Neptus developers. All Rights Reserved.