< prev index next >

src/java.desktop/share/classes/sun/awt/geom/Order3.java

Print this page

        

*** 1,7 **** /* ! * Copyright (c) 1998, 2006, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it * under the terms of the GNU General Public License version 2 only, as * published by the Free Software Foundation. Oracle designates this --- 1,7 ---- /* ! * Copyright (c) 1998, 2018, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it * under the terms of the GNU General Public License version 2 only, as * published by the Free Software Foundation. Oracle designates this
*** 51,61 **** private double ycoeff0; private double ycoeff1; private double ycoeff2; private double ycoeff3; ! public static void insert(Vector<Curve> curves, double tmp[], double x0, double y0, double cx0, double cy0, double cx1, double cy1, double x1, double y1, int direction) --- 51,61 ---- private double ycoeff0; private double ycoeff1; private double ycoeff2; private double ycoeff3; ! public static void insert(Vector<Curve> curves, double[] tmp, double x0, double y0, double cx0, double cy0, double cx1, double cy1, double x1, double y1, int direction)
*** 158,168 **** * Completely horizontal curves need to be eliminated by other * means outside of this method. */ public static int getHorizontalParams(double c0, double cp0, double cp1, double c1, ! double ret[]) { if (c0 <= cp0 && cp0 <= cp1 && cp1 <= c1) { return 0; } c1 -= cp1; cp1 -= cp0; --- 158,168 ---- * Completely horizontal curves need to be eliminated by other * means outside of this method. */ public static int getHorizontalParams(double c0, double cp0, double cp1, double c1, ! double[] ret) { if (c0 <= cp0 && cp0 <= cp1 && cp1 <= c1) { return 0; } c1 -= cp1; cp1 -= cp0;
*** 189,199 **** * Split the cubic Bezier stored at coords[pos...pos+7] representing * the parametric range [0..1] into two subcurves representing the * parametric subranges [0..t] and [t..1]. Store the results back * into the array at coords[pos...pos+7] and coords[pos+6...pos+13]. */ ! public static void split(double coords[], int pos, double t) { double x0, y0, cx0, cy0, cx1, cy1, x1, y1; coords[pos+12] = x1 = coords[pos+6]; coords[pos+13] = y1 = coords[pos+7]; cx1 = coords[pos+4]; cy1 = coords[pos+5]; --- 189,199 ---- * Split the cubic Bezier stored at coords[pos...pos+7] representing * the parametric range [0..1] into two subcurves representing the * parametric subranges [0..t] and [t..1]. Store the results back * into the array at coords[pos...pos+7] and coords[pos+6...pos+13]. */ ! public static void split(double[] coords, int pos, double t) { double x0, y0, cx0, cy0, cx1, cy1, x1, y1; coords[pos+12] = x1 = coords[pos+6]; coords[pos+13] = y1 = coords[pos+7]; cx1 = coords[pos+4]; cy1 = coords[pos+5];
*** 527,537 **** return 0; } } public double nextVertical(double t0, double t1) { ! double eqn[] = {xcoeff1, 2 * xcoeff2, 3 * xcoeff3}; int numroots = QuadCurve2D.solveQuadratic(eqn, eqn); for (int i = 0; i < numroots; i++) { if (eqn[i] > t0 && eqn[i] < t1) { t1 = eqn[i]; } --- 527,537 ---- return 0; } } public double nextVertical(double t0, double t1) { ! double[] eqn = {xcoeff1, 2 * xcoeff2, 3 * xcoeff3}; int numroots = QuadCurve2D.solveQuadratic(eqn, eqn); for (int i = 0; i < numroots; i++) { if (eqn[i] > t0 && eqn[i] < t1) { t1 = eqn[i]; }
*** 539,549 **** return t1; } public void enlarge(Rectangle2D r) { r.add(x0, y0); ! double eqn[] = {xcoeff1, 2 * xcoeff2, 3 * xcoeff3}; int numroots = QuadCurve2D.solveQuadratic(eqn, eqn); for (int i = 0; i < numroots; i++) { double t = eqn[i]; if (t > 0 && t < 1) { r.add(XforT(t), YforT(t)); --- 539,549 ---- return t1; } public void enlarge(Rectangle2D r) { r.add(x0, y0); ! double[] eqn = {xcoeff1, 2 * xcoeff2, 3 * xcoeff3}; int numroots = QuadCurve2D.solveQuadratic(eqn, eqn); for (int i = 0; i < numroots; i++) { double t = eqn[i]; if (t > 0 && t < 1) { r.add(XforT(t), YforT(t));
*** 554,564 **** public Curve getSubCurve(double ystart, double yend, int dir) { if (ystart <= y0 && yend >= y1) { return getWithDirection(dir); } ! double eqn[] = new double[14]; double t0, t1; t0 = TforY(ystart); t1 = TforY(yend); eqn[0] = x0; eqn[1] = y0; --- 554,564 ---- public Curve getSubCurve(double ystart, double yend, int dir) { if (ystart <= y0 && yend >= y1) { return getWithDirection(dir); } ! double[] eqn = new double[14]; double t0, t1; t0 = TforY(ystart); t1 = TforY(yend); eqn[0] = x0; eqn[1] = y0;
*** 606,616 **** public Curve getReversedCurve() { return new Order3(x0, y0, cx0, cy0, cx1, cy1, x1, y1, -direction); } ! public int getSegment(double coords[]) { if (direction == INCREASING) { coords[0] = cx0; coords[1] = cy0; coords[2] = cx1; coords[3] = cy1; --- 606,616 ---- public Curve getReversedCurve() { return new Order3(x0, y0, cx0, cy0, cx1, cy1, x1, y1, -direction); } ! public int getSegment(double[] coords) { if (direction == INCREASING) { coords[0] = cx0; coords[1] = cy0; coords[2] = cx1; coords[3] = cy1;
< prev index next >