Reputation: 3490
Using the isolate()
method I can isolate few elements and hide everything else like this:
viewer.isolate([65, 80, 83, 92]);
But is it possible to hide all the elements like the hidden elements of the isolated view?
I tried doing viewer.isolate([]);
But that would show all the elements instead.
What I need instead is to be able to hide all the elements and show only the semi-transparent view like in the isolated state.
Is there a way to do this?
Thanks
Upvotes: 0
Views: 2870
Reputation: 53
found an easy global setting for ghosting: Viewer3d.setGhosting(bool)
var viewer = NOP_VIEWER;
viewer.setGhosting(false);
this will turn off the visibility of the non-isolated elements completely
Upvotes: 2
Reputation: 4375
Another solution might be as follow ...
var instanceTree = viewer.model.getData().instanceTree
var rootId = instanceTree.getRootId()
viewer.hide(rootId) // hidding root node will hide whole model ...
Upvotes: 5
Reputation: 8604
For a list of dbIds, you can call the following (for each dbId):
var n = viewer.model.getData().instanceTree.nodeAccess.nodes[dbId];
viewer.impl.visibilityManager.setNodeOff(n, true);
To show again, just replace the setNodeOff true with false.
Upvotes: 3