简体   繁体   English

ifc.js 隐藏示例:hover 突出显示未显示子集中的元素

[英]ifc.js hiding example: hover highlights elements in non-displayed subsets

The issue is with the Hiding example (subset example with checkboxes): helloworld/main/examples/web-ifc-viewer/hiding/bundle.js问题在于隐藏示例(带有复选框的子集示例):helloworld/main/examples/web-ifc-viewer/hiding/bundle.js

When a subset is not-displayed, hover still highlights the element in the non-displayed subset.当子集未显示时,hover 仍会突出显示未显示子集中的元素。 The solution as proposed on Discord was to remove the subset model from the array: ifcviewer.context.items.pickableIfcModels, Discord 上提出的解决方案是从数组中删除子集 model:ifcviewer.context.items.pickableIfcModels,

but it's not clear to me how or where to do this.但我不清楚如何或在哪里执行此操作。 Thanks for any help.谢谢你的帮助。

most probably because " ifcviewer.context.items.pickableIfcModels" is still thinks that you're dealing with the model as a whole not with the subsets,很可能是因为“ ifcviewer.context.items.pickableIfcModels”仍然认为您正在处理整个 model 而不是子集,

you need to add this function:您需要添加此 function:

function togglePickable(mesh, isPickable)
    pickable = viewer.context.items.pickableIfcModels
if(isPickable) {
pickable.push(mesh)
} else {
const index = pickable.indexof(mesh)
pickable.splice(index, 1)
}

and on setupCheckbox function add this line under并在 setupCheckbox function 下添加此行

if(checkbox.checked){
..
togglePickable(subset, true)
}else{
...
togglePickable(subset, false)
}

and on setupCategory function add the following:并在 setupCategory function 添加以下内容:

togglePickable(subset[category], true)

and on your load model function you also need to add:在您的负载 model function 上,您还需要添加:

togglePickable("your model", true)

and it shall work ^^它会工作^^

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM