ij.process
Class FloatPolygon
- java.lang.Object
-
- ij.process.FloatPolygon
-
public class FloatPolygon extends java.lang.ObjectUsed by the Roi classes to return float coordinate arrays and to determine if a point is inside or outside of spline fitted selections.
-
-
Field Summary
Fields Modifier and Type Field and Description intnpointsThe number of points.float[]xpointsfloat[]ypoints
-
Constructor Summary
Constructors Constructor and Description FloatPolygon()Constructs an empty FloatPolygon.FloatPolygon(float[] xpoints, float[] ypoints)Constructs a FloatPolygon from x and y arrays.FloatPolygon(float[] xpoints, float[] ypoints, int npoints)Constructs a FloatPolygon from x and y arrays.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method and Description voidaddPoint(double x, double y)voidaddPoint(float x, float y)booleancontains(float x, float y)Returns 'true' if the point (x,y) is inside this polygon.FloatPolygonduplicate()java.awt.RectanglegetBounds()java.awt.geom.Rectangle2D.DoublegetFloatBounds()doublegetLength(boolean isLine)
-
-
-
Field Detail
-
npoints
public int npoints
The number of points.
-
xpoints
public float[] xpoints
-
ypoints
public float[] ypoints
-
-
Constructor Detail
-
FloatPolygon
public FloatPolygon()
Constructs an empty FloatPolygon.
-
FloatPolygon
public FloatPolygon(float[] xpoints, float[] ypoints)Constructs a FloatPolygon from x and y arrays.
-
FloatPolygon
public FloatPolygon(float[] xpoints, float[] ypoints, int npoints)Constructs a FloatPolygon from x and y arrays.
-
-
Method Detail
-
contains
public boolean contains(float x, float y)Returns 'true' if the point (x,y) is inside this polygon. This is a Java version of the remarkably small C program by W. Randolph Franklin at http://www.ecse.rpi.edu/Homepages/wrf/Research/Short_Notes/pnpoly.html#The%20C%20Code
-
getBounds
public java.awt.Rectangle getBounds()
-
getFloatBounds
public java.awt.geom.Rectangle2D.Double getFloatBounds()
-
addPoint
public void addPoint(float x, float y)
-
addPoint
public void addPoint(double x, double y)
-
duplicate
public FloatPolygon duplicate()
-
getLength
public double getLength(boolean isLine)
-
-
DMelt 3.0 © DataMelt by jWork.ORG