Page Index Toggle Pages: 1 Send TopicPrint
Normal Topic FindAllCycles, FindAllPaths (Read 3711 times)
Phil Jacques
Junior Member
**
Offline


.NET 2.0 Rocks!!!

Posts: 70
Joined: Oct 20th, 2006
FindAllCycles, FindAllPaths
Nov 28th, 2006 at 11:24am
Print Post  
Stoyan,

Do you have any sample using FindAllCycles, FindAllPaths??

I cannot figure out what is returned by these. It says Collection of path objects are returned. I am interested in how a path object can boil down to Boxes and Arrows

Cheers

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


MindFusion support

Posts: 13230
Joined: Jul 20th, 2005
Re: FindAllCycles, FindAllPaths
Reply #1 - Nov 28th, 2006 at 12:31pm
Print Post  
I think the FCDemo sample shows how to use path-finding in one of the steps - search for PathFinder in the MainForm.cs.

Cheers,

Stoyan
  
Back to top
 
IP Logged
 
Phil Jacques
Junior Member
**
Offline


.NET 2.0 Rocks!!!

Posts: 70
Joined: Oct 20th, 2006
Re: FindAllCycles, FindAllPaths
Reply #2 - Nov 30th, 2006 at 6:42am
Print Post  
Stoyan,

I have multiple connected boxes on the diagram. What i am looking at is separating all connected boxes as one unit and drawing them on separate locations.

I was looking at some programmatic way of doing it and hence FindAllPaths and FindAllCycles.

Is there any function which will give me a collection of all connected boxes (and arrows) to a box?

This will help me separate interlinked diagram and do a layout to single unit of all boxes and  connections rather than looping over, marking it as IgnoreLayout and playing around with that.

Thanks in advance, and i will definately wait till the new version before catching fish Cheesy

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


MindFusion support

Posts: 13230
Joined: Jul 20th, 2005
Re: FindAllCycles, FindAllPaths
Reply #3 - Nov 30th, 2006 at 7:35am
Print Post  
Hi Phil,

Here is such function:

Code
Select All
void giveMeAllConnectedBoxes(Box box, BoxCollection connectedBoxes)
{
  if (connectedBoxes.Contains(box))
    return;

  connectedBoxes.Add(box);

  foreach (Arrow arrow in box.OutgoingArrows)
  {
    Box otherBox = arrow.Destination as Box;
    if (otherBox != null)
     giveMeAllConnectedBoxes(otherBox, connectedBoxes);
  }

  foreach (Arrow arrow in box.IncomingArrows)
  {
    Box otherBox = arrow.Origin as Box;
    if (otherBox != null)
     giveMeAllConnectedBoxes(otherBox, connectedBoxes);
  }
}

private void button3_Click(object sender, System.EventArgs e)
{
  Box box = fc.ActiveObject as Box;
  if (box != null)
  {
    BoxCollection connected = new BoxCollection();
    giveMeAllConnectedBoxes(box, connected);
    foreach (Box cb in connected)
     cb.FillColor = Color.Red;
  }
}
 



Stoyan
  
Back to top
 
IP Logged
 
Phil Jacques
Junior Member
**
Offline


.NET 2.0 Rocks!!!

Posts: 70
Joined: Oct 20th, 2006
Re: FindAllCycles, FindAllPaths
Reply #4 - Nov 30th, 2006 at 7:40am
Print Post  
Geee ... thanks Stoyan,

You rock!!!
Will send u some fish as a gift Cheesy 8)

I was wondering if we had a direct Property or function, like box.GetAllConnected and it returns List<Box> Smiley

BTW is V 4.2.2 using .NET 2.0 features??

Cheers

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


MindFusion support

Posts: 13230
Joined: Jul 20th, 2005
Re: FindAllCycles, FindAllPaths
Reply #5 - Nov 30th, 2006 at 8:31am
Print Post  
Quote:
Will send u some fish as a gift  Cheesy 8)


I hope they'll deliver it fast enough  Wink

Quote:
I was wondering if we had a direct Property or function, like box.GetAllConnected and it returns List<Box>


We might add that as a function, but our developers think that the control's API is already very bloated  Roll Eyes and some things should be better left as sample code that our users could copy & paste if needed ...

Quote:
BTW is V 4.2.2 using .NET 2.0 features??


We will still support .NET 1.1 for the 4.2.2 and 4.2.3 releases, so there won't be .NET 2 specific features available yet.

Cheers,
Stoyan
  
Back to top
 
IP Logged
 
Phil Jacques
Junior Member
**
Offline


.NET 2.0 Rocks!!!

Posts: 70
Joined: Oct 20th, 2006
Re: FindAllCycles, FindAllPaths
Reply #6 - Nov 30th, 2006 at 8:47am
Print Post  
Stoyo wrote on Nov 30th, 2006 at 8:31am:
We will still support .NET 1.1 for the 4.2.2 and 4.2.3 releases, so there won't be .NET 2 specific features available yet.


Ohhh ....

In that case, when is your V5.0 slated to release?? Is there any target date which is planned?

(Assuming V 5.0 will have .NET 2.0 Features Smiley)

Thanks a lot for your quick responses

Cheers

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


MindFusion support

Posts: 13230
Joined: Jul 20th, 2005
Re: FindAllCycles, FindAllPaths
Reply #7 - Nov 30th, 2006 at 11:14am
Print Post  
Yes, version 5 will be for .NET 2 only, so there will be .NET 2 features. It should be released by the end of February.

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