Model sharing feature

Technical discussions
Post Reply
nickz
Site Admin
Posts: 236
Joined: Fri Jul 26, 2013 3:58 am

Model sharing feature

Post by nickz »

Hello all.

In yesterday's 7.1.5368 update we have made official an important feature. It is the new AttachModel() method of the control. It allows sharing models between controls (views) at runtime.

By default, a control always constructs its own model. The method releases the default model and switches its main model reference to the new one (if it is not null).

The model normally comes from another control. It can also come from anywhere, including object generator.
When two or more controls share a model, they act as different views of the model. The new Multi View sample added in the update demonstrates displaying an object in different view configurations.

Sharing a model was possible before as well by pointing ModelPath to the same file, but it is a little cumbersome when the model can be modified, so the app has to reload it in another view.

We have been towards this in low priority since v5. There were many things to reconnect inside. It was added to v7.1 from the start, but without announcing and documenting it properly, as we wanted to release the XDE feature ASAP. Just recently we have looked at it again and decided it is safe to publish it in this version, particularly because of its usefulness.

Happy coding

DInsight

Post Reply