Page Index Toggle Pages: 1 Send TopicPrint
Normal Topic Routing links (Read 2327 times)
Amosius
Junior Member
**
Offline


I love YaBB 1G - SP1!

Posts: 75
Joined: Sep 2nd, 2010
Routing links
Aug 18th, 2011 at 9:57am
Print Post  
Hello,

i am using link.route()

I would like to use several routingoptions so i tried

Code
Select All
                diagram.LinkRouter = new GridRouter();

                diagram.RoutingOptions.TurnCost = 100;
                diagram.RoutingOptions.CrossingCost = 50;
                diagram.RoutingOptions.LengthCost = 20;
                diagram.RoutingOptions.NodeVicinityCost = 30;
                diagram.RoutingOptions.NodeVicinitySize = 20;

                diagram.RoutingOptions.StartOrientation = MindFusion.Diagramming.Wpf.Orientation.Horizontal; 



and then i would like to route a link with link.route()

But i can change all cost values, it does not effect my route.

There are two possibilities to call routing:
Code
Select All
bool routing1 = diagram.LinkRouter.RouteLink(link);
bool routing2 = link.Route(); 


routing1 is false while routing2 is true.

I am a little bit confused. Does link.route() not take my routingoptions?

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


MindFusion support

Posts: 13230
Joined: Jul 20th, 2005
Re: Routing links
Reply #1 - Aug 18th, 2011 at 3:08pm
Print Post  
Hi,

The values will affect your route only if they lead to finding a new minimal cost path, which might not happen for short links. You could check this in the Routing sample project - draw a few longer links, drag the sliders and click Reroute - this shows different paths for me.

Stoyan
  
Back to top
 
IP Logged
 
Amosius
Junior Member
**
Offline


I love YaBB 1G - SP1!

Posts: 75
Joined: Sep 2nd, 2010
Re: Routing links
Reply #2 - Aug 19th, 2011 at 12:00pm
Print Post  
I reduced cost values and now i can influence routing.
I will experiment now a little bit. Thx for your help.

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