Page Index Toggle Pages: 1 Send TopicPrint
Normal Topic Delete large sets of nodes/connections (Read 1642 times)
Nedor
YaBB Newbies
*
Offline


I love YaBB 1G - SP1!

Posts: 16
Joined: Aug 6th, 2010
Delete large sets of nodes/connections
Aug 6th, 2010 at 8:28am
Print Post  
Hi @ all.

I have to implement some own reloading algorithm because i need to hold only important (currently viewed) data.

In some cases i have to unload the data which is currently not shown. But this is my problem. If i have to remove all datain a loop with:
m_Diagram.Nodes.Remove(...)
m_Diagram.Links.Remove(...)
it will be really slow. If i remove all the data with ClearAll its fast, but i have to reload the data which is currently viewed. Is there any way for fast removal of many nodes/links. Maybe some other suggestions to solve this problem?

(Sorry for my bad english, but i am not a native english speaker/writer)

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


MindFusion support

Posts: 13230
Joined: Jul 20th, 2005
Re: Delete large sets of nodes/connections
Reply #1 - Aug 6th, 2010 at 8:42am
Print Post  
Hi,

Try copying the important data to a second diagram and assigning it to the view. You can just discard the old diagram then. You could reuse the CopySelection and PasteSelection methods from the Diagram class to implement that more easily. Calling CopySelection, ClearAll and PasteSelection on the same diagram might work too, but I haven't tried it.

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


I love YaBB 1G - SP1!

Posts: 16
Joined: Aug 6th, 2010
Re: Delete large sets of nodes/connections
Reply #2 - Aug 6th, 2010 at 10:19am
Print Post  
Hmm... if i change the whole Diagram all current active operations will be cancelled (Moving, Resizing, Inplace Edit and so on).

But if there are no other ways, i have to set a Tag (OperationActive) and disable the unload function during such user actions.

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


MindFusion support

Posts: 13230
Joined: Jul 20th, 2005
Re: Delete large sets of nodes/connections
Reply #3 - Aug 6th, 2010 at 11:00am
Print Post  
Yes, this might be necessary if replacing the whole diagram and it's possible for the user to modify it during that time (which you might prevent by setting the view.Behavior to DoNothing)

Another thing you might try is deleting the unimportant items asynchronously from a timer. E.g. set Visible = false for items that will be deleted to hide them immediately from the user, and have a timer event delete a few invisible items on each tick if the user is not doing any manipulations.

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