public class SGPolygon
extends java.awt.geom.Path2D.Double
implements java.lang.Cloneable
Modifier and Type | Field and Description |
---|---|
static int |
DENSITY_AREA |
static int |
DENSITY_NPOINTS |
static int |
DENSITY_PERIMETER |
SGPolygon |
itsBoundPoly |
double |
itsDirectionRad |
java.awt.geom.Point2D |
itsOBBHalfPoint |
double |
itsObjectLength |
double |
itsObjectWidth |
java.awt.geom.Rectangle2D |
itsOrientedBoundBox |
SpatialVector[] |
itsOrientedPoints |
TargetDescriptor |
itsTDescriptor |
SpatialVector |
itsXYZMaxCorner |
SpatialVector |
itsXYZMinCorner |
boolean |
needsDataReset |
Constructor and Description |
---|
SGPolygon()
empty constructor for the SGPolygon class.
|
SGPolygon(java.awt.Shape thePoly)
standard constructor for the SGPolygon class.
|
Modifier and Type | Method and Description |
---|---|
void |
asSpatialMap()
Creates a presenter and plots the locations
|
void |
asSpatialMap(boolean xDirection,
boolean yDirection)
Creates a presenter and plots the locations
|
void |
asSpatialMap(GridSpace3D theGridSpace,
boolean xDirection,
boolean yDirection)
Creates a presenter and plots the locations
|
java.awt.geom.Point2D |
centroid() |
boolean |
checkMinPoints(int minPoints)
examines whether a minimum number points are available
|
boolean |
containsPlus(java.awt.geom.Point2D p0)
checks whether the Polygon contain the point p0? if p is on boundary then 0 or 1 is returned, and p
is in exactly one point of every partition of plane.
|
void |
doOrientation()
performs an analysis of principal axis orientations
|
double |
getArea()
returns the area of the polygon in screen pixels
|
float |
getAreaDensRatio(int nParts)
returns the object's point density in the forward half of the object
|
java.lang.String |
getAxisFormula(float[] PC)
returns the formula for the eigenvector
|
SGPolygon |
getBoundPoly()
returns the factor matrix of the object outline for orientation
|
Pixel |
getCenterPixel()
returns the pixel info for the center point
|
SpatialVector |
getCenterVector()
returns the center vector of the object
|
java.awt.geom.Point2D |
getCentroid()
returns the centroid of the object
|
Pixel |
getDarkestPixel() |
double |
getDirectionRad(TargetDescriptor tDescr)
returns the direction of the object in radians
|
float[] |
getMajorAxis()
finds the major axis through the object
|
float[] |
getMajorFactorPattern()
returns the angle for the eigenvector
|
float[] |
getMinorAxis()
finds the minor axis through the object
|
float[] |
getMinorFactorPattern()
returns the angle for the eigenvector
|
int |
getNPoints()
returns the size of the coordinate array of the polygon
|
int |
getNSubAreas()
lists the segments of the polygon
|
double |
getObjectLength()
returns the object's length
|
double |
getObjectWidth()
returns the object's width
|
float[] |
getOrientedAngles()
returns the long and wide angles for the target in radians
|
java.awt.geom.Rectangle2D |
getOrientedBoundBox()
returns the factor matrix of the object outline for orientation
|
SingularValueDecomposition |
getOrientedDimensions()
returns the factor structure of the object outline for orientation
|
SpatialVector[] |
getOrientedPoints()
returns the factor matrix of the object outline for orientation
|
SpatialVector |
getPathCoordinate(int theRow)
gets the point for a row from the SGPolygon
|
float |
getPerimeter()
returns the perimeter of the polygon in screen pixels
|
float |
getPerimeterDensRatio(int nParts)
returns the object's perimeter in the forward half of the object
|
float |
getPointDensRatio(int nParts)
returns the factor matrix of the object outline for orientation
|
double |
getRoundness()
returns the roundness factor of the polygon as object perimeter squared divided by object area.
|
double |
getShapeRatio(SingularValueDecomposition aSVD)
returns the ratio of major vs minor axis
|
TargetCaptureData |
getTargetData(TargetDescriptor tDescr)
returns the ratio of major vs minor axis
|
double[] |
getXPoints()
returns the x coordinate array of the polygon
|
SpatialVector |
getXYFromPCScores(double PC1_Score,
double PC2_Score,
float[] PC1,
float[] PC2)
returns the factor matrix of the object outline for orientation
|
double[] |
getYPoints()
returns the x coordinate array of the polygon
|
double[] |
getZPoints()
returns the x coordinate array of the polygon
|
SGPolygon |
intersect(SGPolygon rhs)
performs an analysis of principal axis orientations
|
boolean |
isCCW() |
boolean |
isOnBorder(java.awt.geom.Point2D p0)
returns whether a Point is on the boundary of the polygon
|
void |
list()
lists the info of the polygon
|
void |
listPoints()
lists the coordinates of the polygon
|
void |
listSegments()
lists the segments of the polygon
|
void |
listToDebug()
lists the coordinates of the polygon as coordinates of the object perimeter
|
double |
makeDirectionRad(TargetDescriptor tDescr)
returns the direction of the object in radians
|
void |
resetStats()
returns the spatial vectors as an array
|
void |
setDarkestPixel(Pixel itsDarkestPixel) |
void |
setDirectionRad(double dir)
returns the direction of the object in radians
|
double |
signedArea()
returns the signed area of the polygon in screen pixels
|
SGPolygon[] |
splitBoundByLength(int num)
returns the ratio of major vs minor axis
|
SGPolygon[] |
splitByLength(int num)
returns the ratio of major vs minor axis
|
CaptureVariable |
toCaptureVariable()
returns the spatial vectors as a CaptureVariable
|
java.awt.geom.Path2D |
toPath2D()
creates a Path2D object from the SGPolygon
|
java.awt.Polygon |
toPolygon()
creates an awt polygon from the SGPolygon
|
SpatialVector[] |
toSpatialVectors()
returns the spatial vectors as an array
|
java.lang.String |
toString()
returns a string descriptor of the object
|
void |
updateBounds()
updates the corner coordinates around the SGPolygon
|
void |
updateDataFromGeometry()
updates the data array from the area's geometry
|
append, clone, curveTo, getBounds2D, getPathIterator, lineTo, moveTo, quadTo, transform
append, closePath, contains, contains, contains, contains, contains, contains, contains, contains, createTransformedShape, getBounds, getCurrentPoint, getPathIterator, getWindingRule, intersects, intersects, intersects, intersects, reset, setWindingRule
public static final int DENSITY_NPOINTS
public static final int DENSITY_AREA
public static final int DENSITY_PERIMETER
public SpatialVector itsXYZMinCorner
public SpatialVector itsXYZMaxCorner
public SGPolygon itsBoundPoly
public SpatialVector[] itsOrientedPoints
public java.awt.geom.Rectangle2D itsOrientedBoundBox
public double itsObjectLength
public double itsObjectWidth
public java.awt.geom.Point2D itsOBBHalfPoint
public double itsDirectionRad
public boolean needsDataReset
public TargetDescriptor itsTDescriptor
public SGPolygon() throws java.lang.Exception
java.lang.Exception
public SGPolygon(java.awt.Shape thePoly) throws java.lang.Exception
java.lang.Exception
public void updateDataFromGeometry() throws java.lang.Exception
java.lang.Exception
public void resetStats()
public int getNSubAreas()
public SpatialVector getPathCoordinate(int theRow) throws java.lang.Exception
theRow
- the rowjava.lang.Exception
public int getNPoints() throws java.lang.Exception
java.lang.Exception
public double[] getXPoints() throws java.lang.Exception
java.lang.Exception
public double[] getYPoints() throws java.lang.Exception
java.lang.Exception
public double[] getZPoints() throws java.lang.Exception
java.lang.Exception
public java.awt.geom.Point2D getCentroid() throws java.lang.Exception
java.lang.Exception
public SpatialVector getCenterVector() throws java.lang.Exception
java.lang.Exception
public Pixel getCenterPixel() throws java.lang.Exception
java.lang.Exception
public SingularValueDecomposition getOrientedDimensions() throws java.lang.Exception
java.lang.Exception
public SpatialVector getXYFromPCScores(double PC1_Score, double PC2_Score, float[] PC1, float[] PC2) throws java.lang.Exception
java.lang.Exception
public SpatialVector[] getOrientedPoints() throws java.lang.Exception
java.lang.Exception
public SGPolygon getBoundPoly() throws java.lang.Exception
java.lang.Exception
public java.awt.geom.Rectangle2D getOrientedBoundBox() throws java.lang.Exception
java.lang.Exception
public double getObjectLength() throws java.lang.Exception
java.lang.Exception
public double getObjectWidth() throws java.lang.Exception
java.lang.Exception
public float getAreaDensRatio(int nParts) throws java.lang.Exception
java.lang.Exception
public float getPerimeterDensRatio(int nParts) throws java.lang.Exception
java.lang.Exception
public float getPointDensRatio(int nParts) throws java.lang.Exception
java.lang.Exception
public float[] getOrientedAngles() throws java.lang.Exception
java.lang.Exception
public double makeDirectionRad(TargetDescriptor tDescr) throws java.lang.Exception
tDescr
- the TargetDescriptor to usejava.lang.Exception
public void setDirectionRad(double dir) throws java.lang.Exception
dir
- the direction to setjava.lang.Exception
public double getDirectionRad(TargetDescriptor tDescr) throws java.lang.Exception
tDescr
- the TargetDescriptor for the objectjava.lang.Exception
public float[] getMajorAxis() throws java.lang.Exception
java.lang.Exception
public float[] getMinorAxis() throws java.lang.Exception
java.lang.Exception
public float[] getMajorFactorPattern() throws java.lang.Exception
java.lang.Exception
public float[] getMinorFactorPattern() throws java.lang.Exception
java.lang.Exception
public java.lang.String getAxisFormula(float[] PC) throws java.lang.Exception
java.lang.Exception
public double getShapeRatio(SingularValueDecomposition aSVD) throws java.lang.Exception
java.lang.Exception
public TargetCaptureData getTargetData(TargetDescriptor tDescr) throws java.lang.Exception
tDescr
- info on what the desired target looks likejava.lang.Exception
public void updateBounds() throws java.lang.Exception
java.lang.Exception
public float getPerimeter() throws java.lang.Exception
java.lang.Exception
public double getRoundness() throws java.lang.Exception
java.lang.Exception
public double getArea() throws java.lang.Exception
java.lang.Exception
public double signedArea() throws java.lang.Exception
java.lang.Exception
public boolean isCCW() throws java.lang.Exception
java.lang.Exception
public java.awt.geom.Point2D centroid() throws java.lang.Exception
java.lang.Exception
public boolean isOnBorder(java.awt.geom.Point2D p0) throws java.lang.Exception
p0
- the point to checkjava.lang.Exception
public boolean containsPlus(java.awt.geom.Point2D p0) throws java.lang.Exception
java.lang.Exception
public SpatialVector[] toSpatialVectors() throws java.lang.Exception
java.lang.Exception
public CaptureVariable toCaptureVariable() throws java.lang.Exception
java.lang.Exception
public java.awt.geom.Path2D toPath2D() throws java.lang.Exception
java.lang.Exception
public java.awt.Polygon toPolygon() throws java.lang.Exception
java.lang.Exception
public SGPolygon[] splitBoundByLength(int num) throws java.lang.Exception
num
- the number of longitudinal splitsjava.lang.Exception
public SGPolygon[] splitByLength(int num) throws java.lang.Exception
num
- the number of longitudinal splitsjava.lang.Exception
public SGPolygon intersect(SGPolygon rhs) throws java.lang.Exception
java.lang.Exception
public void doOrientation() throws java.lang.Exception
java.lang.Exception
public void list() throws java.lang.Exception
java.lang.Exception
public void listPoints() throws java.lang.Exception
java.lang.Exception
public void listToDebug() throws java.lang.Exception
java.lang.Exception
public void listSegments()
public java.lang.String toString()
toString
in class java.lang.Object
public void asSpatialMap() throws java.lang.Exception
java.lang.Exception
public void asSpatialMap(boolean xDirection, boolean yDirection) throws java.lang.Exception
xDirection
- do x values increase from left to right?yDirection
- do y values increase from top to bottom?java.lang.Exception
public void asSpatialMap(GridSpace3D theGridSpace, boolean xDirection, boolean yDirection) throws java.lang.Exception
theGridSpace
- the coordinate system for the mapxDirection
- do x values increase from left to right?yDirection
- do y values increase from top to bottom?java.lang.Exception
public boolean checkMinPoints(int minPoints) throws java.lang.Exception
minPoints
- the minimum number of pointsjava.lang.Exception
public Pixel getDarkestPixel()
public void setDarkestPixel(Pixel itsDarkestPixel)
RH, 2017