、あなたがこの(Viewer3D.js
から借りた)のような何かを行うことができます:select
について
// Get selected elements from each loaded models
var selection = this.viewer.getAggregateSelection();
var allModels = this.viewer.impl.modelQueue().getModels().concat(); // shallow copy
// Isolate selected nodes.
selection.forEach(function(singleRes){
singleRes.model.visibilityManager.isolate(singleRes.selection);
var indx = allModels.indexOf(singleRes.model);
if (indx >= 0) {
allModels.splice(indx, 1);
}
});
// Hide nodes from all other models
while (allModels.length) {
allModels.pop().visibilityManager.setAllVisibility(false);
}
this.viewer.clearSelection();
を、あなたはviewer.impl.selector.setSelection([dbIds], model);
に対応するモデルとDBIDをを渡し、それぞれのsetSelection
を呼び出す必要があります以下のように設定します。一度にアーカイブすることはできません。 API viewer.impl.visibilityManager
の最近のバージョンで
var selSet = [
{
selection: [1234, 5621],
model: model1
},
{
selection: [12, 758],
model: model2
},
];
selSet.forEach(funciton(sel) {
viewer.impl.selector.setSelection(sel.selection, sel.model);
});
このコードは機能しません。指定されたモデル(Viewer3D.js - 18580行)と一致しないモデルでは、選択がクリアされます。複数のモデルを選択するには、「model.selector.setSelection(ids)」を直接使用し、手動で変更イベントをトリガーする必要があります –