/** Compute the change in depth as an edge is crossed from R to L */ private static int depthDelta(Label label) { int lLoc = label.getLocation(0, Position.LEFT); int rLoc = label.getLocation(0, Position.RIGHT); if (lLoc == Location.INTERIOR && rLoc == Location.EXTERIOR) return 1; else if (lLoc == Location.EXTERIOR && rLoc == Location.INTERIOR) return -1; return 0; }
/** * The location for a given eltIndex for a node will be one of { null, INTERIOR, BOUNDARY }. A * node may be on both the boundary and the interior of a geometry; in this case, the rule is that * the node is considered to be in the boundary. The merged location is the maximum of the two * input values. */ int computeMergedLocation(Label label2, int eltIndex) { int loc = Location.NONE; loc = label.getLocation(eltIndex); if (!label2.isNull(eltIndex)) { int nLoc = label2.getLocation(eltIndex); if (loc != Location.BOUNDARY) loc = nLoc; } return loc; }