Page Index Toggle Pages: 1 Send TopicPrint
Normal Topic Routing links orthogonally (Read 3858 times)
Cornel
YaBB Newbies
*
Offline


I love YaBB 1G - SP1!

Posts: 23
Joined: Dec 17th, 2008
Routing links orthogonally
Mar 12th, 2010 at 11:08am
Print Post  
Hi,
We need to route links (polyline) orthogonaly.
The QuickRouter seems to do the job, but when a link like "]" is drawn the horizontal segments are too big and the vertical segment is too far from nodes.
The GridRouter doesn't draw the links orthogonally.
How to solve this?
Thanks,
Cornel
  
Back to top
 
IP Logged
 
Stoyo
God Member
*****
Offline


MindFusion support

Posts: 13230
Joined: Jul 20th, 2005
Re: Routing links orthogonally
Reply #1 - Mar 12th, 2010 at 11:33am
Print Post  
You could set the links' Style to Cascading if you need them routed orthogonally.

Stoyan
  
Back to top
 
IP Logged
 
Cornel
YaBB Newbies
*
Offline


I love YaBB 1G - SP1!

Posts: 23
Joined: Dec 17th, 2008
Re: Routing links orthogonally
Reply #2 - Mar 16th, 2010 at 8:40am
Print Post  
Hi Stoyan,
We cannot set the style to Cascading because we need polylines. Only the route proposed should be orthogonal when users ask for that.
We tried to set the style to Cascading before route and then to set it back to Polyline but the results were not what we expected. The QuickRouter routes polylines orthogonally, the only problem is that a lot of space is taken, like in the picture bellow:


The link between B-T02 and B-A02 is routed too far from the nodes; also the link between B-A02 and B-T03.
How to fix this?
Thanks,
Cornel
  
Back to top
 
IP Logged
 
Stoyo
God Member
*****
Offline


MindFusion support

Posts: 13230
Joined: Jul 20th, 2005
Re: Routing links orthogonally
Reply #3 - Mar 16th, 2010 at 11:15am
Print Post  
Hi,

You could clone the cascading links' ControlPoints after routing them with GridRouter, and assign them back to the link after changing Style to Polyline. Or otherwise you might add some temporary obstacle nodes around the pizzeria thing to make sure the links do not cross the boundary there.

QuickRouter has some code that shortens U-bends to be no longer than 3cm, and it seems you are getting about that limit. We'll expose this as a property so you could set it to a smaller value.

Stoyan
  
Back to top
 
IP Logged
 
Cornel
YaBB Newbies
*
Offline


I love YaBB 1G - SP1!

Posts: 23
Joined: Dec 17th, 2008
Re: Routing links orthogonally
Reply #4 - Mar 17th, 2010 at 8:03am
Print Post  
Hi Stoyan,
I already did that, but the problem is that when I change the style the origin and destination points change.
This morning I read the post http://mindfusion.eu/Forum/YaBB.pl?board=fcnet_disc;action=display;num=126874717... and after that I did the following: first I keep the original origin and destination points; then I change the style, set back origin and destination, clone the control points, set back the style and then set the control points:
Code
Select All
...
            PointF oldOrigin = this.ControlPoints[0];
            PointF oldDestination = this.ControlPoints[this.ControlPoints.Count - 1];
            LinkStyle oldStyle = this.Style;

            this.Style = LinkStyle.Cascading;
            this.ControlPoints[0] = oldOrigin;
            this.ControlPoints[this.ControlPoints.Count - 1] = oldDestination;
            this.UpdateFromPoints(false, false);

            bool retval = base.Route();

            PointCollection points = this.ControlPoints.Clone();

            this.Style = oldStyle;
            this.ControlPoints.Clear();
            this.ControlPoints.AddRange(points);
            this.UpdateFromPoints(true, true);

 ...
  



It works now. Thank you!

About the QuickRouter:
When that property will be available? In the next release?

Cornel

  
Back to top
 
IP Logged
 
Stoyo
God Member
*****
Offline


MindFusion support

Posts: 13230
Joined: Jul 20th, 2005
Re: Routing links orthogonally
Reply #5 - Mar 17th, 2010 at 12:11pm
Print Post  
We'll try to add it in the next few days. Could you email this to support@mindfusion.eu for our testing, saved as xml?
  
Back to top
 
IP Logged
 
Cornel
YaBB Newbies
*
Offline


I love YaBB 1G - SP1!

Posts: 23
Joined: Dec 17th, 2008
Re: Routing links orthogonally
Reply #6 - Mar 17th, 2010 at 1:46pm
Print Post  
I can't send it because it is just a picture.
I created something similar using the Demo program; I'll send that xml to support.

Cornel
  
Back to top
 
IP Logged
 
Stoyo
God Member
*****
Offline


MindFusion support

Posts: 13230
Joined: Jul 20th, 2005
Re: Routing links orthogonally
Reply #7 - Mar 23rd, 2010 at 1:10pm
Print Post  
Hi,

This version adds QuickRouter.UBendMaxLen property:
https://mindfusion.eu/_beta/fcnet_534_route.zip

The default is 30; setting it to 10 or 15 seems to work fine for the sample you sent us.

I hope that helps,
Stoyan
  
Back to top
 
IP Logged
 
Cornel
YaBB Newbies
*
Offline


I love YaBB 1G - SP1!

Posts: 23
Joined: Dec 17th, 2008
Re: Routing links orthogonally
Reply #8 - Mar 24th, 2010 at 6:45am
Print Post  
Thanks.

Cornel
  
Back to top
 
IP Logged
 
Page Index Toggle Pages: 1
Send TopicPrint