On 31/07/2013, at 5:20 AM, Sebastian Götte <jaseg@...2974...> wrote:
- The reason for not avoiding all obstacles by default is that libavoid can be slow -- O(n^2 log n) -- especially if there are a lot of obstacles. You don't want this slowness if you open a file with hundreds or thousands of objects that libavoid tracks as objects by default. That was the reason for the original decision to have the user explicit mark objects as obstacles for routing.
Shouldn't this be in O(n log n)?
Nope. In practice it's fast for small diagrams but parts of it are definitely O(n^2 log n) in the worst case. See the papers.
FWIW, newer versions of libavoid understand and track "connection pins". These are points specified based on a position on shapes. They move if the parent shape is moved and can be specified as the endpoints for connectors. You might want to make of these.
Thanks. This behavior can easily be implemented by putting a few SPPoints into a group with some shape. The new connector code just creates these SPPoints as needed, and handling of object centers/corners/nodes etc. should be done by just snapping their locations to these points.
[...]
By moving to SPPoints this is actually pretty non-problematic since they will just move with the groups containing them.
Fair enough. That sounds fine.
I will remove any logic from connector-context responsible for handling anything but two endpoints (if you want to draw a connector with multiple "stops", just chain together multiple connectors) and remove the "snap connector end point to connector's intersection with destination shape outline"-logic since I do not think this is too useful.
Do you mean the functionality that adjusts the endpoint of a connector to stop at the intersection with the destination shape? If so, the reason for this is that the arrowhead is drawn at the end of the connector and people frequently want this to coincide with the edge of the shape.
I removed that because it would have been even more work porting and because with the addition of SPPoints it is not really necessary anymore (I am not totally against re-adding it, though).
Do you mean that by placing a Point on the boundary at a particular position the arrowhead will be positioned there? If so, my experience is that people often want connectors that appear to be connected to the centre of shapes, but that are drawn just to the edge of the shape. Manually positioning points in the right place to achieve this effect could get very tedious indeed, especially when moving shapes around.
Cheers, Michael