Page Index Toggle Pages: 1 Send TopicPrint
Hot Topic (More than 10 Replies) Programming Sample (Read 12306 times)
Madhu
YaBB Newbies
*
Offline


I Love MindFusion!

Posts: 6
Joined: Apr 24th, 2014
Programming Sample
Apr 24th, 2014 at 9:21am
Print Post  
Hi,

Can you provide programming sample (VB6 or C# using ActiveX) of the attached sample picture (SampleFlowCharg.png).

I would like to achieve similar to the sample picture (SampleFlowChart.png), unfortunately I end up with curved arrows (CurvedArrows.png).

Last week we bought the standard edition of the FlowChartX. We use it in a programming language called Smalltalk.

Thanks in advance,
Madhu.
  

SampleFlowChart.PNG (Attachment deleted)
CurvedArrows.PNG (Attachment deleted)
Back to top
 
IP Logged
 
Stoyo
God Member
*****
Offline


MindFusion support

Posts: 13230
Joined: Jul 20th, 2005
Re: Programming Sample
Reply #1 - Apr 24th, 2014 at 10:26am
Print Post  
Hi,

TreeLayout ignores arrows that are not part of the flowchart's spanning tree, and they will remain curved if your default ArrowStyle is set to Bezier. After calling Arrange, try looping over flowchart.Arrows and reset them to three-segment polyline links:

Code
Select All
fc.Arrange(treeLayout);
foreach (Arrow a in fc.Arrows)
{
    if (a.Style == asBezier)
    {
        a.SegmentCount = 3;
        a.Style = asPerpendicular;
    }
} 



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


I Love MindFusion!

Posts: 6
Joined: Apr 24th, 2014
Re: Programming Sample
Reply #2 - Apr 24th, 2014 at 1:46pm
Print Post  
Thanks for quick reply. Your suggestion helped me get rid of the curved lines. Attached is picture showing how it looks after your suggestion (Example.png).

I have two additional problems:

1. Arrows are drawn over the boxes. Is there a possibility to avoid it when arranging the diagram using tree layout.
2. In the box of style "bsRhombus", I would like to have the outgoing arrows from right and bottom like the picture in my first post (SampleFlowChart.png).

Thanks again,
Madhu.
  

Example.PNG (Attachment deleted)
Back to top
 
IP Logged
 
Stoyo
God Member
*****
Offline


MindFusion support

Posts: 13230
Joined: Jul 20th, 2005
Re: Programming Sample
Reply #3 - Apr 25th, 2014 at 7:06am
Print Post  
Quote:
Arrows are drawn over the boxes. Is there a possibility to avoid it when arranging the diagram using tree layout.


These are the arrows that TreeLayout ignores as not being part of the tree and you reset to default 3-segment shape. With Pro edition you could call their Route method to avoid overlaps with nodes. In standard edition you can remove the overlaps only by specifying new control point positions via the CtrlPt* properties.

Quote:
In the box of style "bsRhombus", I would like to have the outgoing arrows from right and bottom like the picture in my first post (SampleFlowChart.png).


You will have to code this yourself. None of the built-in layout classes arranges nodes to the right and bottom of decision boxes specifically. Doing that for a single decision box looks like this in VB:

Code
Select All
If box.Style = bsRhombus Then
    Dim n1 As box, n2 As box
    Set n1 = box.OutgoingArrows(0).DestinationBox
    Set n2 = box.OutgoingArrows(1).DestinationBox
    n1.MoveTo box.right + 30, box.top
    n2.MoveTo box.left, box.bottom + 30
    box.OutgoingArrows(0).Style = asPolyline
    box.OutgoingArrows(0).Segments = 1
    box.OutgoingArrows(1).Style = asPolyline
    box.OutgoingArrows(1).Segments = 1
End If
 



If your graphs are limited to at most two arrows going out from a decision box and one arrow from a regular box, you could probably devise some algorithm to arrange them in a grid, where each decision adds a new row and column to the grid, while other boxes are added to existing rows or columns depending on layout orientation.

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


I Love MindFusion!

Posts: 6
Joined: Apr 24th, 2014
Re: Programming Sample
Reply #4 - Apr 25th, 2014 at 7:58am
Print Post  
Thanks again for quick reply. I have tried out "Route" method with the trial version of Pro edition. It works as expected. I would like to call the "Route" method only for those arrows which are overlapping with nodes. Can this be done?

Can you also let me know how to upgrade from Standard edition to Pro edition. We would like to upgrade to Pro edition.

Regards,
Madhu.
  
Back to top
 
IP Logged
 
Stoyo
God Member
*****
Offline


MindFusion support

Posts: 13230
Joined: Jul 20th, 2005
Re: Programming Sample
Reply #5 - Apr 25th, 2014 at 10:16am
Print Post  
Chance is most of the ignored arrows for which you reset SegmentCount and Style will intersect nodes (unless the nodes are close to each other), so just call Route on them. Calling Route on arrow between nearby nodes will not change its path much. Otherwise you could use the Arrow.IntersectsNode method to find out if an arrow intersects a specific node, looping over all nodes and calling Route when you find an intersection.

For upgrades please contact sales@mindfusion.eu.

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


I Love MindFusion!

Posts: 6
Joined: Apr 24th, 2014
Re: Programming Sample
Reply #6 - Apr 25th, 2014 at 11:01am
Print Post  
Your support is fast and very helpful. I am quite impressed with both your support and your product.

We would upgrade to Pro edition.

Regards,
Madhu.
  
Back to top
 
IP Logged
 
Madhu
YaBB Newbies
*
Offline


I Love MindFusion!

Posts: 6
Joined: Apr 24th, 2014
Re: Programming Sample
Reply #7 - May 1st, 2014 at 10:27am
Print Post  
Hi,

We have now upgraded from Standard edition to Pro edition. As per your suggestion, I call Arrow.IntersectsNode to find the arrows which are drawn over the boxes. Unfortunately, the Arrow.IntersectsNode method returns true for all of the arrows.

Any suggestions?

Regards,
Madhu.

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


MindFusion support

Posts: 13230
Joined: Jul 20th, 2005
Re: Programming Sample
Reply #8 - May 1st, 2014 at 12:08pm
Print Post  
Hi,

It might be returning true when you call it for the arrow's origin and destination nodes, because they always have a common point with the arrow. Try skipping arrow.IntersectsNode call when current node is either arrow's OriginBox or DestinationBox.

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


I Love MindFusion!

Posts: 6
Joined: Apr 24th, 2014
Re: Programming Sample
Reply #9 - May 1st, 2014 at 1:22pm
Print Post  
Thanks again. It solved the problem.
  
Back to top
 
IP Logged
 
Stoyo
God Member
*****
Offline


MindFusion support

Posts: 13230
Joined: Jul 20th, 2005
Re: Programming Sample
Reply #10 - May 30th, 2014 at 12:03pm
Print Post  
Check the new DecisionLayout class in this build:
https://mindfusion.eu/_beta/fcx_dl.zip

It supports up to 3 links starting from decision boxes, the first is placed at bottom, the second one to the right and third one to the left. Currently it only provides a StartNode property, and the overall orientation and node distances are hard-coded. We'll add properties to customize them for the official release.

I hope that helps,
Stoyan
  
Back to top
 
IP Logged
 
Page Index Toggle Pages: 1
Send TopicPrint