C# |
---|
public abstract void BeginUpdate () |
By default, when you send events to event-in slots in the scene via the EAI, each change is processed immediatly. For many applications, this is perfectly ok, but there are some drawbacks of that approach. First of all, it is quite inefficient when you have to send many events at once. For each event, the EAI has to send the data value to the X3D browser, and then has to wait for the reply, which takes some time, especially when communicating via a network. Furthermore, it is impossible to send two or more events simultaneously, or to combine changes at single elements of a multi-field to a single event. To overcome these drawbacks, a pair of two methods exists, BeginUpdate and EndUpdate.
When calling EndUpdate, the Browser object stops sending all events immediately, and instead buffers them in memory until you call the BeginUpdate method. At that point, all buffered events are sent at the same time, and the Browser object starts sending events immediately again.
C# |
---|
Vrml.EAI.Browser browser = ...; Vrml.EAI.Field.EventInSFVec3f set_translation1 = ...; Vrml.EAI.Field.EventInSFVec3f set_translation2 = ...; float[] translation1 = ...; float[] translation2 = ...; browser.EndUpdate(); set_translation1.SetValue(translation1); set_translation2.SetValue(translation2); browser.BeginUpdate(); |