|
|
Re: Manhattan Connection routing [message #1003563 is a reply to message #1003523] |
Mon, 21 January 2013 14:19 |
|
Yes, that's exactly right; I use a LayoutFeature to apply routing constraints to a FreeFormConnection "after the fact", that is after a Connection handle has been added, moved or removed, after a connected Shape has been moved or resized, or one of the FixPointAnchors has been moved.
Not sure how easy this would be to add to an EditPart - I haven't looked at GEF in a long time, so would have to familiarize myself with this again. The routing algorithm itself is relatively simple and I'm sure the concepts could be reused easily enough.
|
|
|
|
Re: Manhattan Connection routing [message #1067830 is a reply to message #1002803] |
Wed, 10 July 2013 18:34 |
|
I wonder if there is any progress on this issue so that the enhanced ManhattanConnectionRouter can be reused in a generic Graphiti diagram editor. The code in bpmn2 editor has too much dependency on bpmn2 core components.
Or anyone can point me to the right direction?
Thanks
Jack
|
|
|
Re: Manhattan Connection routing [message #1067971 is a reply to message #1067830] |
Thu, 11 July 2013 13:38 |
|
Hi Jack,
The existing manhattan router is a bit primitive because it tries to blindly calculate a route without prior knowledge of shapes and connections that may cause collisions or intersections. It works well enough for now, but I'm still working on a different algorithm which will be robust enough to navigate any topography and find routing solutions. This will eventually become what I hope to contribute to Graphiti.
This new router (the RouteSolver and RoutingNet classes) is still experimental and takes a different approach: it first calculates a navigable net of "empty space" (rectangles) between shapes, and then finds one or more optimal solutions that represent a minimal chain leading from the source to the target shape. The screen capture here illustrates what I mean:
The green rectangles are the empty spaces that are adjacent to the source shape, red are those adjacent to the target shape and light gray is everything in between. The light blue arrows are the navigable links that connect all of the empty spaces. All that needs to be done is to determine an optimal solution, and then route the connection inside the empty spaces that form this solution. The connection could consist of either orthogonal (manhattan) line segments, or diagonals (direct routing) depending on preference; the resulting connection would avoid shape collisions and intersections with other connections.
As I mentioned, this route solver can handle any topography, and will be able to find a solution for, e.g. the case where the target shape is "hidden" inside the "U" shape formed by the 3 tasks. Of course, if a shape is completely surrounded by other shapes, there is no solution.
If anyone is interested in helping expand on this idea (or if there are better ideas out there) I'm open to suggestions
BTW, the RoutingNet class has Graphiti features to draw the emtpy spaces and links and I've been using this to visualize an optimal solution to the routing problem.
Bob
|
|
|
|
Re: Manhattan Connection routing [message #1067987 is a reply to message #1067977] |
Thu, 11 July 2013 15:04 |
|
Sadly this is not very high on my priority list at the moment, because it's just me working on this project (with the occasional patch contributed by generous community members )
Right now, I'm focused on bug fixing and getting ready for integration with jBPM, so we're looking at end of 2013 before I can start thinking about this feature again. If your company has any free resources to help out with this, it would be a big help.
Bob
|
|
|
Re: Manhattan Connection routing [message #1070203 is a reply to message #1067987] |
Wed, 17 July 2013 12:46 |
|
Robert,
I have spent a few days trying out the code from BPMN2. I have done some experiments with it. I figure out a way to use the router in my plugin. What I did was copying the layout feature and remove the preference API calls and invoke the static connect method.
In the mean time, I am also trying to figure out how to remove the dependency from bpmn model and edit bundles. But it is time consuming. If I got any result, I will post it here.
Thanks
Jack
|
|
|
|
|
|
Re: Manhattan Connection routing [message #1072335 is a reply to message #1070788] |
Mon, 22 July 2013 14:44 |
|
Robert,
We need some help.
Can you change a few instance variables from (default) to protected and remove final keyword ManhattanConnectionRouter if that is possible or allowed at all.
We tried to extend MnahattanConnectionRouter in my local environment. You can sync to my git repository to see what need to be changes.
Thanks
Jack
|
|
|
Re: Manhattan Connection routing [message #1072772 is a reply to message #1072335] |
Tue, 23 July 2013 13:15 |
|
OK, done. I've sent a pull request for some changes required in your BaseManhattanConnectionRouter.
The changes in BPMN2 Modeler will be available in tonight's build, or you can just pull the latest code from the eclipse git repo.
Thanks,
Bob
|
|
|
Re: Manhattan Connection routing [message #1072799 is a reply to message #1072772] |
Tue, 23 July 2013 14:16 |
|
Robert,
I think you may have not checked in some of your changes yet as r.setRank() is not compiled yet.
I am thinking to extend ManhattanConnectionRouter directly, but it is final. Do you think it is OK to remove the final keyword? I attach a patch to help explain what needs to be changed so that I can use it in my app.
Thanks
Jack
|
|
|
|
Re: Manhattan Connection routing [message #1072817 is a reply to message #1072811] |
Tue, 23 July 2013 15:15 |
|
Robert,
I got it from git url:
git://git.eclipse.org/gitroot/bpmn2-modeler/org.eclipse.bpmn2-modeler.git
Never mind, I may get it later as the system may to to refresh itself.
But I have fixed another issue in updateConnection. We have more level of nested ContainerShapes so this code is changed to:
public static void updateConnections(IFeatureProvider fp, AnchorContainer ac) {
List<Connection> alreadyUpdated = new ArrayList<Connection>();
if (ac instanceof ContainerShape) {
TreeIterator<EObject> itr = ac.eAllContents();
while (itr.hasNext()) {
EObject child = itr.next();
// for (Shape child : ((ContainerShape)ac).getChildren()) {
if (child instanceof ContainerShape)
updateConnections(fp, (AnchorContainer)child, alreadyUpdated);
}
}
updateConnections(fp, ac, alreadyUpdated);
}
I am not familar with git command but I can try to figure out how to submit a push to upstream so you can get it from within Eclipse.
Thanks
Jack
|
|
|
|
|
|
|
Powered by
FUDForum. Page generated in 0.03622 seconds