bimspot / xeokit-react

Integratation of the xeokit viewer into a React application.
32 stars 22 forks source link

Model & BCF viewpoint business logic #3

Closed barnabasmolnar closed 5 years ago

barnabasmolnar commented 5 years ago

Models can already be dynamically added and removed. Corresponding BCF viewpoints however don't yet respond to props changing. It might be worth refactoring the model and viewpoint loading logic in such a way that the two are more coupled. So instead of having a separate models and bcfViewpoints prop, we could instead have one which includes both a model and its corresponding BCF viewpoint. Thus when changing models, updating the respective viewpoints as well could be a whole lot easier conceptually and implementation wise too.

After a boatload of trial & error and some investigation, I have found that BCF viewpoints are more tied to the scene object itself rather than the models on the scene. They seem to be only connected to models in that a selection array of objects can be supplied to select entities on models.

As a result, I propose that instead of a bcfViewpoints prop that accepts an array of viewpoints, a bcfViewpoint (singular) prop be implemented that accepts one viewpoints obejct.

barnabasmolnar commented 5 years ago

Changes implemented in: https://github.com/bimspot/xeokit-react-demo/commit/82489d4121038eef87755f73bdd336e4ff6ccfb1

barnabasmolnar commented 5 years ago

Update documentation/readme accordingly.