Page Index Toggle Pages: 1 Send TopicPrint
Normal Topic how to access all the nodes of graph from root. (Read 1784 times)
jay
Junior Member
**
Offline


I love YaBB 1G - SP1!

Posts: 59
Joined: Feb 4th, 2009
how to access all the nodes of graph from root.
Feb 10th, 2009 at 5:50am
Print Post  
Hi,

   I want to rout the graph such from root such that when I am routing it I sould be able to get access to each node [to handle its information]. like if a node having two outgoing links, in the route i should get both the destination nodes. like iterating node but from root node.

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


MindFusion support

Posts: 13230
Joined: Jul 20th, 2005
Re: how to access all the nodes of graph from root
Reply #1 - Feb 10th, 2009 at 10:08am
Print Post  
Create a recursive function that takes a DiagramNode argument, make it loop over the node's OutgoingLinks collection, and call itself for the links.getDestination() node. Now call it on that root node.

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