Page Index Toggle Pages: 1 Send TopicPrint
Hot Topic (More than 10 Replies) Real time autorouting of links? (Read 4728 times)
TimNZ
Junior Member
**
Offline


I love YaBB 1G - SP1!

Posts: 60
Joined: Feb 23rd, 2009
Real time autorouting of links?
Sep 10th, 2009 at 8:56am
Print Post  
Is this possible - link autoroutes in realtime whilst the node is being moved instead of when mouse is released?

Currently only first/2nd segment dynamically change.

I can post a video of what I'm talking about.. Grin
  
Back to top
 
IP Logged
 
Stoyo
God Member
*****
Offline


MindFusion support

Posts: 13230
Joined: Jul 20th, 2005
Re: Real time autorouting of links?
Reply #1 - Sep 10th, 2009 at 9:56am
Print Post  
You could call RouteAllLinks from the NodeModifying event:

Code
Select All
private void diagram_NodeModifying(object sender, NodeValidationEventArgs e)
{
	diagram.RouteAllLinks();
	diagramView.RecreateCacheImage();
}
 



I hope that helps,
Stoyan
  
Back to top
 
IP Logged
 
TimNZ
Junior Member
**
Offline


I love YaBB 1G - SP1!

Posts: 60
Joined: Feb 23rd, 2009
Re: Real time autorouting of links?
Reply #2 - Sep 14th, 2009 at 10:12am
Print Post  
Not really.

Add it to the Demo app and try it on various diagrams, it's slow (moving a node around results in constant 100% cpu utilisation) and obviously affects all the links.

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


MindFusion support

Posts: 13230
Joined: Jul 20th, 2005
Re: Real time autorouting of links?
Reply #3 - Sep 14th, 2009 at 10:22am
Print Post  
RouteAllLinks wasn't slow at all in our test, using the new QuickRouter algorithm. If you prefer to use GridRouter or there are many links in the diagram, instead of RouteAllLinks you could call diagram.LinkRouter.RouteLinks(someLinks). Add to someLinks the links returned by e.Node.GetAllLinks(), and possibly the ones in the current e.Node.Bounds vicinity.

I hope that helps,
Stoyan
  
Back to top
 
IP Logged
 
TimNZ
Junior Member
**
Offline


I love YaBB 1G - SP1!

Posts: 60
Joined: Feb 23rd, 2009
Re: Real time autorouting of links?
Reply #4 - Sep 14th, 2009 at 10:24am
Print Post  
Also tried this which is better, and removed the RecreateCacheImage (cpu utilisation drops considerably)  but it's still not quite right.

I think you know what I'm after..

Code
Select All
		foreach (DiagramLink link in e.Node.IncomingLinks)
		    link.Route();
		foreach (DiagramLink link in e.Node.OutgoingLinks)
		    link.Route();
 


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


MindFusion support

Posts: 13230
Joined: Jul 20th, 2005
Re: Real time autorouting of links?
Reply #5 - Sep 14th, 2009 at 10:40am
Print Post  
Check my post from two minutes before yours... Calling Route() for each link individually will not prevent link overlapping, whereas LinkRouter.RouteLinks will process the links in a batch and distribute them uniformly if possible.
  
Back to top
 
IP Logged
 
TimNZ
Junior Member
**
Offline


I love YaBB 1G - SP1!

Posts: 60
Joined: Feb 23rd, 2009
Re: Real time autorouting of links?
Reply #6 - Sep 14th, 2009 at 10:57am
Print Post  
Thanks, have just tried it with Demo app and it's better..

Please look at video here (use open source Media Player Classic link I posted previously), you'll see what I'd like to achieve.  It's one of the only areas that matters where FlowChart is a bit weak compared to others I evaluated.

http://www.enetworks.co.nz/images/LinkRouting.avi

The desired link routing is very fluid/smooth.
  
Back to top
 
IP Logged
 
TimNZ
Junior Member
**
Offline


I love YaBB 1G - SP1!

Posts: 60
Joined: Feb 23rd, 2009
Re: Real time autorouting of links?
Reply #7 - Sep 14th, 2009 at 11:02am
Print Post  
Have also tried GridRouter which I thinks work a little better again but still jerky.

CPU is at 90% moving the node around with 2 Cascading incoming links though.

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


MindFusion support

Posts: 13230
Joined: Jul 20th, 2005
Re: Real time autorouting of links?
Reply #8 - Sep 14th, 2009 at 11:29am
Print Post  
It seems the main problem is that the Route method does not preserve the length of the links' end segments. For now you could add some code to move ControlPoints[1] and ControlPoints[Count - 2] to a fixed offset from the end points after routing. We'll add some property to preserve the segment lengths for the next release.

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


I love YaBB 1G - SP1!

Posts: 60
Joined: Feb 23rd, 2009
Re: Real time autorouting of links?
Reply #9 - Sep 14th, 2009 at 11:32am
Print Post  
How about just adding a property to make it work like the 'other' product? Grin

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


MindFusion support

Posts: 13230
Joined: Jul 20th, 2005
Re: Real time autorouting of links?
Reply #10 - Sep 14th, 2009 at 1:23pm
Print Post  
public bool RouteLikeOtherProduct 8)
  
Back to top
 
IP Logged
 
TimNZ
Junior Member
**
Offline


I love YaBB 1G - SP1!

Posts: 60
Joined: Feb 23rd, 2009
Re: Real time autorouting of links?
Reply #11 - Sep 16th, 2009 at 12:17pm
Print Post  
If you do add this feature, i'll name my first born after you, even if it's a girl.
  
Back to top
 
IP Logged
 
Stoyo
God Member
*****
Offline


MindFusion support

Posts: 13230
Joined: Jul 20th, 2005
Re: Real time autorouting of links?
Reply #12 - Sep 16th, 2009 at 12:35pm
Print Post  
I'll give you the name of the responsible developer 8)
  
Back to top
 
IP Logged
 
Page Index Toggle Pages: 1
Send TopicPrint