Page Index Toggle Pages: 1 Send TopicPrint
Normal Topic Arrow problems.. (Read 2755 times)
simondk
YaBB Newbies
*
Offline


I love YaBB 1G - SP1!

Posts: 21
Joined: Nov 15th, 2006
Arrow problems..
May 15th, 2007 at 6:23am
Print Post  
Hi!

I have a problem when connecting arrows to boxes, the arrowheads are sometimes crossing into the boxes, and they are also sometimes turning the wrong way, forinstance if the connection is at the rightside of the box the arrowhead is turning upwards.. ?
Also sometimes the arrow seems to be connected to a corner of the box, which gives problems as it looks bad when i have an reversed arrowhead, and some of the arrow is just pointing into empty space...

Im emailing you (Stoyo) an .fc file and a .jpg with red cirkles to explain what im talking about.

I hope you can help me out here,
thanks in advance and have a nice day.

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


MindFusion support

Posts: 13230
Joined: Jul 20th, 2005
Re: Arrow problems..
Reply #1 - May 15th, 2007 at 6:54am
Print Post  
Hi,

Quote:
if the connection is at the rightside of the box the arrowhead is turning upwards


It seems that happens because the arrow has two segments, and the one at the arrow end points upwards. Try setting SegmentCount to 3, or if you use auto-routing, increate the NodeVicinityCost/Size values in RoutingOptions.

Quote:
Also sometimes the arrow seems to be connected to a corner of the box, which gives problems as it looks bad when i have an reversed arrowhead, and some of the arrow is just pointing into empty space...


The control doesn't have any property that will prevent the arrows from connecting near a box corner. You might check for that condition yourself and offset the last two points in Arrow.ControlPoints further from the corner.

Stoyan
  
Back to top
 
IP Logged
 
simondk
YaBB Newbies
*
Offline


I love YaBB 1G - SP1!

Posts: 21
Joined: Nov 15th, 2006
Re: Arrow problems..
Reply #2 - May 15th, 2007 at 9:48am
Print Post  
Hello,

i tried setting the novincinitycost tp 127 and size to 20 (and several other values) but it did not alter the problem im afraid Sad

I am using autorouting, the flowchart has the settings below, do you have an other thing i could try ?

Code
Select All
private void CreateNewFlowChart()
        {
            fc = new MindFusion.FlowChartX.FlowChart();
            fc.AutoSizeDoc = MindFusion.FlowChartX.AutoSize.RightAndDown;
            fc.BackBrush = new MindFusion.FlowChartX.SolidBrush("#FF808080");
            fc.InplaceEditFont = new System.Drawing.Font("Microsoft Sans Serif", 8.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
            fc.Name = "SIGA ER-Diagram";
            fc.BackColor = Color.White;
            fc.AntiAlias = System.Drawing.Drawing2D.SmoothingMode.HighQuality;
            fc.ArrowCascadeOrientation = MindFusion.FlowChartX.Orientation.Auto;
        }


        private void RouteConnections()
        {
            fc.RoutingOptions.TriggerRerouting = RerouteArrows.WhenIntersectNode;
            fc.RoutingOptions.CrossingCost = 20;
            fc.RoutingOptions.Anchoring = Anchoring.Reassign;
            fc.RoutingOptions.EndOrientation = MindFusion.FlowChartX.Orientation.Auto;
            fc.RoutingOptions.LengthCost = 10;
            fc.RoutingOptions.TurnCost = 50;

            fc.RoutingOptions.NodeVicinityCost = 127;
            fc.RoutingOptions.NodeVicinitySize = 20;

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

 




The arrows are created with the following 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 = Color.White;
            link.AutoRoute = true;
            link.DrawCrossings = false;
            link.Selected = false;
            link.Dynamic = true;

        }
 



I am emailing you the new fc file with the new options you proposed.

Thanks in advance
-Simon
  
Back to top
 
IP Logged
 
Stoyo
God Member
*****
Offline


MindFusion support

Posts: 13230
Joined: Jul 20th, 2005
Re: Arrow problems..
Reply #3 - May 15th, 2007 at 10:31am
Print Post  
Hello,

Which Flowchart.NET version are you using? I can't get the arrows point in the wrong direction when they are on the node side, using the latest version of the control. There are still some problems when an arrow is near a corner, but decreasing the routing grid size to 2 seems to fix them:

Code
Select All
private void btnControlHost_Click(object sender, System.EventArgs e)
{
	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 = 2;

	fc.RouteAllArrows(); //execute
}
 



We can add some option to avoid the node corners when auto-routing in the 5.0.1 release. For now you might try assigning several anchor points to each side of a node so they are at some distance from the corners. Then the arrows would not connect that close to the corners.

Stoyan
  
Back to top
 
IP Logged
 
simondk
YaBB Newbies
*
Offline


I love YaBB 1G - SP1!

Posts: 21
Joined: Nov 15th, 2006
Re: Arrow problems..
Reply #4 - May 15th, 2007 at 10:37am
Print Post  
I might be using an older flowchart, ill try and upgrade it.

- and it would be nice with the routing option in the 5.0.1 release that you mention!

I will try your suggestions, thanks.
-Simon
  
Back to top
 
IP Logged
 
simondk
YaBB Newbies
*
Offline


I love YaBB 1G - SP1!

Posts: 21
Joined: Nov 15th, 2006
Re: Arrow problems..
Reply #5 - May 15th, 2007 at 12:21pm
Print Post  
Hello,
the gridsize change, did a lot of good!, but there are still a few arrows that are turning the wrong way (i have upgraded to the latest version).. (im sending the .fc to you).

Also i tried adding the anchorpoints myself, and wanted them t be marked by x's, so i sat "MarkStyle.Cross", but they dont show up on the diagram ?
Why is this ? how do i show them, as you also can see some of the arrows are pointing into nothing, which might be because i misscalculated something, so it would be really nice with the x's to see what and where i went wrong, however since most of the arrows are actually point at boxes, it is very strange that those few does not... ?

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


MindFusion support

Posts: 13230
Joined: Jul 20th, 2005
Re: Arrow problems..
Reply #6 - May 16th, 2007 at 5:54am
Print Post  
Hello,

Try setting FlowChart.ShowAnchors to Always.

Stoyan
  
Back to top
 
IP Logged
 
Stoyo
God Member
*****
Offline


MindFusion support

Posts: 13230
Joined: Jul 20th, 2005
Re: Arrow problems..
Reply #7 - May 16th, 2007 at 7:56am
Print Post  
Yes, actually the anchor points appeared at quite strange positions when we loaded the new file. Their coordinates should be always in the range 0..100.The control maps these percent values to the real width or height of the box sides.

Stoyan
  
Back to top
 
IP Logged
 
simondk
YaBB Newbies
*
Offline


I love YaBB 1G - SP1!

Posts: 21
Joined: Nov 15th, 2006
Re: Arrow problems..
Reply #8 - May 16th, 2007 at 8:01am
Print Post  
ok thanks, i wasnt aware it was in percantages, makes sence they are this much displaced then Smiley

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