/*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* under the terms of the GNU General Public License version 2 only, as
* published by the Free Software Foundation. Oracle designates this
* particular file as subject to the "Classpath" exception as provided
* by Oracle in the LICENSE file that accompanied this code.
*
* This code is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
* version 2 for more details (a copy is included in the LICENSE file that
* accompanied this code).
*
* You should have received a copy of the GNU General Public License version
* 2 along with this work; if not, write to the Free Software Foundation,
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
*
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
* or visit www.oracle.com if you need additional information or have any
* questions.
*/
public abstract class AreaOp {
boolean inLeft;
boolean inRight;
boolean inResult;
public void newRow() {
inLeft = false;
inRight = false;
inResult = false;
}
if (e.getCurveTag() == CTAG_LEFT) {
} else {
}
return ETAG_IGNORE;
}
}
public int getState() {
}
boolean inRight);
}
}
}
}
}
}
}
}
}
private int count;
public void newRow() {
count = 0;
}
// Note: the right curves should be an empty set with this op...
// assert(e.getCurveTag() == CTAG_LEFT);
}
public int getState() {
}
}
private boolean inside;
public void newRow() {
inside = false;
}
// Note: the right curves should be an empty set with this op...
// assert(e.getCurveTag() == CTAG_LEFT);
}
public int getState() {
}
}
private AreaOp() {
}
/* Constants to tag the left and right curves in the edge list */
/* Constants to classify edges */
/* Constants used to classify result state */
public abstract void newRow();
public abstract int getState();
if (false) {
for (int i = 0; i < numcurves; i++) {
}
}
return edges;
}
while (enum_.hasMoreElements()) {
if (c.getOrder() > 0) {
}
}
}
return 0;
}
}
return -1;
}
return 1;
}
};
if (numedges < 2) {
return edges;
}
if (false) {
for (int i = 0; i < numedges; i++) {
}
}
Edge e;
int left = 0;
int right = 0;
int cur = 0;
int next = 0;
double yrange[] = new double[2];
// Active edges are between left (inclusive) and right (exclusive)
double y = yrange[0];
// Prune active edges that fall off the top of the active y range
}
next--;
}
}
// Grab a new "top of Y range" if the active edges are empty
break;
}
if (y > yrange[0]) {
}
yrange[0] = y;
}
// Incorporate new active edges that enter the active y range
break;
}
right++;
}
// Sort the current active edges by their X values and
// determine the maximum valid Y range where the X ordering
// is correct
if (yrange[1] > y) {
yrange[1] = y;
}
}
if (false) {
}
}
// Note: We could start at left+1, but we need to make
// sure that edgelist[left] has its equivalence set to 0.
int nexteq = 1;
e.setEquivalence(0);
}
if (ordering >= 0) {
if (ordering == 0) {
// If the curves are equal, mark them to be
// deleted later if they cancel each other
// out so that we avoid having extraneous
// curve segments.
if (eq == 0) {
}
e.setEquivalence(eq);
}
break;
}
}
}
if (false) {
}
}
// Now prune the active edge list.
// For each edge in the list, determine its classification
// (entering shape, exiting shape, ignore - no change) and
// record the current Y range and its classification in the
// Edge object for use later in constructing the new outline.
newRow();
int etag;
int eq = e.getEquivalence();
if (eq != 0) {
// Find one of the segments in the "equal" range
// with the right transition state and prefer an
// edge that was either active up until ystart
// or the edge that extends the furthest downward
// (i.e. has the most potential for continuation)
: AreaOp.ETAG_ENTER);
Edge longestmatch = e;
do {
// Note: classify() must be called
// on every edge we consume here.
classify(e);
if (activematch == null &&
{
activematch = e;
}
if (y > furthesty) {
longestmatch = e;
furthesty = y;
}
--cur;
} else {
}
} else {
}
}
}
// assert(getState() == AreaOp.RSTAG_OUTSIDE);
} else {
}
int eq = e.getEquivalence();
if (eq != 0) {
}
}
}
if (false) {
}
}
// Finally capture the bottom of the valid Y range as the top
// of the next Y range.
}
while (enum_.hasMoreElements()) {
}
}
}
return ret;
}
if (numchains == 0) {
return;
}
throw new InternalError("Odd number of chains!");
}
}
}
}
{
if (numlinks == 0) {
} else {
throw new InternalError("Odd number of new curves!");
}
}
if (numchains == 0) {
} else {
throw new InternalError("Odd number of chains!");
}
}
int curchain = 0;
int curlink = 0;
/*
* Strategy 1:
* Connect chains or links if they are the only things left...
*/
if (!connectchains && !connectlinks) {
// assert(link != null && chain != null);
/*
* Strategy 2:
* Connect chains or links if they close off an open area...
*/
if (!connectchains && !connectlinks) {
/*
* Strategy 3:
* Connect chains or links if their successor is
* between them and their potential connectee...
*/
}
}
if (connectchains) {
}
curchain += 2;
}
if (connectlinks) {
curlink += 2;
}
if (!connectchains && !connectlinks) {
// assert(link != null);
// assert(chain != null);
// assert(chain.getEtag() == link.getEtag());
curchain++;
curlink++;
}
}
}
}
/*
* Does the position of the next edge at v1 "obstruct" the
* connectivity between current edge and the potential
* partner edge which is positioned at v2?
*
* Phase tells us whether we are testing for a transition
* into or out of the interior part of the resulting area.
*
* Require 4-connected continuity if this edge and the partner
* edge are both "entering into" type edges
* Allow 8-connected continuity for "exiting from" type edges
*/
}
}