DisableUpdates() & EnableUpdates() in MeshElement3D

Anonymous 10 years ago updated by ไอยดา สุรีวงค์ 3 years ago 1
This discussion was imported from CodePlex

phichaikid wrote at 2011-11-07 11:34:


I am developing a visualizer of multi-body system simulation. There are components, which bump into each other during the simulation. I can compute the bumping pressure and visualize it with ArrowVisual3D. In an animation, there can be 100 - 1000 of ArrowVisual3D to update during each frame (time point). I plug the update of ArrowVisual3D in CompositionTarget.Rendering. I have to update .Point1, .Point2 (direction of pressure), .HeadLength, .Diameter (for better visualization).

Till change set 70988, there is DisableUpdates() & EnableUpdates() in MeshElement3D, which I use in the update process of ArrowVisual3D, because I have to update 4 properties but do not want the program to update ArrowVisual3D 4 times. After the change set 70988, there aren't DisableUpdates() & EnableUpdates() anymore. Is there any ways to achieve the same effect i.e. ArrowVisual3D is updated only 1 time in each frame, even though, I want to update 4 properties. Or should I copy this DisableUpdates() & EnableUpdates() to the newer release?

I did some searchs in google but did not find anything useful from .net framework. Or do you perhaps implement other method in Helix 3D Toolkit, which yields the same effect?

Thanks in advanced,





objo wrote at 2011-11-07 12:43:

hi Chatdanai, I made two changes that could help. Get the latest source and try

// do your changes


myArrow.Diameter = 0;
// change the points and head length
myArrow.Diameter = arrowDiameter;

phichaikid wrote at 2011-11-07 13:23:

Hallo objo,

Thank you very much for the super fast response.

I have tried both approaches. The 2nd one works perfectly. But the 1st one updates the ArrowVisual3D only if I change another property after call to EndEdit(). Is it intentionally? I think you mean I should change properties within calls to BeginEdit() & EndEdit().

Anyway, it is working for me now. Thanks a lot.

Best regards,


objo wrote at 2011-11-07 13:40:

I checked in a correction. The first solution should hopefully also work now. Please verify!

phichaikid wrote at 2011-11-07 14:44:

Hallo objo,

verified. Both works perfectly now.

Thanks again,