Page Index Toggle Pages: 1 Send TopicPrint
Normal Topic Link orientation (Read 3692 times)
marie
Full Member
***
Offline



Posts: 147
Joined: Nov 11th, 2008
Link orientation
Dec 8th, 2008 at 4:50pm
Print Post  
Hi,

Is it possible to change the orientation of a link? I want to allow the creation of a link from a node to another, but it should always go from left to right.

Thanks,
Marie
« Last Edit: Dec 9th, 2008 at 3:15pm by marie »  
Back to top
 
IP Logged
 
Stoyo
God Member
*****
Offline


MindFusion support

Posts: 13230
Joined: Jul 20th, 2005
Re: Link orientation
Reply #1 - Dec 8th, 2008 at 6:08pm
Print Post  
Hi,

You could swap the HeadShape and BaseShape values to change the direction only visually. To change the edge direction in the directed graph, swap the Origin and Destination values of the DiagramLink.

I hope that helps,
Stoyan
  
Back to top
 
IP Logged
 
marie
Full Member
***
Offline



Posts: 147
Joined: Nov 11th, 2008
Re: Link orientation
Reply #2 - Dec 8th, 2008 at 6:28pm
Print Post  
Hi Stoyan,

Thanks for you answer!

I don't want the values to change only visually. Swapping seems to be good, but I don't know how to know if the link needs to be swapped. I wanted to use link.DestinationAnchor and link.OriginAnchor because my anchors are different, but they both refer to 0. Do you have any idea why?

Thanks,
Marie
  
Back to top
 
IP Logged
 
Stoyo
God Member
*****
Offline


MindFusion support

Posts: 13230
Joined: Jul 20th, 2005
Re: Link orientation
Reply #3 - Dec 9th, 2008 at 8:41am
Print Post  
Hi Marie,

0 is the index of the first point in the AnchorPattern object. If the link is not attached to an anchor point, the respective Anchor property is set to -1.

I hope that helps,
Stoyan
  
Back to top
 
IP Logged
 
marie
Full Member
***
Offline



Posts: 147
Joined: Nov 11th, 2008
Re: Link orientation
Reply #4 - Dec 9th, 2008 at 1:17pm
Print Post  
Hi,

I don't understand (in general) to what AnchorPattern the indexes refer. In this case, the link.destination.AnchorPattern is null and there is no AnchorPattern property in link.

How does this anchor pattern works?

What is link.DestinationIndex?

Thanks,
Marie
  
Back to top
 
IP Logged
 
marie
Full Member
***
Offline



Posts: 147
Joined: Nov 11th, 2008
Re: Link orientation
Reply #5 - Dec 9th, 2008 at 2:15pm
Print Post  
Hi,

I think I found out how it works.

To get the origin anchor point of a link, if the origin is a table node, I did as follow.
Code
Select All
if (link.Origin is TableNode)
    AnchorPoint pt = ((TableNode)link.Origin).Rows[link.OriginIndex].AnchorPattern.Points[link.OriginAnchor];
else
    // ? 



What if link.Origin is not a TableNode?
When does OriginAnchor refers to link.Origin.AnchorPattern?
Do you have documentation somewhere about that?

By the way, if you swap in that order: index, node then anchor, the index value gets changed (bad results). The following order works: node, index, anchor.

Thanks,
Marie
  
Back to top
 
IP Logged
 
Stoyo
God Member
*****
Offline


MindFusion support

Posts: 13230
Joined: Jul 20th, 2005
Re: Link orientation
Reply #6 - Dec 9th, 2008 at 2:29pm
Print Post  
For types of nodes other than TableNode, or for tablenodes for which the OriginIndex / DestinationIndex are equal to -1, the Anchor properties refer to the DiagramNode.AnchorPattern. Otherwise they refer to the respective row's AnchorPattern.

I hope that helps,
Stoyan
  
Back to top
 
IP Logged
 
marie
Full Member
***
Offline



Posts: 147
Joined: Nov 11th, 2008
Re: Link orientation
Reply #7 - Dec 9th, 2008 at 2:49pm
Print Post  
In a TableNode, can we have anchor points added to rows and to the table itself at the same time (by example table.AnchorPattern & table.Rows[i].AnchorPattern would have anchors)?

Thank you
Marie
  
Back to top
 
IP Logged
 
Stoyo
God Member
*****
Offline


MindFusion support

Posts: 13230
Joined: Jul 20th, 2005
Re: Link orientation
Reply #8 - Dec 9th, 2008 at 3:09pm
Print Post  
This should not be a problem, especially if the node's pattern allows for only one link direction (incoming/outgoing), and the rows' pattern allows for the other direction. It should also work if both directions are allowed for both pattern objects, but the rules for choosing a pattern when a link is drawn in that case are a bit complex.

Stoyan
  
Back to top
 
IP Logged
 
marie
Full Member
***
Offline



Posts: 147
Joined: Nov 11th, 2008
Re: Link orientation
Reply #9 - Dec 9th, 2008 at 3:15pm
Print Post  
Hi Stoyan,

I hope it will never happen to me then Wink

Thanks,
Marie
  
Back to top
 
IP Logged
 
Page Index Toggle Pages: 1
Send TopicPrint