Page Index Toggle Pages: 1 Send TopicPrint
Normal Topic Shapes Decision Find True-False Link (Read 2912 times)
Katmer
YaBB Newbies
*
Offline


I Love MindFusion!

Posts: 4
Joined: Mar 6th, 2020
Shapes Decision Find True-False Link
Mar 6th, 2020 at 5:58am
Print Post  
How can i find true and false link in decision shape node?
  
Back to top
 
IP Logged
 
Slavcho
YaBB Moderator
*****
Online


tech.support

Posts: 3148
Joined: Oct 19th, 2005
Re: Shapes Decision Find True-False Link
Reply #1 - Mar 6th, 2020 at 6:08am
Print Post  
The control does not assign intrinsic boolean values to links, you could do that yourself by setting the Tag or Id property to true / false when creating a new DiagramLink.

Alternatively if you use a position-based convention for links being true or false (like starting left or right from the node), you could check the links' OriginIndex property signifying the anchor point the link connects to (also assuming you set decision nodes' AnchorPattern).

Regards,
Slavcho
Mindfusion
  
Back to top
 
IP Logged
 
Katmer
YaBB Newbies
*
Offline


I Love MindFusion!

Posts: 4
Joined: Mar 6th, 2020
Re: Shapes Decision Find True-False Link
Reply #2 - Mar 6th, 2020 at 6:17am
Print Post  
I set anchorpattern like below.

AnchorPattern = new AnchorPattern(
                            new AnchorPoint[]
                            {
                                new AnchorPoint(50, 0, true, false, MarkStyle.Custom),
                                new AnchorPoint(50, 100, false, true, MarkStyle.Custom),
                                new AnchorPoint(100, 50, false, true, MarkStyle.Custom),
                            });
                            AnchorPattern.Points[0].Tag = 0;
                            AnchorPattern.Points[1].Tag = 1;
                            AnchorPattern.Points[2].Tag = 2;


But OriginIndex -1 for all outgoinglinks.
  
Back to top
 
IP Logged
 
Katmer
YaBB Newbies
*
Offline


I Love MindFusion!

Posts: 4
Joined: Mar 6th, 2020
Re: Shapes Decision Find True-False Link
Reply #3 - Mar 6th, 2020 at 6:35am
Print Post  
I found the problem. Anchorpattern is working. But when I arrange layout like that:

var layout = new MindFusion.Diagramming.Layout.DecisionLayout();
            layout.HorizontalPadding = 10;
            layout.VerticalPadding = 10;
            layout.StartNode = diagram1.FindNode("start");
            layout.Arrange(diagram1);

originindex or originanchor values change -1.
  
Back to top
 
IP Logged
 
Katmer
YaBB Newbies
*
Offline


I Love MindFusion!

Posts: 4
Joined: Mar 6th, 2020
Re: Shapes Decision Find True-False Link
Reply #4 - Mar 6th, 2020 at 7:04am
Print Post  
So do you have any suggestion?
  
Back to top
 
IP Logged
 
Slavcho
YaBB Moderator
*****
Online


tech.support

Posts: 3148
Joined: Oct 19th, 2005
Re: Shapes Decision Find True-False Link
Reply #5 - Mar 6th, 2020 at 7:10am
Print Post  
Indeed DecisionLayout moves links around the node and detaches them from anchor points. We don't have any layout class that would keep true/false links on a fixed side of a node, a position-based convention would help you only for flowcharts drawn by the user I guess.
  
Back to top
 
IP Logged
 
Slavcho
YaBB Moderator
*****
Online


tech.support

Posts: 3148
Joined: Oct 19th, 2005
Re: Shapes Decision Find True-False Link
Reply #6 - Mar 6th, 2020 at 7:25am
Print Post  
Quote:
So do you have any suggestion?


Suggestion for determining link true/false type by automatic position alone? It might be possible if your diagrams are strictly binary trees and you apply TreeLayout - then the order of links would depend on the order of child nodes though, so still something you must set at diagram creation time yourself.
  
Back to top
 
IP Logged
 
Page Index Toggle Pages: 1
Send TopicPrint