cxbrooks / test

Second test for bugzilla to git
0 stars 0 forks source link

Manhattan link layout algorithm is too primitive #76

Open cxbrooks opened 16 years ago

cxbrooks commented 16 years ago

Note: the issue was created automatically with bugzilla2github tool

Original bug ID: BZ#144 From: @cxbrooks Reported version: 7.1.devel CC: pt-dev@chess.eecs.berkeley.edu

cxbrooks commented 16 years ago

Ian Brown writes:

The Manhattan router is too primitive. Ideally, it should route intelligently in order to avoid crossing. That's quite difficult though – a simpler first step >would be to allow the user to adjust where the single 'kink' in the line is. >Currently, the router always kinks at 50%. Consider the picture below. It's >confusing because all the routes break at 50%. If, via a 3rd grab handle, you >could change this fixed 50% to another value then you could at least alter the >diagram by hand to avoid the crossings without having the move the positions of >the actors.

There are several components to this: 1) It should be easier to break links and insert relations, see: https://chess.eecs.berkeley.edu/bugzilla/show_bug.cgi?id=22 "Should not need relation black diamonds," which discusses inserting a relation in a link.

2) Relation Groups, introduced in Ptolemy II 6.0.2 might be of interest. Relation groups are two relations that are connected, which allows more complex graphical layouts to be used. The 6.0.2 release notes say:

"Relations mediate connections between ports. For flexibility, particularly with visual syntaxes, the Ptolemy II abstract syntax permits any number of relations to be involved in any one connection. Relations may be linked to other relations. Any two relations that are linked are said to be members of the same relation group. Specifically, a relation group is a maximal set of linked relations. Semantically, a relation group has the same meaning as a single relation. The API of the Relation class, support linking and unlinking relations, and also provides a method to obtain a list of all the relations in a relation group."

"In a relation group, there is no significance to the order in which relations are linked, unlike the order in which ports are linked to relations. Also, unlike links between relations and ports, there is no significance to multiple links between the same relations. Any two relations are either linked or not linked."

3) Visio has a pretty good way of laying out connectors.

4) A separate enhancement would be using different automatic layout tools to layout models. There are plenty of them out there, I think http://www.graphviz.org/ is one. The layout tool should be open source and implemented in Java.

cxbrooks commented 16 years ago

Ian writes:

Doing the layout well is indeed a complex issue. The ability to manually tweak the layout would be a quick win though. I was thinking that we could add a 3rd manipulator handle to the Manhattan link which could be used to adjust the break percentage. Instead of hard-coding it at 50%, the middle handle could be used to change it to a different percentage. It's a bit like the 3rd handle on the arc link that is used to change the radius of the arc.

There was further discussion in email from Ian on Mar 20, 2008, but the gist of the solution is above.