fix:工段标识及建筑高亮

This commit is contained in:
shijing 2023-09-12 08:37:08 +08:00
parent b149cb59e7
commit 7a8f2c0813
1 changed files with 20 additions and 19 deletions

View File

@ -156,12 +156,12 @@ export default {
engine: null,
loadedPercent: 0,
sectionNames: {
"xxxx": "电石渣",
"xxxx2": "原料磨",
"xxxx3": "回转窑",
"xxxx4": "煤磨",
"柱体.023": "水泥磨",
"xxxx6cc": "水泥包装",
"干渣库_primitive0": "电石渣",
"原料磨及废气处理_primitive0": "原料磨",
"": "回转窑",
"煤粉制备_primitive1": "煤磨",
"水泥磨房_primitive0": "水泥磨",
"水泥储存及散装库_primitive2": "水泥包装",
},
showKgcet: true,
currentLightMesh: null,
@ -696,6 +696,7 @@ export default {
control_main.isVertical = false
control_main.top = '-40%';
control_main.left = '-20%';
let meshList = [];
advancedTexture.addControl(control_main);
// function myFunction(){ alert("Yes, this work!"); };
@ -731,8 +732,8 @@ export default {
// mesh
const mesh_rect = new BABYLON_GUI.Rectangle('mesh_rect');
mesh_rect.width = "180px";
mesh_rect.height = "20px";
mesh_rect.width = "100px";
mesh_rect.height = "25px";
mesh_rect.background = 'orange'
mesh_rect.alpha = 0.6
mesh_rect.isVisible = false;
@ -741,7 +742,7 @@ export default {
var mesh_name = new BABYLON_GUI.TextBlock('mesh_name');
mesh_name.text = "";
mesh_name.color = 'white'
mesh_name.fontSize = '16px'
mesh_name.fontSize = '14px'
mesh_rect.addControl(mesh_name);
var remoteGlbUrl = process.env.VUE_APP_BASEURL + "/media/model/factory.glb";
@ -750,10 +751,11 @@ export default {
// debugger;
// console.log(scene)
// console.table(scene.meshes)
//
// /[\u4E00-\u9FA5]+/g.test(str)
let data = scene.meshes;
data.forEach(item=>{
console.log(item.name)
})
for (let key in that.sectionNames) {
var value = that.sectionNames[key];
@ -893,17 +895,16 @@ export default {
if (pickResult.hit) {
const mesh = pickResult.pickedMesh;
highlightLayer.removeAllMeshes();
if(
mesh.name=='熟料库_primitive0'
){
// mesh
highlightLayer.addMesh(mesh, new BABYLON.Color3(1, 1, 0.5));
if(/.*[\u4e00-\u9fa5]+.*$/.test(mesh.name)&&mesh.name!=='地面1') {
// mesh
console.log(mesh.name);
highlightLayer.addMesh(mesh, new BABYLON.Color3(1, 1, 0.5));
that.currentLightMesh = mesh;
mesh_rect.linkWithMesh(mesh);
mesh_name.text = mesh.name;
let name = mesh.name.split('_')[0];
mesh_name.text = name;
mesh_rect.isVisible = true;
}
}
});
// checkbox.isChecked = true; //