Page Index Toggle Pages: 1 Send TopicPrint
Normal Topic Link Arrow and Line Problem (Read 5286 times)
tony
YaBB Newbies
*
Offline


I Love MindFusion!

Posts: 5
Joined: Jul 17th, 2012
Link Arrow and Line Problem
Jul 17th, 2012 at 5:41am
Print Post  
I am having trouble getting my line ends and arrows to look right. I attached 2 pictures to show. The first one shows how the arrow going into the second node doesn't come in from the side like I want.

The second image shows how the link start and end both start out vertical when they should be horizontal.

A note I do have the diagram.RouteOptions.StartOrientation and EndOrientation set to Horizontal.

What else can I change to make it work?
  

ScreenShot01.png (Attachment deleted)
ScreenShot02.png (Attachment deleted)
Back to top
 
IP Logged
 
Stoyo
God Member
*****
Offline


MindFusion support

Posts: 13230
Joined: Jul 20th, 2005
Re: Link Arrow and Line Problem
Reply #1 - Jul 17th, 2012 at 7:40am
Print Post  
Try enabling the link.AutoRoute property, or call e.Link.Route() from the LinkCreated event handler.

I hope that helps,
Stoyan
  
Back to top
 
IP Logged
 
tony
YaBB Newbies
*
Offline


I Love MindFusion!

Posts: 5
Joined: Jul 17th, 2012
Re: Link Arrow and Line Problem
Reply #2 - Jul 17th, 2012 at 2:57pm
Print Post  
Thank you for the reply.

I am calling the Route() method whenever a link is created or a node is moved. What you see in the images is the result.
  
Back to top
 
IP Logged
 
Stoyo
God Member
*****
Offline


MindFusion support

Posts: 13230
Joined: Jul 20th, 2005
Re: Link Arrow and Line Problem
Reply #3 - Jul 17th, 2012 at 4:45pm
Print Post  
Is there any large node in the background? If yes, try setting its Obstacle property to false. Have you changed the value of Diagram.LinkRouter?
  
Back to top
 
IP Logged
 
tony
YaBB Newbies
*
Offline


I Love MindFusion!

Posts: 5
Joined: Jul 17th, 2012
Re: Link Arrow and Line Problem
Reply #4 - Jul 19th, 2012 at 9:26pm
Print Post  
There are no large nodes in the background that I know of and I have not done anything with LinkRouter. Is LinkRouter a good place to affect how things are arranged?

What kinds of settings affect how the routing is done? Specifically I need to know how to make the arrows be horizontal when they are close to the side of a node like you see in the images.
  
Back to top
 
IP Logged
 
Stoyo
God Member
*****
Offline


MindFusion support

Posts: 13230
Joined: Jul 20th, 2005
Re: Link Arrow and Line Problem
Reply #5 - Jul 20th, 2012 at 8:15am
Print Post  
The arrows should be horizontal in this case if routing works, but apparently it doesn't for some reason. Could you check if the Route() method returns false, meaning it didn't find a path? If it returns true, do the ControlPoints values appear to correspond to what you are seeing on screen? -there might be some code executed after Route is called that explicitly changes their coordinates.
  
Back to top
 
IP Logged
 
tony
YaBB Newbies
*
Offline


I Love MindFusion!

Posts: 5
Joined: Jul 17th, 2012
Re: Link Arrow and Line Problem
Reply #6 - Jul 30th, 2012 at 6:02pm
Print Post  
For some reason I am not getting the notification email when you guys post replies to this thread Sad so I just saw this post.

Calling Route doesn't help and nothing else is being done after that so I am still stuck.

One thing interesting is if the destination node is below the source node you get the weird routing as in the image. If, on the other hand, the destination node is above the source node the routing always comes in horizontal and everything is fine.

Does that give any clues about what is happening?
  
Back to top
 
IP Logged
 
Stoyo
God Member
*****
Offline


MindFusion support

Posts: 13230
Joined: Jul 20th, 2005
Re: Link Arrow and Line Problem
Reply #7 - Jul 31st, 2012 at 5:54am
Print Post  
The attached test project has just the AutoRoute property enabled and it seems to work ok. Try copying your diagram settings and event handlers to it to find out what causes the problem.
  

RouteTest.zip (Attachment deleted)
Back to top
 
IP Logged
 
tony
YaBB Newbies
*
Offline


I Love MindFusion!

Posts: 5
Joined: Jul 17th, 2012
Re: Link Arrow and Line Problem
Reply #8 - Aug 10th, 2012 at 1:41pm
Print Post  
The Mind Fusion guys are WONDERFUL to work with. I ended up sending my project to them and they found a small issue in the grid router that they will fix in the next release, but also gave a solution that works right now.

Basically I already had a method in my project in a file I called LinkConfig that returns the AnchorPattern for a node. They had me change it to define the link orientation when creating the anchor points. This works good and solves the issue I am seeing. Here is the code:

Code
Select All
        public AnchorPattern GetAnchorPattern()
        {
            AnchorPattern anchorPattern = new AnchorPattern();

            foreach (AnchorEntry entry in anchorEntries)
            {
				var ap = new AnchorPoint(entry.X, entry.Y, entry.AllowIncoming, entry.AllowOutgoing);
				if (entry.X == 0 || entry.X == 100)
					ap.LinkOrientation = Orientation.Horizontal;
				if (entry.Y == 0 || entry.Y == 100)
					ap.LinkOrientation = Orientation.Vertical;
				anchorPattern.Points.Add(ap);
            }

            return anchorPattern;
        }
 



This works because my nodes are all 100 x 100 in size and the anchor points are arranged around the outside of the nodes, so if X is 0 or 100 we know the anchor point orientation should be horizontal and if Y is 0 or 100 we know the orientation should be vertical.

Very nice solution. I didn't even know anchor points could have an orientation, so this is good learning too.
  
Back to top
 
IP Logged
 
Page Index Toggle Pages: 1
Send TopicPrint