Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.

Bug 488367

Summary: Add support for computing the horizontally/vertically nearest point on an ICurve with respect to a given reference point.
Product: [Tools] GEF Reporter: Alexander Nyßen <nyssen>
Component: GEF GeometryAssignee: gef-inbox <gef-inbox>
Status: RESOLVED DUPLICATE QA Contact:
Severity: normal    
Priority: P3 CC: matthias.wienand
Version: 0.2.0   
Target Milestone: ---   
Hardware: All   
OS: All   
Whiteboard:

Description Alexander Nyßen CLA 2016-02-24 04:27:08 EST
As a prerequisite for computing proper anchor positions for orthogonal connection routing (see bug #488355), we need to provide means to compute the horizontally and/or vertically nearest point on a curve w.r.t. a given reference point (i.e. the nearest point on the curve having the same y- respectively x-coordinate). 

We can compute such a point by creating a Line inside the bounds of the curve, at the respective y- or x-coordinate of the reference point and to compute the nearest intersection of the curve with the respective line. 

In case the line and the curve overlap, we have to fall back to computing the overlap (see bug #488366) and to determine the nearest point on the overlap to the reference point (see bug #488355)
Comment 1 Alexander Nyßen CLA 2016-02-24 09:05:05 EST
I added a first draft of respective orthogonal projection in terms of static methods inside ChopBoxAnchor#OrthogonalProjectionStrategy. However, in case of overlaps, the nearest projection needs to be determined (corner case), which requires the functionality requested in bug #488354. We can extract the orthogonal projection computation from the computation strategy (and move it to GEF4 Geometry) as soon as all prerequisites are resolved.
Comment 2 Matthias Wienand CLA 2016-03-01 10:35:49 EST
As all overlaps have to be lines, the dependency on bug #488354 is no longer required. Further, we decided to leave the functionality in OrthogonalProjectionStrategy instead of moving it to GEF4 Geometry. Therefore, I resolve this as duplicate of bug #488355.

*** This bug has been marked as a duplicate of bug 488355 ***