|
@@ -8,10 +8,11 @@ import sdFc_3 from './shuangdaoFcBlt.threejs'; // sdFc_3 双道-带小门-小窗
|
|
import sdFc_4 from './shuangdaoFcHj.threejs'; // sdFc_4 双道-带门-卷闸
|
|
import sdFc_4 from './shuangdaoFcHj.threejs'; // sdFc_4 双道-带门-卷闸
|
|
import sdFc_2 from './shuangdaoFcSw.threejs'; // sdFc_2 单道-带小门-2个窗
|
|
import sdFc_2 from './shuangdaoFcSw.threejs'; // sdFc_2 单道-带小门-2个窗
|
|
import sdFc_5 from './shuangdaoFcYjl.threejs'; // sdFc_5 双道-小门(侧边下)-小窗(榆家梁)
|
|
import sdFc_5 from './shuangdaoFcYjl.threejs'; // sdFc_5 双道-小门(侧边下)-小窗(榆家梁)
|
|
-import ddFc_4 from './dandaoFcBd1.threejs'; // ddFc_2 单道-一个小窗两列扇叶
|
|
|
|
|
|
+import ddFc_4 from './dandaoFcBd1.threejs'; // ddFc_4 单道-一个小窗两列扇叶
|
|
import ddFc_2 from './dandaoFcBd2.threejs'; // ddFc_2 单道-一个大窗两列竖型扇叶
|
|
import ddFc_2 from './dandaoFcBd2.threejs'; // ddFc_2 单道-一个大窗两列竖型扇叶
|
|
import ddFc_6 from './dandaoFcHjt.threejs'; // ddFc_6 单道-大窗1列扇叶(活鸡兔)
|
|
import ddFc_6 from './dandaoFcHjt.threejs'; // ddFc_6 单道-大窗1列扇叶(活鸡兔)
|
|
import ddFc_7 from './dandaoFcBd3.threejs'; // ddFc_6 单道-大窗1列扇叶(活鸡兔)
|
|
import ddFc_7 from './dandaoFcBd3.threejs'; // ddFc_6 单道-大窗1列扇叶(活鸡兔)
|
|
|
|
+import threeFc_8 from './sandaoFc.threejs'; // ddFc_8 三道-大窗2列门式扇叶(三道沟)
|
|
import { animateCamera } from '/@/utils/threejs/util';
|
|
import { animateCamera } from '/@/utils/threejs/util';
|
|
import useEvent from '../../../../utils/threejs/useEvent';
|
|
import useEvent from '../../../../utils/threejs/useEvent';
|
|
import { getDictItemsByCode } from '/@/utils/dict';
|
|
import { getDictItemsByCode } from '/@/utils/dict';
|
|
@@ -33,6 +34,7 @@ let model: UseThree,
|
|
ddFc4: ddFc_4,
|
|
ddFc4: ddFc_4,
|
|
ddFc6: ddFc_6,
|
|
ddFc6: ddFc_6,
|
|
ddFc7: ddFc_7,
|
|
ddFc7: ddFc_7,
|
|
|
|
+ threeFc8: threeFc_8,
|
|
singleWindowXkObj: singleWindowXk,
|
|
singleWindowXkObj: singleWindowXk,
|
|
group: THREE.Object3D,
|
|
group: THREE.Object3D,
|
|
windowType = 'ddFc1';
|
|
windowType = 'ddFc1';
|
|
@@ -40,6 +42,8 @@ let model: UseThree,
|
|
const rotationParam = {
|
|
const rotationParam = {
|
|
frontDeg0: 0, // 前门初始
|
|
frontDeg0: 0, // 前门初始
|
|
frontDeg1: 0, // 前门目标
|
|
frontDeg1: 0, // 前门目标
|
|
|
|
+ centerDeg0: 0, // 前门初始
|
|
|
|
+ centerDeg1: 0, // 前门目标
|
|
backDeg0: 0, // 后门初始
|
|
backDeg0: 0, // 后门初始
|
|
backDeg1: 0, // 后门目标
|
|
backDeg1: 0, // 后门目标
|
|
};
|
|
};
|
|
@@ -75,6 +79,8 @@ const startAnimation = () => {
|
|
sdFc2.mouseUpModel.call(sdFc2);
|
|
sdFc2.mouseUpModel.call(sdFc2);
|
|
} else if (windowType === 'sdFc5' && sdFc5) {
|
|
} else if (windowType === 'sdFc5' && sdFc5) {
|
|
sdFc5.mouseUpModel.call(sdFc5);
|
|
sdFc5.mouseUpModel.call(sdFc5);
|
|
|
|
+ } else if (windowType === 'threeFc8' && threeFc8) {
|
|
|
|
+ threeFc8.mouseUpModel.call(threeFc8);
|
|
} else if (windowType === 'singleXkWindow' && singleWindowXkObj) {
|
|
} else if (windowType === 'singleXkWindow' && singleWindowXkObj) {
|
|
singleWindowXkObj.mouseUpModel.call(singleWindowXkObj);
|
|
singleWindowXkObj.mouseUpModel.call(singleWindowXkObj);
|
|
}
|
|
}
|
|
@@ -107,6 +113,8 @@ const mouseEvent = (event) => {
|
|
sdFc2.mousedownModel.call(sdFc2, intersects);
|
|
sdFc2.mousedownModel.call(sdFc2, intersects);
|
|
} else if (windowType === 'sdFc5' && sdFc5) {
|
|
} else if (windowType === 'sdFc5' && sdFc5) {
|
|
sdFc5.mousedownModel.call(sdFc5, intersects);
|
|
sdFc5.mousedownModel.call(sdFc5, intersects);
|
|
|
|
+ } else if (windowType === 'threeFc8' && threeFc8) {
|
|
|
|
+ threeFc8.mousedownModel(intersects);
|
|
} else if (windowType === 'singleXkWindow' && singleWindowXkObj) {
|
|
} else if (windowType === 'singleXkWindow' && singleWindowXkObj) {
|
|
singleWindowXkObj.mousedownModel.call(singleWindowXkObj, intersects);
|
|
singleWindowXkObj.mousedownModel.call(singleWindowXkObj, intersects);
|
|
}
|
|
}
|
|
@@ -114,7 +122,11 @@ const mouseEvent = (event) => {
|
|
console.log('摄像头控制信息', model.orbitControls, model.camera);
|
|
console.log('摄像头控制信息', model.orbitControls, model.camera);
|
|
}
|
|
}
|
|
};
|
|
};
|
|
-
|
|
|
|
|
|
+const addMouseEvent = () => {
|
|
|
|
+ // 定义鼠标点击事件
|
|
|
|
+ model.canvasContainer?.addEventListener('mousedown', mouseEvent.bind(null));
|
|
|
|
+ // model.canvasContainer?.addEventListener('pointerup', mouseUp);
|
|
|
|
+};
|
|
export const addMonitorText = (selectData) => {
|
|
export const addMonitorText = (selectData) => {
|
|
if (windowType === 'ddFc5' && ddFc5) {
|
|
if (windowType === 'ddFc5' && ddFc5) {
|
|
return ddFc5.addMonitorText.call(ddFc5, selectData);
|
|
return ddFc5.addMonitorText.call(ddFc5, selectData);
|
|
@@ -138,6 +150,8 @@ export const addMonitorText = (selectData) => {
|
|
return sdFc2.addMonitorText.call(sdFc2, selectData);
|
|
return sdFc2.addMonitorText.call(sdFc2, selectData);
|
|
} else if (windowType === 'sdFc5' && sdFc5) {
|
|
} else if (windowType === 'sdFc5' && sdFc5) {
|
|
return sdFc5.addMonitorText.call(sdFc5, selectData);
|
|
return sdFc5.addMonitorText.call(sdFc5, selectData);
|
|
|
|
+ } else if (windowType === 'threeFc8' && threeFc8) {
|
|
|
|
+ return threeFc8.addMonitorText(selectData);
|
|
} else if (windowType === 'singleXkWindow' && singleWindowXkObj) {
|
|
} else if (windowType === 'singleXkWindow' && singleWindowXkObj) {
|
|
return singleWindowXkObj.addMonitorText.call(singleWindowXkObj, selectData);
|
|
return singleWindowXkObj.addMonitorText.call(singleWindowXkObj, selectData);
|
|
}
|
|
}
|
|
@@ -163,7 +177,7 @@ export function computePlay(data, maxarea, isFirst = false) {
|
|
}, 0);
|
|
}, 0);
|
|
}
|
|
}
|
|
} else {
|
|
} else {
|
|
- if (data.OpenDegree || data.OpenDegree1 || data.OpenDegree2) {
|
|
|
|
|
|
+ if (data.OpenDegree || data.OpenDegree1 || data.OpenDegree2 || data.OpenDegree3) {
|
|
maxarea = 180;
|
|
maxarea = 180;
|
|
if (data.OpenDegree) {
|
|
if (data.OpenDegree) {
|
|
rotationParam.frontDeg0 = (180 / maxarea) * Number(isFirst ? 0 : data.OpenDegree);
|
|
rotationParam.frontDeg0 = (180 / maxarea) * Number(isFirst ? 0 : data.OpenDegree);
|
|
@@ -177,6 +191,10 @@ export function computePlay(data, maxarea, isFirst = false) {
|
|
rotationParam.backDeg0 = (180 / maxarea) * Number(isFirst ? 0 : data.OpenDegree2);
|
|
rotationParam.backDeg0 = (180 / maxarea) * Number(isFirst ? 0 : data.OpenDegree2);
|
|
rotationParam.backDeg1 = (180 / maxarea) * Number(data.OpenDegree2) || 0;
|
|
rotationParam.backDeg1 = (180 / maxarea) * Number(data.OpenDegree2) || 0;
|
|
}
|
|
}
|
|
|
|
+ if (data.OpenDegree3) {
|
|
|
|
+ rotationParam.centerDeg0 = (180 / maxarea) * Number(isFirst ? 0 : data.OpenDegree3);
|
|
|
|
+ rotationParam.centerDeg1 = (180 / maxarea) * Number(data.OpenDegree3) || 0;
|
|
|
|
+ }
|
|
} else {
|
|
} else {
|
|
// 这里判断是扇叶模型还是卷闸模型,如果是卷闸模型时
|
|
// 这里判断是扇叶模型还是卷闸模型,如果是卷闸模型时
|
|
if (isJz) {
|
|
if (isJz) {
|
|
@@ -190,6 +208,10 @@ export function computePlay(data, maxarea, isFirst = false) {
|
|
rotationParam.backDeg0 = (90 / maxarea) * Number(isFirst ? 0 : data.rearArea);
|
|
rotationParam.backDeg0 = (90 / maxarea) * Number(isFirst ? 0 : data.rearArea);
|
|
rotationParam.frontDeg1 = (90 / maxarea) * Number(data.forntArea) || 0;
|
|
rotationParam.frontDeg1 = (90 / maxarea) * Number(data.forntArea) || 0;
|
|
rotationParam.backDeg1 = (90 / maxarea) * Number(data.rearArea) || 0;
|
|
rotationParam.backDeg1 = (90 / maxarea) * Number(data.rearArea) || 0;
|
|
|
|
+ if (windowType == 'threeFc8') {
|
|
|
|
+ rotationParam.centerDeg0 = (90 / maxarea) * Number(isFirst ? 0 : data.middleArea);
|
|
|
|
+ rotationParam.centerDeg1 = (90 / maxarea) * Number(data.middleArea) || 0;
|
|
|
|
+ }
|
|
}
|
|
}
|
|
}
|
|
}
|
|
if (isJz) {
|
|
if (isJz) {
|
|
@@ -202,15 +224,21 @@ export function computePlay(data, maxarea, isFirst = false) {
|
|
// 当返回值有误时默认关闭
|
|
// 当返回值有误时默认关闭
|
|
play(rotationParam, 0);
|
|
play(rotationParam, 0);
|
|
} else {
|
|
} else {
|
|
- if (data.nwindownum == 1 || data.nwindownum == 2) {
|
|
|
|
|
|
+ setTimeout(() => {
|
|
|
|
+ play(rotationParam, 1);
|
|
|
|
+ }, 0);
|
|
|
|
+ if (data.nwindownum == 2) {
|
|
setTimeout(() => {
|
|
setTimeout(() => {
|
|
- play(rotationParam, 1);
|
|
|
|
|
|
+ play(rotationParam, 2);
|
|
}, 0);
|
|
}, 0);
|
|
}
|
|
}
|
|
- if (data.nwindownum == 2) {
|
|
|
|
|
|
+ if (data.nwindownum == 3) {
|
|
setTimeout(() => {
|
|
setTimeout(() => {
|
|
play(rotationParam, 2);
|
|
play(rotationParam, 2);
|
|
}, 0);
|
|
}, 0);
|
|
|
|
+ setTimeout(() => {
|
|
|
|
+ play(rotationParam, 3);
|
|
|
|
+ }, 0);
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
@@ -240,6 +268,8 @@ export const play = (rotationParam, flag) => {
|
|
return sdFc2.play.call(sdFc2, rotationParam, flag);
|
|
return sdFc2.play.call(sdFc2, rotationParam, flag);
|
|
} else if (windowType === 'sdFc5' && sdFc5) {
|
|
} else if (windowType === 'sdFc5' && sdFc5) {
|
|
return sdFc5.play.call(sdFc5, rotationParam, flag);
|
|
return sdFc5.play.call(sdFc5, rotationParam, flag);
|
|
|
|
+ } else if (windowType === 'threeFc8' && threeFc8) {
|
|
|
|
+ return threeFc8.play(rotationParam, flag);
|
|
} else if (windowType === 'singleXkWindow' && singleWindowXkObj) {
|
|
} else if (windowType === 'singleXkWindow' && singleWindowXkObj) {
|
|
return singleWindowXkObj.play.call(singleWindowXkObj, rotationParam, flag);
|
|
return singleWindowXkObj.play.call(singleWindowXkObj, rotationParam, flag);
|
|
}
|
|
}
|
|
@@ -316,6 +346,12 @@ export const setModelType = (type) => {
|
|
newP: { x: 34.294433107431956, y: 19.284123769585108, z: 47.717286013509835 },
|
|
newP: { x: 34.294433107431956, y: 19.284123769585108, z: 47.717286013509835 },
|
|
newT: { x: 12.311816240141978, y: -5.691930035759495, z: -5.57302688985693 },
|
|
newT: { x: 12.311816240141978, y: -5.691930035759495, z: -5.57302688985693 },
|
|
},
|
|
},
|
|
|
|
+ threeFc8: {
|
|
|
|
+ render: threeFc8 ? () => threeFc8.render() : null,
|
|
|
|
+ group: threeFc8 ? threeFc8.group : null,
|
|
|
|
+ newP: { x: 70.79925059068043, y: 61.89235869996884, z: 107.07997293517579 },
|
|
|
|
+ newT: { x: 15.353809053159333, y: 8.712511207091119, z: -13.223119892513122 },
|
|
|
|
+ },
|
|
singleXkWindow: {
|
|
singleXkWindow: {
|
|
render: singleWindowXkObj ? () => singleWindowXkObj.render() : null,
|
|
render: singleWindowXkObj ? () => singleWindowXkObj.render() : null,
|
|
group: singleWindowXkObj ? singleWindowXkObj.group : null,
|
|
group: singleWindowXkObj ? singleWindowXkObj.group : null,
|
|
@@ -404,6 +440,10 @@ export const mountedThree = () => {
|
|
sdFc5 = new sdFc_5(model);
|
|
sdFc5 = new sdFc_5(model);
|
|
await sdFc5.mountedThree();
|
|
await sdFc5.mountedThree();
|
|
break;
|
|
break;
|
|
|
|
+ case 'threeFc8':
|
|
|
|
+ threeFc8 = new threeFc_8(model);
|
|
|
|
+ await threeFc8.mountedThree();
|
|
|
|
+ break;
|
|
case 'singleXkWindow':
|
|
case 'singleXkWindow':
|
|
singleWindowXkObj = new singleWindowXk(model);
|
|
singleWindowXkObj = new singleWindowXk(model);
|
|
await singleWindowXkObj.mountedThree();
|
|
await singleWindowXkObj.mountedThree();
|
|
@@ -411,6 +451,7 @@ export const mountedThree = () => {
|
|
}
|
|
}
|
|
}
|
|
}
|
|
model.animate();
|
|
model.animate();
|
|
|
|
+ // addMouseEvent();
|
|
resolve(null);
|
|
resolve(null);
|
|
});
|
|
});
|
|
};
|
|
};
|
|
@@ -431,6 +472,7 @@ export const destroy = () => {
|
|
if (sdFc4) sdFc4.destroy();
|
|
if (sdFc4) sdFc4.destroy();
|
|
if (sdFc2) sdFc2.destroy();
|
|
if (sdFc2) sdFc2.destroy();
|
|
if (sdFc5) sdFc5.destroy();
|
|
if (sdFc5) sdFc5.destroy();
|
|
|
|
+ if (threeFc8) threeFc8.destroy();
|
|
|
|
|
|
singleWindowXkObj.destroy();
|
|
singleWindowXkObj.destroy();
|
|
model.destroy();
|
|
model.destroy();
|
|
@@ -448,5 +490,6 @@ export const destroy = () => {
|
|
sdFc4 = null;
|
|
sdFc4 = null;
|
|
sdFc2 = null;
|
|
sdFc2 = null;
|
|
sdFc5 = null;
|
|
sdFc5 = null;
|
|
|
|
+ threeFc8 = null;
|
|
}
|
|
}
|
|
};
|
|
};
|