/** * Creates a new instance with a given message and approximate location. * * @param msg a string * @param pt the location of the error */ public ConstraintEnforcementException(String msg, Coordinate pt) { super(msgWithCoord(msg, pt)); this.pt = new Coordinate(pt); }
/** * Enforces the supplied constraints into the triangulation. * * @throws ConstraintEnforcementException * if the constraints cannot be enforced */ public void enforceConstraints() { addConstraintVertices(); // if (true) return; int count = 0; int splits = 0; do { splits = enforceGabriel(segments); count++; Debug.println("Iter: " + count + " Splits: " + splits + " Current # segments = " + segments.size()); } while (splits > 0 && count < MAX_SPLIT_ITER); if (count == MAX_SPLIT_ITER) { Debug.println("ABORTED! Too many iterations while enforcing constraints"); if (!Debug.isDebugging()) throw new ConstraintEnforcementException( "Too many splitting iterations while enforcing constraints. Last split point was at: ", splitPt); } }
/** * Enforces the supplied constraints into the triangulation. * * @throws ConstraintEnforcementException * if the constraints cannot be enforced */ public void enforceConstraints() { addConstraintVertices(); // if (true) return; int count = 0; int splits = 0; do { splits = enforceGabriel(segments); count++; Debug.println("Iter: " + count + " Splits: " + splits + " Current # segments = " + segments.size()); } while (splits > 0 && count < MAX_SPLIT_ITER); if (count == MAX_SPLIT_ITER) { Debug.println("ABORTED! Too many iterations while enforcing constraints"); if (!Debug.isDebugging()) throw new ConstraintEnforcementException( "Too many splitting iterations while enforcing constraints. Last split point was at: ", splitPt); } }
/** * Creates a new instance with a given message and approximate location. * * @param msg a string * @param pt the location of the error */ public ConstraintEnforcementException(String msg, Coordinate pt) { super(msgWithCoord(msg, pt)); this.pt = new Coordinate(pt); }