| Summary: | Remove getNearestIntersection() from ICurve and provide Point.nearest() instead. | ||
|---|---|---|---|
| Product: | [Tools] GEF | Reporter: | Alexander Nyßen <nyssen> |
| Component: | GEF Geometry | Assignee: | Alexander Nyßen <nyssen> |
| Status: | RESOLVED FIXED | QA Contact: | |
| Severity: | normal | ||
| Priority: | P3 | ||
| Version: | 0.2.0 | ||
| Target Milestone: | 4.0.0 (Neon) M6 | ||
| Hardware: | All | ||
| OS: | All | ||
| Whiteboard: | |||
Pushed the following changes to origin/master: - Removed getNearestIntersection(ICurve, Point) from ICurve interface and all implementations. - Removed static delegation method from CurveUtils. - Added Point.nearest(Point, Point[]) as a replacement to compute nearest point from a set of given point. - Adjusted test cases and ChopBoxAnchor accordingly. Resolving as fixed in 4.0.0 M6. Ensured that Point.nearest(Point, Point[]) is safe against an empty candidates array. Thereby, the former functionality can now be achieved by: Point.nearest(reference, getIntersections(c1, c2)); Leaving as resolved in 4.0.0 M6. |
We currently provide a very special operation to determine the nearest intersection point between two curves with respect to a given reference point. We should remove that from ICurve and instead provide utility method to Point instead, so that nearest intersection point can easily be computed as follows (and the interface is not "polluted"): Point[] intersections = getIntersections(curve1, curve2); if (intersections.length > 0) { // find nearest intersection point return Point.nearest(reference, intersections); }