xeokit / xeokit-sdk

Open source JavaScript SDK for viewing high-detail, full-precision 3D BIM and AEC models in the Web browser.
https://xeokit.io
Other
738 stars 291 forks source link

selections don't get reset when switching between BCF viewpoints #139

Closed barnabasmolnar closed 5 years ago

barnabasmolnar commented 5 years ago

Hey Lindsay,

Found a small bug, I reckon.

In our use case, we have a list of BCF viewpoints for a given model. Clicking on a BCF viewpoint, the app will load the viewpoint for the model. We happen to have a selection array for most of our viewpoints. The elements listed in the selection array are highlighted just fine.

What happens now, however, is that previous selections do not get reset. Take the following example: viewpoint#1 has entities A & B, and viewpoint#2 has entities C & D in their respective selection arrays. I select viewpoint#1, A & B get selectend and highlighted. When I switch to viewpoint#2, entites A & B do not get reset and are still selected and highlighted on top of entities C & D.

The expected & desired behaviour would be to reset previous selections. Which I imagine is what you intended anyway and it's just a small bug.

I've looked at the source code and I believe I have found the source of the bug. In fact, it should be an extremely simple fix. Still, I'd like to do some additional testing.

Once I'm sure the issue is resolved, I'll send a PR your way, if that works for you too, that is.

barnabasmolnar commented 5 years ago

Please find the proposed fix here: https://github.com/xeokit/xeokit-sdk/pull/141

xeolabs commented 5 years ago

Cool, thanks very much Barnabas - merged