Page Index Toggle Pages: 1 Send TopicPrint
Normal Topic How to make the OrthogonalRouter work? (Read 3101 times)
mihai
Junior Member
**
Offline



Posts: 86
Joined: Jul 29th, 2009
How to make the OrthogonalRouter work?
Jul 28th, 2014 at 9:33am
Print Post  
Hi,

I'm trying to use the OrthogonalRouter after manually positioning the nodes, but it's not doing anything. I have used to do this with the WinForms version, and that worked.

Most of the nodes are placed in containers, so I've tried to set KeepGroupLayout to false, but that didn't help. I've also toggled the IgnoreLayout on links, but nothing changed.

Any hints would be highly appreciated.

Thanks,
-Mihai

PS: Is there a sample app in the installer to demo the OrthogonalRouter?
  
Back to top
 
IP Logged
 
Stoyo
God Member
*****
Offline


MindFusion support

Posts: 13230
Joined: Jul 20th, 2005
Re: How to make the OrthogonalRouter work?
Reply #1 - Jul 28th, 2014 at 10:28am
Print Post  
Hi,

I think we made KeepGroupLayout always enabled for containers at some point, which will prevent OrthogonalRouter from finding paths inside them. Try excluding them like this instead of setting IgnoreLayout:

Code
Select All
var items = new DiagramItemCollection();
foreach (var item in diagram.Items)
	if (!(item is ContainerNode))
		items.Add(item);

var r = new OrthogonalRouter();
r.Arrange(diagram, items); 



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



Posts: 86
Joined: Jul 29th, 2009
Re: How to make the OrthogonalRouter work?
Reply #2 - Jul 28th, 2014 at 11:13am
Print Post  
Hi Stoyan,

Thanks, that did the trick!

The problem now is that I can't get the links to retain their anchor points. I have tried to:
  • Set the OrthogonalRouter.Anchoring to various values, including Anchoring.Keep
  • Set the Diagram.SnapToAnchor to OnCreateOrModify

but none produced the desired results.

All the links are between custom ShapeNode(s) with custom AnchorPattern(s), contained in ContainerNode(s), and they have the OriginAnchor & DestinationAnchor properties set.

Any ideas?

Best Regards,
-Mihai
« Last Edit: Jul 28th, 2014 at 2:49pm by mihai »  
Back to top
 
IP Logged
 
Stoyo
God Member
*****
Offline


MindFusion support

Posts: 13230
Joined: Jul 20th, 2005
Re: How to make the OrthogonalRouter work?
Reply #3 - Jul 28th, 2014 at 3:05pm
Print Post  
Hi Mihai,

This version should fix the Keep option:
https://mindfusion.eu/_beta/wpfdiag32.zip

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



Posts: 86
Joined: Jul 29th, 2009
Re: How to make the OrthogonalRouter work?
Reply #4 - Jul 28th, 2014 at 3:09pm
Print Post  
Hi Stoyan,

Perfect, it works, thanks!
Will this fix make it into the next release?

Thanks again,
-Mihai
  
Back to top
 
IP Logged
 
Stoyo
God Member
*****
Offline


MindFusion support

Posts: 13230
Joined: Jul 20th, 2005
Re: How to make the OrthogonalRouter work?
Reply #5 - Jul 28th, 2014 at 4:08pm
Print Post  
Yes, it should be available next month.
  
Back to top
 
IP Logged
 
mihai
Junior Member
**
Offline



Posts: 86
Joined: Jul 29th, 2009
Re: How to make the OrthogonalRouter work?
Reply #6 - Jul 28th, 2014 at 5:26pm
Print Post  
Cool, thanks again Stoyan.
  
Back to top
 
IP Logged
 
Page Index Toggle Pages: 1
Send TopicPrint