Page Index Toggle Pages: 1 Send TopicPrint
Normal Topic setting arrow distance? (Read 2429 times)
simondk
YaBB Newbies
*
Offline


I love YaBB 1G - SP1!

Posts: 21
Joined: Nov 15th, 2006
setting arrow distance?
Jul 3rd, 2007 at 10:54am
Print Post  
Hello,
im trying to make my arrows have a creater space between them, but with little luck.

Im not using one of the build in layout algorithms as we have a costumer that needs something specific, im using this code to route the arrows:

Code
Select All
private void RouteConnections()
        {
            fc.RoutingOptions.TriggerRerouting = RerouteArrows.WhenIntersectNode;
            fc.RoutingOptions.CrossingCost = 40;
            fc.RoutingOptions.Anchoring = Anchoring.Reassign;
            fc.RoutingOptions.EndOrientation = MindFusion.Diagramming.WinForms.Orientation.Auto;
            fc.RoutingOptions.LengthCost = 1;
            fc.RoutingOptions.TurnCost = 50;

            fc.RoutingOptions.NodeVicinityCost = 150;
            fc.RoutingOptions.NodeVicinitySize = 30;
            fc.RoutingOptions.GridSize = 2F; //org 2F

            fc.RouteAllArrows(); //execute
            fc.FitDocToObjects(2);//fit the document size
            fc.ZoomToFit(); //zoom to fit diagram to page
        }
 




and im creating the arrows with this code:

Code
Select All
private void AddConnection(Box box1, Box box2)
        {
            Arrow link = fc.CreateArrow(box1, box2);
            link.Style = ArrowStyle.Cascading;
            link.ArrowHead = ArrowHead.Reversed;
            link.ShadowColor = System.Drawing.Color.White;
            link.AutoRoute = true;
            link.DrawCrossings = false;
            link.Selected = false;
            link.Dynamic = true;
        }
 



Thanks in advance,
best regards.
-Simon
  
Back to top
 
IP Logged
 
Stoyo
God Member
*****
Offline


MindFusion support

Posts: 13230
Joined: Jul 20th, 2005
Re: setting arrow distance?
Reply #1 - Jul 3rd, 2007 at 11:36am
Print Post  
Hi,

At this time the only property that affects the arrow distance is RoutingOptions.GridSize. You could try to assign a larger value to it, though that might affect much more than just the arrow distance.

Stoyan
  
Back to top
 
IP Logged
 
simondk
YaBB Newbies
*
Offline


I love YaBB 1G - SP1!

Posts: 21
Joined: Nov 15th, 2006
Re: setting arrow distance?
Reply #2 - Jul 3rd, 2007 at 11:47am
Print Post  
Hello again,
i forgot to say, ive already tried setting the gridsize, and though it seemed to help a little the arrows would be very close in some occations still..

Do you have an idea of what i might be doing wrong, or is this just how the routing works?

ill try and send (email) you a flowchart file later today.

Regards
-Simon
  
Back to top
 
IP Logged
 
Stoyo
God Member
*****
Offline


MindFusion support

Posts: 13230
Joined: Jul 20th, 2005
Re: setting arrow distance?
Reply #3 - Jul 3rd, 2007 at 12:03pm
Print Post  
Hi,

The routing function does not check the arrow distances, but only whether the arrows intersect. Based on the CrossingCost, the algorithm should choose to route an arrow through an adjacent grid piece if otherwise the two arrows would intersect.

If GridSize won't work for you, the only solution will be to explicitly set the Arrow.ControlPoints coordinates so different arrows stay further from each other.

Stoyan
  
Back to top
 
IP Logged
 
simondk
YaBB Newbies
*
Offline


I love YaBB 1G - SP1!

Posts: 21
Joined: Nov 15th, 2006
Re: setting arrow distance?
Reply #4 - Jul 4th, 2007 at 8:13am
Print Post  
Hello,
I think i will have to place them myself then Sad but are the controlpoints also including the points at the start and end box? or only the waypoints?

thanks
-Simon
  
Back to top
 
IP Logged
 
Stoyo
God Member
*****
Offline


MindFusion support

Posts: 13230
Joined: Jul 20th, 2005
Re: setting arrow distance?
Reply #5 - Jul 4th, 2007 at 11:10am
Print Post  
Yes, the ControlPoints collection also includes the start and end box connection points.

Stoyan
  
Back to top
 
IP Logged
 
Page Index Toggle Pages: 1
Send TopicPrint