更新一点点
This commit is contained in:
@@ -9,6 +9,7 @@ import {
|
||||
import { saveState, resetState } from "./viewBack";
|
||||
import addFunction from "./addEvent";
|
||||
import { addEquipment, removeEquipment } from "./editEquipment";
|
||||
import tunnelModeInit from "./tunnelInit"
|
||||
import { Group } from "three/examples/jsm/libs/tween.module";
|
||||
export default class Demo {
|
||||
// 摄像机看向位置
|
||||
@@ -26,6 +27,7 @@ export default class Demo {
|
||||
this._resetState = resetState;
|
||||
this.addEquipment = addEquipment;
|
||||
this.removeEquipment = removeEquipment;
|
||||
this.tunnelModeInit = tunnelModeInit;
|
||||
|
||||
// 外部可添加函数
|
||||
this.addFunction = addFunction;
|
||||
@@ -509,28 +511,4 @@ export default class Demo {
|
||||
msg: "dda"
|
||||
}
|
||||
tunnelConfigEquipment = this.ThreeConfig.data.tunnelThreeConfig
|
||||
tunnelModeInit() {
|
||||
for (const item of this.tunnelConfigEquipment) {
|
||||
//使用api取拿到附着点
|
||||
let pointmodel = this.scene.getObjectByName(item.pointName)
|
||||
pointmodel.hasDevice;
|
||||
let formInfo = {
|
||||
equipmentType: item.equipmentType, //设备类型
|
||||
chooseEquipment: item.equipmentName, //设备选择(设备名称)
|
||||
threshold: item.equipmentValue, //阈值
|
||||
}
|
||||
this.addEquipment(pointmodel, formInfo);
|
||||
}
|
||||
//进行预览和编辑模式的一些操作
|
||||
if (this.isedit == false) {
|
||||
this.scene.traverse(function (item) {
|
||||
if (item.name.includes('point')) {
|
||||
if (item.hasDevice == false) {
|
||||
item.visible = false
|
||||
item.layers.set(-1)
|
||||
}
|
||||
}
|
||||
})
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,24 @@
|
||||
export default function tunnelModeInit() {
|
||||
for (const item of this.tunnelConfigEquipment) {
|
||||
//使用api取拿到附着点
|
||||
let pointmodel = this.scene.getObjectByName(item.pointName)
|
||||
pointmodel.hasDevice;
|
||||
let formInfo = {
|
||||
equipmentType: item.equipmentType, //设备类型
|
||||
chooseEquipment: item.equipmentName, //设备选择(设备名称)
|
||||
threshold: item.equipmentValue, //阈值
|
||||
}
|
||||
this.addEquipment(pointmodel, formInfo);
|
||||
}
|
||||
//进行预览和编辑模式的一些操作
|
||||
if (this.isedit == false) {
|
||||
this.scene.traverse(function (item) {
|
||||
if (item.name.includes('point')) {
|
||||
if (item.hasDevice == false) {
|
||||
item.visible = false
|
||||
item.layers.set(-1)
|
||||
}
|
||||
}
|
||||
})
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user