2017-10-10 5 views
0

を分離は、(一方のみモデルがビューアにロードされた状態で)オブジェクト単離:選択/ /選択するために、APIリファレンスに記載された方法でマルチモデルアプローチで

- select(dbids,selectionType) 
- isolate(node)/isolateById(dbids) // that is the difference? 

Iは知っているが、マルチモデルのためのアナログを選択:

viewer.impl.selector.setSelection([objectIds], model); 

質問は以下のとおりです。

  1. は、マルチモデルのモードが存在するためにアナログを分離しますか?
  2. diffrenentモデルから2つのオブジェクトを一度に選択/分離するにはどうすればよいですか? isolateについては

答えて

0

あなたは2番目の引数としてのモデルを渡すことができますので、MultiModelVisibilityManagerを返して:

MultiModelVisibilityManager.prototype.isolate = function (node, model) 

はviewer3D.jsに(L#17825)を見てくださいそのオブジェクトの利用可能なメソッドを表示します。

私が知る限り、1回の呼び出しで異なるモデルから2つのオブジェクトを選択する方法はありません。それぞれのモデルに1つのselectコールを発行するだけです。私はそれに問題は見られません。

希望に役立ちます。

0

、あなたがこの(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); 
}); 
+0

このコードは機能しません。指定されたモデル(Viewer3D.js - 18580行)と一致しないモデルでは、選択がクリアされます。複数のモデルを選択するには、「model.selector.setSelection(ids)」を直接使用し、手動で変更イベントをトリガーする必要があります –

関連する問題