public class ContourRegion extends Object
Modifier and Type | Class and Description |
---|---|
static class |
ContourRegion.ContourRegionType
An enumeration that indicates the type of a contour region.
|
Modifier and Type | Method and Description |
---|---|
double |
getAbsoluteArea()
Gets the absolute value of the overall area of the region.
|
double |
getAdjustedArea()
Get the area for the region excluding that of any enclosed
regions.
|
double |
getArea()
Gets the signed area of the region.
|
ContourRegion.ContourRegionType |
getContourRegionType()
Gets an enumerated value indicating what kind of contour
region this instance represents.
|
List<ContourRegion> |
getEnclosedRegions()
Gets a list of regions that are enclosed by this region.
|
Path2D |
getPath2D(AffineTransform transform)
Gets a Path2D suitable for rendering purposes including both the outer
polygon and any internal (nested child) polygons.
|
Path2D |
getPath2DWithoutNesting(AffineTransform transform)
Gets a Path2D suitable for rendering purposes.
|
int |
getRegionIndex()
Gets the index of the region.
|
Point2D |
getTestPoint()
Gets a point lying on one of the segments in the region to support testing
for polygon enclosures.
|
double[] |
getXY()
Get the XY coordinates for the contour region.
|
boolean |
isPointInsideRegion(double[] xy,
double x,
double y)
Indicates whether the specified point is inside a closed polygon.
|
boolean |
isPointInsideRegion(double x,
double y)
Indicates whether the specified point is inside the region
|
String |
toString() |
public double[] getXY()
{ (x0,y0), (x1,y1), (x2,y2), etc. }.
public boolean isPointInsideRegion(double x, double y)
x
- the Cartesian coordinate for the point of interesty
- the Cartesian coordinate for the point of interestpublic boolean isPointInsideRegion(double[] xy, double x, double y)
xy
- an array giving the Cartesian coordinates of the closed, simple
polygon for the region to be tested.x
- the Cartesian coordinate for the point of interesty
- the Cartesian coordinate for the point of interestpublic double getAbsoluteArea()
public double getAdjustedArea()
public double getArea()
public int getRegionIndex()
At this time, regions are not constructed for areas of null data. In future implementations, null-data regions will be indicated by a region index of -1.
public Path2D getPath2DWithoutNesting(AffineTransform transform)
transform
- a valid AffineTransform, typically specified to map the
Cartesian coordinates of the contour to pixel coordinate.public Path2D getPath2D(AffineTransform transform)
transform
- a valid AffineTransform, typically specified to map the
Cartesian coordinates of the contour to pixel coordinate.public Point2D getTestPoint()
public List<ContourRegion> getEnclosedRegions()
public ContourRegion.ContourRegionType getContourRegionType()
Copyright © 2021. All rights reserved.