setLabelBoundary method
Updates the label of a node to BOUNDARY, obeying the mod-2 boundaryDetermination rule.
Implementation
void setLabelBoundary(int argIndex) {
if (label == null) return;
// determine the current location for the point (if any)
int loc = Location.NONE;
if (label != null) loc = label!.getLocation(argIndex);
// flip the loc
int newLoc;
switch (loc) {
case Location.BOUNDARY:
newLoc = Location.INTERIOR;
break;
case Location.INTERIOR:
newLoc = Location.BOUNDARY;
break;
default:
newLoc = Location.BOUNDARY;
break;
}
label!.setLocationWithIndex(argIndex, newLoc);
}