void makePolygonRelative() { FloatPolygon poly = new FloatPolygon(xpf, ypf, nPoints); Rectangle r = poly.getBounds(); x = r.x; y = r.y; width = r.width; height = r.height; for (int i=0; i<nPoints; i++) { xpf[i] = xpf[i]-x; ypf[i] = ypf[i]-y; } }
void makePolygonRelative() { FloatPolygon poly = new FloatPolygon(xpf, ypf, nPoints); Rectangle r = poly.getBounds(); x = r.x; y = r.y; width = r.width; height = r.height; bounds = null; for (int i=0; i<nPoints; i++) { xpf[i] = xpf[i]-x; ypf[i] = ypf[i]-y; } }
void makePolygonRelative() { FloatPolygon poly = new FloatPolygon(xpf, ypf, nPoints); Rectangle r = poly.getBounds(); x = r.x; y = r.y; width = r.width; height = r.height; for (int i=0; i<nPoints; i++) { xpf[i] = xpf[i]-x; ypf[i] = ypf[i]-y; } }
void makePolygonRelative() { FloatPolygon poly = new FloatPolygon(xpf, ypf, nPoints); Rectangle r = poly.getBounds(); x = r.x; y = r.y; width = r.width; height = r.height; bounds = null; for (int i=0; i<nPoints; i++) { xpf[i] = xpf[i]-x; ypf[i] = ypf[i]-y; } }
private void resetSplineFitBoundingRect() { if (splinePoints==0) return; float xbase = (float)getXBase(); float ybase = (float)getYBase(); float xSpline0 = xSpline[0]; float ySpline0 = ySpline[0]; for (int i=0; i<splinePoints; i++) { xSpline[i] = xSpline[i]+xbase; ySpline[i] = ySpline[i]+ybase; } FloatPolygon poly = new FloatPolygon(xSpline, ySpline, splinePoints); Rectangle r = poly.getBounds(); x = r.x;; y = r.y; width = r.width; height = r.height; bounds = poly.getFloatBounds(); xbase = (float)bounds.x; ybase = (float)bounds.y; for (int i=0; i<splinePoints; i++) { xSpline[i] -= xbase; ySpline[i] -= ybase; } for (int i=0; i<nPoints; i++) { xpf[i] -= xSpline0 - xSpline[0]; ypf[i] -= ySpline0 - ySpline[0]; } }
private void resetSplineFitBoundingRect() { if (splinePoints==0) return; float xbase = (float)getXBase(); float ybase = (float)getYBase(); float xSpline0 = xSpline[0]; float ySpline0 = ySpline[0]; for (int i=0; i<splinePoints; i++) { xSpline[i] = xSpline[i]+xbase; ySpline[i] = ySpline[i]+ybase; } FloatPolygon poly = new FloatPolygon(xSpline, ySpline, splinePoints); Rectangle r = poly.getBounds(); x = r.x;; y = r.y; width = r.width; height = r.height; bounds = poly.getFloatBounds(); xbase = (float)bounds.x; ybase = (float)bounds.y; for (int i=0; i<splinePoints; i++) { xSpline[i] -= xbase; ySpline[i] -= ybase; } for (int i=0; i<nPoints; i++) { xpf[i] -= xSpline0 - xSpline[0]; ypf[i] -= ySpline0 - ySpline[0]; } }
private void resetSubPixelBoundingRect() { //IJ.log("resetSubPixelBoundingRect: "+state+" "+bounds); if (xSpline!=null) { resetSplineFitBoundingRect(); return; } float xbase = (float)getXBase(); float ybase = (float)getYBase(); for (int i=0; i<nPoints; i++) { xpf[i] = xpf[i]+xbase; ypf[i] = ypf[i]+ybase; } FloatPolygon poly = new FloatPolygon(xpf, ypf, nPoints); Rectangle r = poly.getBounds(); x = r.x;; y = r.y; width = r.width; height = r.height; bounds = poly.getFloatBounds(); xbase = (float)bounds.x; ybase = (float)bounds.y; for (int i=0; i<nPoints; i++) { xpf[i] -= xbase; ypf[i] -= ybase; } }
private void resetSubPixelBoundingRect() { //IJ.log("resetSubPixelBoundingRect: "+state+" "+bounds); if (xSpline!=null) { resetSplineFitBoundingRect(); return; } float xbase = (float)getXBase(); float ybase = (float)getYBase(); for (int i=0; i<nPoints; i++) { xpf[i] = xpf[i]+xbase; ypf[i] = ypf[i]+ybase; } FloatPolygon poly = new FloatPolygon(xpf, ypf, nPoints); Rectangle r = poly.getBounds(); x = r.x;; y = r.y; width = r.width; height = r.height; bounds = poly.getFloatBounds(); xbase = (float)bounds.x; ybase = (float)bounds.y; for (int i=0; i<nPoints; i++) { xpf[i] -= xbase; ypf[i] -= ybase; } }
float ybase0 = (float)getYBase(); FloatPolygon poly = new FloatPolygon(xpf, ypf, nPoints); Rectangle r = poly.getBounds(); x = r.x; y = r.y;
float ybase0 = (float)getYBase(); FloatPolygon poly = new FloatPolygon(xpf, ypf, nPoints); Rectangle r = poly.getBounds(); x = r.x; y = r.y;