I have a list of points created during design time. when I run my program a shape is created according to the order in which the points have been added. When I then click on the shape , a new point is created according to the position of the mouse relative to the drawing area in my application. My problem is , my list is already in a specific order and I am having trouble figuring out a proper method to work out if the new point is before or after the current point already drawn on the shape.
Share
A fairly standard approach would be that new points are always appended to the end of shape list of points. To instert a new point you would right click (or someother toolbar op) context menu insert point.
At this moment you have to locate the 2 nearest existing points in the shape to your clicked insert point (distance metric) and insert in your new point in shape between the two.