iflow-engine-base 3.7.2 → 3.7.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -22324,11 +22324,7 @@ function Mg(n) {
|
|
|
22324
22324
|
const m = Date.now(), A = m - e.mouseDownTime, x = new _.Vector3(p.offsetX, p.offsetY, 0);
|
|
22325
22325
|
e.self && e.self.handleMouseUp != null && p.button == 0 && (o(p, !1, !1, !1), e.self.handleMouseUp(p));
|
|
22326
22326
|
const b = x.distanceTo(e.mouseDownPosition);
|
|
22327
|
-
|
|
22328
|
-
o(p, !0, !0, !1);
|
|
22329
|
-
const y = m - e.lastClickTime;
|
|
22330
|
-
console.log(y), y < 200 ? e.self.handleMouseDoubleClick != null && p.button == 0 && e.self.handleMouseDoubleClick(p) : e.self.handleMouseClick != null && p.button == 0 ? e.self.handleMouseClick(p) : e.self.handleRightMouseClick != null && p.button == 2 && e.self.handleRightMouseClick(p), e.lastClickTime = Date.now();
|
|
22331
|
-
}
|
|
22327
|
+
(A < 100 || b == 0) && e.self && e.self.handleMouseClick != null && (o(p, !0, !0, !1), m - e.lastClickTime < 200 ? e.self.handleMouseDoubleClick != null && p.button == 0 && e.self.handleMouseDoubleClick(p) : e.self.handleMouseClick != null && p.button == 0 ? e.self.handleMouseClick(p) : e.self.handleRightMouseClick != null && p.button == 2 && e.self.handleRightMouseClick(p), e.lastClickTime = Date.now());
|
|
22332
22328
|
}
|
|
22333
22329
|
function h(p) {
|
|
22334
22330
|
const m = p.touches[0] || p.changedTouches[0];
|
|
@@ -22370,7 +22366,7 @@ function Mg(n) {
|
|
|
22370
22366
|
n.hoverHighLight.clearHighlight();
|
|
22371
22367
|
return;
|
|
22372
22368
|
}
|
|
22373
|
-
|
|
22369
|
+
n.catchSvg.innerHTML = "";
|
|
22374
22370
|
let b = n.octreeBox.rayInterationModel(p, A, x);
|
|
22375
22371
|
b = n.clipping?.filterIntersectionsByClipping(b) ?? b;
|
|
22376
22372
|
let y = n.scene.children.filter((Q) => Q instanceof _.InstancedMesh);
|
|
@@ -33121,7 +33117,7 @@ class tR {
|
|
|
33121
33117
|
t.ids.forEach((r) => {
|
|
33122
33118
|
let o = this.engine.models.find((a) => a.url == t.url).nodesMap.get(r);
|
|
33123
33119
|
o != null && o.indexes != null && o.indexes.forEach((a) => {
|
|
33124
|
-
this.getSceneModel(a[0]) instanceof _.InstancedMesh ? i.has(a[0]) ? i.get(a[0])?.push(a[1]) : i.set(a[0], [a[1]]) : (
|
|
33120
|
+
this.getSceneModel(a[0]) instanceof _.InstancedMesh ? i.has(a[0]) ? i.get(a[0])?.push(a[1]) : i.set(a[0], [a[1]]) : (this.split_merge_model(this.getSceneModel(a[0])), this.getSceneModel(a[0]).geometry.groups[a[1]].materialIndex = 1);
|
|
33125
33121
|
});
|
|
33126
33122
|
}), iR(i, this.engine);
|
|
33127
33123
|
let s = this.engine.engineStatus.highlightModels.find((r) => r.url == t.url);
|
|
@@ -35529,7 +35525,7 @@ function OR(n, e, t) {
|
|
|
35529
35525
|
r = document.createElement("div"), r.className = "ViewCube", t.appendChild(r), o = document.createElement("div"), o.className = "viewSettingWrapper", o.innerHTML = "...";
|
|
35530
35526
|
var x = document.createElement("div");
|
|
35531
35527
|
x.className = "homeViewWrapper", x.addEventListener("mousedown", function() {
|
|
35532
|
-
|
|
35528
|
+
n.viewCube.cameraGoHome(500);
|
|
35533
35529
|
}), r.appendChild(x), o.addEventListener("mousedown", function(v) {
|
|
35534
35530
|
v.stopPropagation(), cameraToggle.classList.contains("show") ? (b(), console.log("隐藏功能按钮")) : (y(), console.log("显示功能按钮"));
|
|
35535
35531
|
});
|
|
@@ -35863,6 +35859,7 @@ function OR(n, e, t) {
|
|
|
35863
35859
|
class UR {
|
|
35864
35860
|
engine;
|
|
35865
35861
|
cubeTool;
|
|
35862
|
+
mainViewPort;
|
|
35866
35863
|
constructor(e) {
|
|
35867
35864
|
this.engine = e;
|
|
35868
35865
|
}
|
|
@@ -35871,6 +35868,18 @@ class UR {
|
|
|
35871
35868
|
}
|
|
35872
35869
|
// 相机回归正位
|
|
35873
35870
|
CameraGoHome(e) {
|
|
35871
|
+
if (this.mainViewPort) {
|
|
35872
|
+
this.goToMainPort();
|
|
35873
|
+
return;
|
|
35874
|
+
}
|
|
35875
|
+
this.cubeTool.CameraGoHome(e);
|
|
35876
|
+
}
|
|
35877
|
+
// 相机回归正位
|
|
35878
|
+
cameraGoHome(e) {
|
|
35879
|
+
if (this.mainViewPort) {
|
|
35880
|
+
this.goToMainPort();
|
|
35881
|
+
return;
|
|
35882
|
+
}
|
|
35874
35883
|
this.cubeTool.CameraGoHome(e);
|
|
35875
35884
|
}
|
|
35876
35885
|
// 缩放到指定模型
|
|
@@ -35885,8 +35894,61 @@ class UR {
|
|
|
35885
35894
|
} catch {
|
|
35886
35895
|
}
|
|
35887
35896
|
}
|
|
35888
|
-
//
|
|
35889
|
-
|
|
35897
|
+
// 将当前视图设置为主视图
|
|
35898
|
+
saveMainViewPort() {
|
|
35899
|
+
const e = this.engine.cameraModule.perspectiveCamera, t = this.engine.cameraModule.orthographicCamera, i = this.engine.controls;
|
|
35900
|
+
return this.mainViewPort = {
|
|
35901
|
+
activeCamera: this.engine.cameraModule.getCameraType(),
|
|
35902
|
+
perspectiveCamera: {
|
|
35903
|
+
position: e.position.clone(),
|
|
35904
|
+
quaternion: e.quaternion.clone(),
|
|
35905
|
+
target: i.target.clone(),
|
|
35906
|
+
fov: e.fov,
|
|
35907
|
+
near: e.near,
|
|
35908
|
+
far: e.far,
|
|
35909
|
+
up: e.up.clone()
|
|
35910
|
+
},
|
|
35911
|
+
orthographicCamera: {
|
|
35912
|
+
position: t.position.clone(),
|
|
35913
|
+
quaternion: t.quaternion.clone(),
|
|
35914
|
+
target: i.target.clone(),
|
|
35915
|
+
zoom: t.zoom,
|
|
35916
|
+
left: t.left,
|
|
35917
|
+
right: t.right,
|
|
35918
|
+
top: t.top,
|
|
35919
|
+
bottom: t.bottom,
|
|
35920
|
+
near: t.near,
|
|
35921
|
+
far: t.far,
|
|
35922
|
+
up: t.up.clone()
|
|
35923
|
+
}
|
|
35924
|
+
}, this.mainViewPort;
|
|
35925
|
+
}
|
|
35926
|
+
// 赋值当前视图
|
|
35927
|
+
setMainViewPort(e) {
|
|
35928
|
+
this.mainViewPort = e, this.goToMainPort();
|
|
35929
|
+
}
|
|
35930
|
+
// 跳转到保存的视图
|
|
35931
|
+
goToMainPort() {
|
|
35932
|
+
const e = this.mainViewPort;
|
|
35933
|
+
if (!e) return;
|
|
35934
|
+
this.engine.cameraModule.getCameraType() !== e.activeCamera && (e.activeCamera === "orthographic" ? this.engine.cameraModule.switchToOrthographicCamera() : this.engine.cameraModule.switchToPerspectiveCamera());
|
|
35935
|
+
const i = e.activeCamera === "orthographic" ? e.orthographicCamera : e.perspectiveCamera;
|
|
35936
|
+
if (e.activeCamera === "orthographic") {
|
|
35937
|
+
const s = this.engine.cameraModule.orthographicCamera;
|
|
35938
|
+
s.left = i.left, s.right = i.right, s.top = i.top, s.bottom = i.bottom, s.zoom = i.zoom, s.updateProjectionMatrix();
|
|
35939
|
+
} else {
|
|
35940
|
+
const s = this.engine.cameraModule.perspectiveCamera;
|
|
35941
|
+
s.fov = i.fov, s.updateProjectionMatrix();
|
|
35942
|
+
}
|
|
35943
|
+
this.engine.camera.up.copy(i.up), this.cubeTool.ReductionCameraPose(i, 500);
|
|
35944
|
+
}
|
|
35945
|
+
// 重置主视图
|
|
35946
|
+
resetMainViewPort() {
|
|
35947
|
+
this.mainViewPort = null, this.cubeTool.CameraGoHome();
|
|
35948
|
+
}
|
|
35949
|
+
// 截图保存
|
|
35950
|
+
screenshot() {
|
|
35951
|
+
this.cubeTool.TakeScreenshot();
|
|
35890
35952
|
}
|
|
35891
35953
|
}
|
|
35892
35954
|
function NR(n) {
|
|
@@ -53229,7 +53291,7 @@ class pU {
|
|
|
53229
53291
|
}
|
|
53230
53292
|
createTextButton(e, t) {
|
|
53231
53293
|
const i = document.createElement("button");
|
|
53232
|
-
return i.type = "button", i.textContent = e, i.style.height = "28px", i.style.padding = "0 10px", i.style.border = "1px solid #d9d9d9", i.style.borderRadius = "4px", i.style.background = "#ffffff", i.style.color = "#333333", i.style.fontSize = "13px", i.style.lineHeight = "1", i.style.cursor = "pointer", i;
|
|
53294
|
+
return i.type = "button", i.textContent = e, i.style.width = "28px", i.style.height = "28px", i.style.padding = "0 10px", i.style.border = "1px solid #d9d9d9", i.style.borderRadius = "4px", i.style.background = "#ffffff", i.style.color = "#333333", i.style.fontSize = "13px", i.style.lineHeight = "1", i.style.cursor = "pointer", i;
|
|
53233
53295
|
}
|
|
53234
53296
|
}
|
|
53235
53297
|
class gU {
|
|
@@ -53902,7 +53964,7 @@ class mU {
|
|
|
53902
53964
|
* 清空批注(便捷接口)
|
|
53903
53965
|
*/
|
|
53904
53966
|
clearAnnotation() {
|
|
53905
|
-
this.engine.fabricDraw?.clearAllShapes?.();
|
|
53967
|
+
this.engine.fabricDraw?.clearAllShapes?.(), this.engine.measure.disActive?.();
|
|
53906
53968
|
}
|
|
53907
53969
|
/**
|
|
53908
53970
|
* 获取剖切状态
|
|
@@ -54163,7 +54225,7 @@ class AU {
|
|
|
54163
54225
|
// 业务数据
|
|
54164
54226
|
models = [];
|
|
54165
54227
|
reactBoundingClientRect = { left: 0, top: 0 };
|
|
54166
|
-
version = "3.7.
|
|
54228
|
+
version = "3.7.3";
|
|
54167
54229
|
versionEl = null;
|
|
54168
54230
|
// 引擎容器
|
|
54169
54231
|
container;
|