On 23/07/2013, at 9:07 PM, Sebastian Götte <jaseg@...> wrote:
> I'm moving on refactoring the connectors code. I just changed the toolbar a little bit so every connector type has its own button. During refactoring, two questions arised:
> 1. What does "Ege" as in "EgeAdjustmentAction" mean?
> 2. What semantics do we want concerning which objects are to be avoided by a connector?
> A little elaboration on the second question:
> Currently, Inkscape uses libavoid to route object-avoiding connectors. All object which should be avoided by the router are added an "inkscape:connector-avoid" attribute. This does not, e.g., allow an object to be avoided by certain connectors and ignored by others.
> I can currently see three obvious solutions to that problem:
> * Avoid objects based on group/layer membership. E.g. avoid any objects on the same top-level layer but ignore others.
> Personally, I favor the second solution since I think it is less hacky and more flexible. I think it would be a sane choice to have connectors avoid objects by default and to explicitely mark objects to be ignored while routing. If you wanted a connector ignoring any objects you could just use the non-libavoid routing types I am just adding.
> * Any combination of the above
A couple of quick thoughts:
- You won't get the behaviour of avoiding specific obstacles with different connectors using libavoid, since it routes connectors using a single visibility graph built from the obstacles for the whole diagram.
- I think it would be fine to mark objects as obstacles using something other than a property.
- 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.
> I'm now moving on to implement (somewhat minimalistic) "points" as described in  so I can then head towards renovating connector-context.cpp. My latest commit to launchpad breaks in an assertion when drawing a connector since it needs these changes. The commit before that should work, though.
> These "points" will be placed whenever one places a connector's end, except if one places a connector's end on an existing "point". When drawing a connector, all visible points will be rendered as knots. This enables template-based diagram elements which are just are groups that contain a shape and one or more points for the connector to attach
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.
It could be worth updating the version of libavoid in Inkscape to the latest version found here:
The only real work there would be how you find and track attached objects once using connection pins.
I think there was a previous dev who started doing the connection pin work in Inkscape but I'm not sure what happened to that. It doesn't seem to be on the trunk.
> 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.
Dr. Michael Wybrow, Research Fellow
Monash Adaptive Visualisation Lab (MArVL)
Caulfield School of Information Technology
Monash University, Caulfield, Australia
Phone: +613 9905 2479
Mobile: +614 2577 2053
Please note I am part-time and do not work on Wednesdays.