fix:工段标识及建筑高亮
This commit is contained in:
parent
b149cb59e7
commit
7a8f2c0813
|
@ -156,12 +156,12 @@ export default {
|
||||||
engine: null,
|
engine: null,
|
||||||
loadedPercent: 0,
|
loadedPercent: 0,
|
||||||
sectionNames: {
|
sectionNames: {
|
||||||
"xxxx": "电石渣",
|
"干渣库_primitive0": "电石渣",
|
||||||
"xxxx2": "原料磨",
|
"原料磨及废气处理_primitive0": "原料磨",
|
||||||
"xxxx3": "回转窑",
|
"窑": "回转窑",
|
||||||
"xxxx4": "煤磨",
|
"煤粉制备_primitive1": "煤磨",
|
||||||
"柱体.023": "水泥磨",
|
"水泥磨房_primitive0": "水泥磨",
|
||||||
"xxxx6cc": "水泥包装",
|
"水泥储存及散装库_primitive2": "水泥包装",
|
||||||
},
|
},
|
||||||
showKgcet: true,
|
showKgcet: true,
|
||||||
currentLightMesh: null,
|
currentLightMesh: null,
|
||||||
|
@ -696,6 +696,7 @@ export default {
|
||||||
control_main.isVertical = false
|
control_main.isVertical = false
|
||||||
control_main.top = '-40%';
|
control_main.top = '-40%';
|
||||||
control_main.left = '-20%';
|
control_main.left = '-20%';
|
||||||
|
let meshList = [];
|
||||||
advancedTexture.addControl(control_main);
|
advancedTexture.addControl(control_main);
|
||||||
|
|
||||||
// function myFunction(){ alert("Yes, this work!"); };
|
// function myFunction(){ alert("Yes, this work!"); };
|
||||||
|
@ -731,8 +732,8 @@ export default {
|
||||||
|
|
||||||
// 高亮显示mesh名
|
// 高亮显示mesh名
|
||||||
const mesh_rect = new BABYLON_GUI.Rectangle('mesh_rect');
|
const mesh_rect = new BABYLON_GUI.Rectangle('mesh_rect');
|
||||||
mesh_rect.width = "180px";
|
mesh_rect.width = "100px";
|
||||||
mesh_rect.height = "20px";
|
mesh_rect.height = "25px";
|
||||||
mesh_rect.background = 'orange'
|
mesh_rect.background = 'orange'
|
||||||
mesh_rect.alpha = 0.6
|
mesh_rect.alpha = 0.6
|
||||||
mesh_rect.isVisible = false;
|
mesh_rect.isVisible = false;
|
||||||
|
@ -741,7 +742,7 @@ export default {
|
||||||
var mesh_name = new BABYLON_GUI.TextBlock('mesh_name');
|
var mesh_name = new BABYLON_GUI.TextBlock('mesh_name');
|
||||||
mesh_name.text = "";
|
mesh_name.text = "";
|
||||||
mesh_name.color = 'white'
|
mesh_name.color = 'white'
|
||||||
mesh_name.fontSize = '16px'
|
mesh_name.fontSize = '14px'
|
||||||
mesh_rect.addControl(mesh_name);
|
mesh_rect.addControl(mesh_name);
|
||||||
|
|
||||||
var remoteGlbUrl = process.env.VUE_APP_BASEURL + "/media/model/factory.glb";
|
var remoteGlbUrl = process.env.VUE_APP_BASEURL + "/media/model/factory.glb";
|
||||||
|
@ -750,10 +751,11 @@ export default {
|
||||||
// debugger;
|
// debugger;
|
||||||
// console.log(scene)
|
// console.log(scene)
|
||||||
// console.table(scene.meshes)
|
// console.table(scene.meshes)
|
||||||
|
// 判断字符串是否包含中文
|
||||||
|
// /[\u4E00-\u9FA5]+/g.test(str)
|
||||||
let data = scene.meshes;
|
let data = scene.meshes;
|
||||||
data.forEach(item=>{
|
|
||||||
console.log(item.name)
|
|
||||||
})
|
|
||||||
for (let key in that.sectionNames) {
|
for (let key in that.sectionNames) {
|
||||||
var value = that.sectionNames[key];
|
var value = that.sectionNames[key];
|
||||||
|
|
||||||
|
@ -893,17 +895,16 @@ export default {
|
||||||
if (pickResult.hit) {
|
if (pickResult.hit) {
|
||||||
const mesh = pickResult.pickedMesh;
|
const mesh = pickResult.pickedMesh;
|
||||||
highlightLayer.removeAllMeshes();
|
highlightLayer.removeAllMeshes();
|
||||||
if(
|
if(/.*[\u4e00-\u9fa5]+.*$/.test(mesh.name)&&mesh.name!=='地面1') {
|
||||||
mesh.name=='熟料库_primitive0'
|
// 在选中的 mesh 上添加高亮效果
|
||||||
){
|
console.log(mesh.name);
|
||||||
// 在选中的 mesh 上添加高亮效果
|
highlightLayer.addMesh(mesh, new BABYLON.Color3(1, 1, 0.5));
|
||||||
highlightLayer.addMesh(mesh, new BABYLON.Color3(1, 1, 0.5));
|
|
||||||
that.currentLightMesh = mesh;
|
that.currentLightMesh = mesh;
|
||||||
mesh_rect.linkWithMesh(mesh);
|
mesh_rect.linkWithMesh(mesh);
|
||||||
mesh_name.text = mesh.name;
|
let name = mesh.name.split('_')[0];
|
||||||
|
mesh_name.text = name;
|
||||||
mesh_rect.isVisible = true;
|
mesh_rect.isVisible = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
// checkbox.isChecked = true; //默认开启自动旋转
|
// checkbox.isChecked = true; //默认开启自动旋转
|
||||||
|
|
Loading…
Reference in New Issue