DisableUpdates() & EnableUpdates() in MeshElement3D

Nov 7, 2011 at 11:34 AM

Hallo,

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,

Chatdanai.

 

 

 

Nov 7, 2011 at 12:43 PM

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

myArrow.BeginEdit();
// do your changes
myArrow.EndEdit();

or

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

Nov 7, 2011 at 1:23 PM

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,

Chatdanai.

Nov 7, 2011 at 1:40 PM

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

Nov 7, 2011 at 2:44 PM

Hallo objo,

verified. Both works perfectly now.

Thanks again,

Chatdanai.