iflow-engine-base 3.12.4 → 3.12.5

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.
@@ -1,7 +1,7 @@
1
- import { J as pe, S as fe } from "./sdk-vendor-VZI0bEcg.js";
2
- import { V as y, E as ye, Q as ve, M as I, a as P, b as x, B as D, F as T, S as we, c as F, m as j, d as xe, P as be, C as k, e as Me, f as Ce, N as Ee, T as ke, L as Y, g as S, h as V, D as W, i as Le, j as G, k as ne, G as R, l as Se, n as Te, A as Pe, o as Ie, O as Ae, p as De, W as Ne, q as Re, r as H, s as ze, I as Ve, R as We } from "./three-vendor-Bx2tSp_D.js";
3
- import { c as Be, a as _e, F as O, C as je, W as oe, L as Ge, E as He, r as Ue } from "./sdk-runtime-B4l79tmQ.js";
4
- import { r as A } from "./sdk-assets-Cr-wEweL.js";
1
+ import { J as pe, S as fe } from "./sdk-vendor-CvevZpJO.js";
2
+ import { V as y, E as ye, Q as ve, M as I, a as P, b as x, B as D, F as T, S as we, c as F, m as j, d as xe, P as be, C as k, e as Me, f as Ee, N as Ce, T as ke, L as Y, g as S, h as V, D as W, i as Le, j as G, k as ne, G as R, l as Se, n as Te, A as Pe, o as Ie, O as Ae, p as De, W as Ne, q as Re, r as H, s as ze, I as Ve, R as We } from "./three-vendor-BL-jpeTM.js";
3
+ import { c as Be, a as _e, F as O, C as je, W as oe, L as Ge, E as He, r as Ue } from "./sdk-runtime-83EeZHe_.js";
4
+ import { r as A } from "./sdk-assets-D5UGR827.js";
5
5
  class Oe {
6
6
  panel = null;
7
7
  listEl = null;
@@ -603,9 +603,9 @@ class q {
603
603
  l.forEach((w) => {
604
604
  const b = this.clipTriangle(v, w);
605
605
  if (!(b.length < 3))
606
- for (let E = 1; E < b.length - 1; E += 1)
607
- [b[0], b[E], b[E + 1]].forEach((C) => {
608
- o.push(C.position.x, C.position.y, C.position.z), a && C.uv && r.push(C.uv.x, C.uv.y);
606
+ for (let C = 1; C < b.length - 1; C += 1)
607
+ [b[0], b[C], b[C + 1]].forEach((E) => {
608
+ o.push(E.position.x, E.position.y, E.position.z), a && E.uv && r.push(E.uv.x, E.uv.y);
609
609
  });
610
610
  });
611
611
  }
@@ -1152,16 +1152,16 @@ class Ze {
1152
1152
  new x(n.maxX, n.minY),
1153
1153
  new x(n.maxX, n.maxY),
1154
1154
  new x(n.minX, n.maxY)
1155
- ], c = u.dot(h), p = f.map((z) => z.dot(h) - c), v = Math.min(...p) - o, w = Math.max(...p) + o, b = Math.floor(Math.min(v / g, w / g)) - 2, E = Math.ceil(Math.max(v / g, w / g)) + 2, C = [], U = new x((n.minX + n.maxX) / 2, (n.minY + n.maxY) / 2);
1156
- for (let z = b; z <= E && C.length < r; z += 1) {
1155
+ ], c = u.dot(h), p = f.map((z) => z.dot(h) - c), v = Math.min(...p) - o, w = Math.max(...p) + o, b = Math.floor(Math.min(v / g, w / g)) - 2, C = Math.ceil(Math.max(v / g, w / g)) + 2, E = [], U = new x((n.minX + n.maxX) / 2, (n.minY + n.maxY) / 2);
1156
+ for (let z = b; z <= C && E.length < r; z += 1) {
1157
1157
  const _ = u.clone().add(m.clone().multiplyScalar(z)), K = _.clone().add(l.clone().multiplyScalar(U.clone().sub(_).dot(l))), he = K.clone().add(l.clone().multiplyScalar(-o * 2)), ce = K.clone().add(l.clone().multiplyScalar(o * 2));
1158
1158
  this.clipLineByPolygon(he, ce, i).forEach(([de, ue]) => {
1159
1159
  this.subtractHoles(de, ue, s).forEach(([ge, me]) => {
1160
- this.appendDashedSegment(C, ge, me, t.dashLengths, _, l);
1160
+ this.appendDashedSegment(E, ge, me, t.dashLengths, _, l);
1161
1161
  });
1162
1162
  });
1163
1163
  }
1164
- return C.slice(0, r);
1164
+ return E.slice(0, r);
1165
1165
  }
1166
1166
  /** 使用后端展开后的 PAT 线族定义;patternLines 已经包含最终角度和偏移。 */
1167
1167
  resolvePatternLineTransform(e, t) {
@@ -1216,7 +1216,7 @@ class Ze {
1216
1216
  e.push([t, i]);
1217
1217
  return;
1218
1218
  }
1219
- const a = this.normalizeDashPattern(s), l = a.reduce((b, E) => b + E.length, 0);
1219
+ const a = this.normalizeDashPattern(s), l = a.reduce((b, C) => b + C.length, 0);
1220
1220
  if (l < M) {
1221
1221
  e.push([t, i]);
1222
1222
  return;
@@ -1224,8 +1224,8 @@ class Ze {
1224
1224
  const h = o?.clone().normalize() ?? i.clone().sub(t).normalize(), u = n ?? t, g = i.clone().sub(t).normalize().dot(h) >= 0 ? 1 : -1, f = t.clone().sub(u).dot(h) * g, c = this.positiveModulo(f, l);
1225
1225
  let p = 0, v = this.findDashIndex(a, c), w = c - a[v].start;
1226
1226
  for (; p < r - M; ) {
1227
- const b = a[v], E = Math.max(b.length - w, M), C = Math.min(r, p + E);
1228
- b.draw && e.push([this.pointAtLength(t, i, p), this.pointAtLength(t, i, C)]), p = C, v = (v + 1) % a.length, w = 0;
1227
+ const b = a[v], C = Math.max(b.length - w, M), E = Math.min(r, p + C);
1228
+ b.draw && e.push([this.pointAtLength(t, i, p), this.pointAtLength(t, i, E)]), p = E, v = (v + 1) % a.length, w = 0;
1229
1229
  }
1230
1230
  }
1231
1231
  /** 将 PAT dash 数组转为带累计起点的周期表,0 长点线用很短的可见段表示。 */
@@ -1403,10 +1403,10 @@ class Q {
1403
1403
  sampleSplineCurve(e, t) {
1404
1404
  const i = Math.min(Math.max(Number(t.degree ?? this.engine.options?.splineDegree ?? 6), 1), e.length - 1), s = Array.isArray(t.knots) && t.knots.length === e.length + i + 1 ? t.knots : this.createClampedUniformKnots(e.length, i), n = e.map((a, l) => {
1405
1405
  const h = Array.isArray(t.weights) ? Number(t.weights[l] ?? 1) : 1;
1406
- return new Ce(a.x, a.y, a.z, Number.isFinite(h) ? h : 1);
1406
+ return new Ee(a.x, a.y, a.z, Number.isFinite(h) ? h : 1);
1407
1407
  });
1408
1408
  let o = (e.length - 1) * 2;
1409
- const r = new Ee(i, s, n).getPoints(o);
1409
+ const r = new Ce(i, s, n).getPoints(o);
1410
1410
  return t.closed === !0 && r.length > 1 && r.push(r[0].clone()), r;
1411
1411
  }
1412
1412
  /** 在缺少 knots 的数据里生成首尾夹紧的均匀节点向量。 */
@@ -2496,8 +2496,8 @@ class et {
2496
2496
  return;
2497
2497
  const t = Math.max(1, this.container.clientWidth), i = Math.max(1, this.container.clientHeight), s = this.camera.zoom, n = this.camera.right - this.camera.left, o = this.camera.top - this.camera.bottom, r = Math.max(this.minSpacing, n / s), a = Math.max(this.minSpacing, o / s), l = this.camera.position.x, h = this.camera.position.y, u = r / t, m = a / i, g = u * this.desiredMinorPixelSize, f = this.normalizeSpacing(g), c = this.lastState;
2498
2498
  if (!e) {
2499
- const w = Math.abs(s - c.zoom) / Math.max(1e-4, c.zoom || 1) > 0.02, b = Math.abs(f - c.minorSpacing) > c.minorSpacing * 0.05, E = Math.abs(l - c.centerX) > Math.max(f * 0.5, 0.01), C = Math.abs(h - c.centerY) > Math.max(f * 0.5, 0.01), U = Math.abs(r - c.viewWidth) > c.viewWidth * 0.01, z = Math.abs(a - c.viewHeight) > c.viewHeight * 0.01, _ = t !== c.containerWidth || i !== c.containerHeight;
2500
- if (!(w || b || E || C || U || z || _))
2499
+ const w = Math.abs(s - c.zoom) / Math.max(1e-4, c.zoom || 1) > 0.02, b = Math.abs(f - c.minorSpacing) > c.minorSpacing * 0.05, C = Math.abs(l - c.centerX) > Math.max(f * 0.5, 0.01), E = Math.abs(h - c.centerY) > Math.max(f * 0.5, 0.01), U = Math.abs(r - c.viewWidth) > c.viewWidth * 0.01, z = Math.abs(a - c.viewHeight) > c.viewHeight * 0.01, _ = t !== c.containerWidth || i !== c.containerHeight;
2500
+ if (!(w || b || C || E || U || z || _))
2501
2501
  return;
2502
2502
  }
2503
2503
  const p = r * this.coverageMultiplier, v = a * this.coverageMultiplier;
@@ -2742,9 +2742,9 @@ class st {
2742
2742
  a.addVectors(n, o).multiplyScalar(0.5);
2743
2743
  const l = new y();
2744
2744
  l.subVectors(o, n);
2745
- const u = Math.max(l.x, l.y) * t, m = this.container.clientWidth / this.container.clientHeight, g = u / 2, f = g * m, c = -f, p = f, v = g, w = -g, b = a.x, E = a.y, C = 1;
2745
+ const u = Math.max(l.x, l.y) * t, m = this.container.clientWidth / this.container.clientHeight, g = u / 2, f = g * m, c = -f, p = f, v = g, w = -g, b = a.x, C = a.y, E = 1;
2746
2746
  if (!i) {
2747
- this.orthographicCamera.left = c, this.orthographicCamera.right = p, this.orthographicCamera.top = v, this.orthographicCamera.bottom = w, this.orthographicCamera.position.set(b, E, this.defaultPosition.z), this.orthographicCamera.zoom = C, this.orthographicCamera.updateProjectionMatrix(), this.engine.controlModule2d?.panControls && (this.engine.controlModule2d.panControls.setPosition(b, E), this.engine.controlModule2d.panControls.setZoom(C)), this.engine.events && this.engine.events.trigger("camera-changed", {
2747
+ this.orthographicCamera.left = c, this.orthographicCamera.right = p, this.orthographicCamera.top = v, this.orthographicCamera.bottom = w, this.orthographicCamera.position.set(b, C, this.defaultPosition.z), this.orthographicCamera.zoom = E, this.orthographicCamera.updateProjectionMatrix(), this.engine.controlModule2d?.panControls && (this.engine.controlModule2d.panControls.setPosition(b, C), this.engine.controlModule2d.panControls.setZoom(E)), this.engine.events && this.engine.events.trigger("camera-changed", {
2748
2748
  type: "fit-to-extents",
2749
2749
  center: a,
2750
2750
  size: l
@@ -2765,8 +2765,8 @@ class st {
2765
2765
  top: v,
2766
2766
  bottom: w,
2767
2767
  x: b,
2768
- y: E,
2769
- zoom: C
2768
+ y: C,
2769
+ zoom: E
2770
2770
  }, this.animationDuration = s, this.animationStartTime = performance.now(), this.animateFitToExtents(a, l);
2771
2771
  }
2772
2772
  /**
@@ -3709,7 +3709,8 @@ class lt {
3709
3709
  return Math.atan2(e.clientX - i, s - e.clientY);
3710
3710
  }
3711
3711
  }
3712
- class ht {
3712
+ const ht = "bim-engine:link-element-2d3d-state";
3713
+ class ct {
3713
3714
  engine;
3714
3715
  enabled = !1;
3715
3716
  constructor(e) {
@@ -3717,7 +3718,7 @@ class ht {
3717
3718
  }
3718
3719
  /** 切换二三维构件联动状态。 */
3719
3720
  toggle() {
3720
- return this.enabled = !this.enabled, this.enabled ? this.active() : this.disActive(), this.enabled;
3721
+ return this.enabled = !this.enabled, this.enabled ? this.active() : this.disActive(), this.emitLinkState(), this.enabled;
3721
3722
  }
3722
3723
  /** 获取当前二三维构件联动状态。 */
3723
3724
  isEnabled() {
@@ -3729,6 +3730,15 @@ class ht {
3729
3730
  disActive() {
3730
3731
  window.removeEventListener("D3ElementClick", this.listenElementClick);
3731
3732
  }
3733
+ dispose() {
3734
+ this.enabled = !1, this.disActive(), this.emitLinkState();
3735
+ }
3736
+ /** 通知同页面 3D 引擎同步联动状态,用于控制空闲降帧等跨引擎行为。 */
3737
+ emitLinkState() {
3738
+ typeof window > "u" || window.dispatchEvent(new CustomEvent(ht, {
3739
+ detail: { enabled: this.enabled }
3740
+ }));
3741
+ }
3732
3742
  listenElementClick = (e) => {
3733
3743
  const t = String(e?.detail?.id), i = this.engine.loaderModule2d?.model?.nodeMap?.get(t), s = this.getNodesWorldBounds(i);
3734
3744
  if (s) {
@@ -3762,7 +3772,7 @@ class ht {
3762
3772
  return e?.object ?? e?.group?.children?.[e.indexes?.[0]] ?? this.engine.modelGroup?.children?.[e.indexes?.[0]];
3763
3773
  }
3764
3774
  }
3765
- class ct {
3775
+ class dt {
3766
3776
  engine;
3767
3777
  highlightMaterial;
3768
3778
  hideMaterial;
@@ -4022,7 +4032,7 @@ class ct {
4022
4032
  return !0;
4023
4033
  }
4024
4034
  }
4025
- function dt(d) {
4035
+ function ut(d) {
4026
4036
  const e = {
4027
4037
  mouseMoveFrame: null,
4028
4038
  latestMouseMoveEvent: null,
@@ -4090,10 +4100,10 @@ function dt(d) {
4090
4100
  const p = c.touches[0] || c.changedTouches[0];
4091
4101
  if (!p)
4092
4102
  return null;
4093
- const w = d.renderer.domElement.getBoundingClientRect(), b = p.clientX - w.left, E = p.clientY - w.top;
4103
+ const w = d.renderer.domElement.getBoundingClientRect(), b = p.clientX - w.left, C = p.clientY - w.top;
4094
4104
  return {
4095
4105
  offsetX: b,
4096
- offsetY: E,
4106
+ offsetY: C,
4097
4107
  button: 0,
4098
4108
  // 模拟左键
4099
4109
  clientX: p.clientX,
@@ -4132,7 +4142,7 @@ function dt(d) {
4132
4142
  }
4133
4143
  return e;
4134
4144
  }
4135
- class ut {
4145
+ class gt {
4136
4146
  el;
4137
4147
  xEl;
4138
4148
  yEl;
@@ -4152,7 +4162,7 @@ class ut {
4152
4162
  }
4153
4163
  }
4154
4164
  var le = /* @__PURE__ */ ((d) => (d.ModelLoadStart = "model-load-start", d.ModelLoadProgress = "model-load-progress", d.ModelLoaded = "model-loaded", d.ModelError = "model-error", d.SelectionChanged = "selection-changed", d.HoverChanged = "hover-changed", d.Click = "click", d.MouseMove = "mouse-move", d.CameraChanged = "camera-changed", d.CameraIdle = "camera-idle", d.EngineFree = "engine-free", d.EngineBusy = "engine-busy", d.MeasureChanged = "measure-changed", d.MeasureClick = "measure-click", d.SectionMove = "section-move", d))(le || {});
4155
- class gt {
4165
+ class mt {
4156
4166
  engine;
4157
4167
  behavior;
4158
4168
  mouseCoordUI = null;
@@ -4162,7 +4172,7 @@ class gt {
4162
4172
  init() {
4163
4173
  this.behavior = this.engine.handelBehaved2d, this.behavior.init(this);
4164
4174
  const e = this.engine.container;
4165
- e && this.engine.options?.showMouseCoordinates !== !1 && (this.mouseCoordUI = new ut(e));
4175
+ e && this.engine.options?.showMouseCoordinates !== !1 && (this.mouseCoordUI = new gt(e));
4166
4176
  }
4167
4177
  active() {
4168
4178
  this.behavior.active();
@@ -4229,7 +4239,7 @@ class gt {
4229
4239
  this.mouseCoordUI?.dispose(), this.mouseCoordUI = null;
4230
4240
  }
4231
4241
  }
4232
- class mt {
4242
+ class pt {
4233
4243
  overlay;
4234
4244
  hLine;
4235
4245
  vLine;
@@ -4283,7 +4293,7 @@ const te = [
4283
4293
  { action: "linkElement2d3d", label: "模型联动", dividerBefore: !0 },
4284
4294
  { action: "linkView2d3d", label: "视角关联" }
4285
4295
  ];
4286
- class pt {
4296
+ class ft {
4287
4297
  menu;
4288
4298
  container;
4289
4299
  canvas;
@@ -4356,7 +4366,7 @@ class pt {
4356
4366
  this.canvas.removeEventListener("contextmenu", this.onContextMenu), document.removeEventListener("mousedown", this.onDocMouseDown), document.removeEventListener("keydown", this.onEscape), this.menu.parentElement?.removeChild(this.menu);
4357
4367
  }
4358
4368
  }
4359
- class ft {
4369
+ class yt {
4360
4370
  overlay = null;
4361
4371
  textEl = null;
4362
4372
  barEl = null;
@@ -4491,14 +4501,14 @@ class ft {
4491
4501
  this.overlay?.remove(), this.overlay = null, this.textEl = null, this.barEl = null, this.pctEl = null;
4492
4502
  }
4493
4503
  }
4494
- const yt = `<svg width="16" height="16" viewBox="0 0 16 16" fill="none" xmlns="http://www.w3.org/2000/svg">
4504
+ const vt = `<svg width="16" height="16" viewBox="0 0 16 16" fill="none" xmlns="http://www.w3.org/2000/svg">
4495
4505
  <circle cx="6.5" cy="6.5" r="4.5" stroke="currentColor" stroke-width="1.5"/>
4496
4506
  <line x1="10" y1="10" x2="14" y2="14" stroke="currentColor" stroke-width="1.5" stroke-linecap="round"/>
4497
- </svg>`, vt = `<svg width="12" height="12" viewBox="0 0 12 12" fill="none" xmlns="http://www.w3.org/2000/svg">
4507
+ </svg>`, wt = `<svg width="12" height="12" viewBox="0 0 12 12" fill="none" xmlns="http://www.w3.org/2000/svg">
4498
4508
  <line x1="1" y1="1" x2="11" y2="11" stroke="currentColor" stroke-width="1.5" stroke-linecap="round"/>
4499
4509
  <line x1="11" y1="1" x2="1" y2="11" stroke="currentColor" stroke-width="1.5" stroke-linecap="round"/>
4500
4510
  </svg>`;
4501
- class wt {
4511
+ class xt {
4502
4512
  manager;
4503
4513
  wrapper;
4504
4514
  input;
@@ -4517,7 +4527,7 @@ class wt {
4517
4527
  return e.className = "engine-2d-search", e.innerHTML = `
4518
4528
  <div class="engine-2d-search__box">
4519
4529
  <div class="engine-2d-search__input-row">
4520
- <span class="engine-2d-search__icon">${yt}</span>
4530
+ <span class="engine-2d-search__icon">${vt}</span>
4521
4531
  <input
4522
4532
  class="engine-2d-search__input"
4523
4533
  type="text"
@@ -4525,7 +4535,7 @@ class wt {
4525
4535
  autocomplete="off"
4526
4536
  spellcheck="false"
4527
4537
  />
4528
- <button class="engine-2d-search__clear" title="清除">${vt}</button>
4538
+ <button class="engine-2d-search__clear" title="清除">${wt}</button>
4529
4539
  </div>
4530
4540
  <div class="engine-2d-search__divider"></div>
4531
4541
  <div class="engine-2d-search__status"></div>
@@ -4631,13 +4641,13 @@ class wt {
4631
4641
  this.input.removeEventListener("input", this.onInput), this.input.removeEventListener("keydown", this.onKeyDown), this.clearBtn.removeEventListener("click", this.onClear), document.removeEventListener("mousedown", this.onDocMouseDown), document.removeEventListener("keydown", this.onEscape), this.wrapper.parentElement?.removeChild(this.wrapper), this.debounceTimer !== null && clearTimeout(this.debounceTimer);
4632
4642
  }
4633
4643
  }
4634
- class xt {
4644
+ class bt {
4635
4645
  engine;
4636
4646
  searchUI = null;
4637
4647
  constructor(e) {
4638
4648
  this.engine = e;
4639
4649
  const t = document.getElementById(e?.options?.containerId ?? "") ?? e?.container ?? null;
4640
- t && (this.searchUI = new wt(t, this));
4650
+ t && (this.searchUI = new xt(t, this));
4641
4651
  }
4642
4652
  /** 只查询已加载的文字实体,支持连续包含和按字符顺序的模糊匹配。 */
4643
4653
  search(e) {
@@ -4814,7 +4824,7 @@ const ie = {
4814
4824
  "--e2d-coord-label": "rgba(0,0,0,0.50)"
4815
4825
  }
4816
4826
  };
4817
- class bt {
4827
+ class Mt {
4818
4828
  container;
4819
4829
  current;
4820
4830
  constructor(e, t = "dark") {
@@ -4882,7 +4892,7 @@ class Z {
4882
4892
  this.clearAllPoints();
4883
4893
  }
4884
4894
  }
4885
- class Mt extends Z {
4895
+ class Et extends Z {
4886
4896
  /** 两点完成一条距离测量。 */
4887
4897
  handleClick(e) {
4888
4898
  super.handleClick(e), this.points.length === 2 && (this.manager.addMeasurement("distance", this.points), this.clearAllPoints());
@@ -4904,7 +4914,7 @@ class Ct extends Z {
4904
4914
  e.length >= 3 && this.manager.addMeasurement("area", e), this.clearAllPoints();
4905
4915
  }
4906
4916
  }
4907
- class Et extends Z {
4917
+ class kt extends Z {
4908
4918
  /** 三点完成角度测量,第二个点作为角点。 */
4909
4919
  handleClick(e) {
4910
4920
  super.handleClick(e), this.points.length === 3 && (this.manager.addMeasurement("angle", this.points), this.clearAllPoints());
@@ -4913,7 +4923,7 @@ class Et extends Z {
4913
4923
  this.points.length >= 2 && this.manager.drawPreview("angle", [...this.points, e]);
4914
4924
  }
4915
4925
  }
4916
- class kt {
4926
+ class Lt {
4917
4927
  distanceMeasure;
4918
4928
  areaMeasure;
4919
4929
  angleMeasure;
@@ -4933,7 +4943,7 @@ class kt {
4933
4943
  hasDraggedAfterMouseDown = !1;
4934
4944
  currentWorkspaceKey = "model";
4935
4945
  constructor(e) {
4936
- this.engine = e, this.container = e.container, this.distanceMeasure = new Mt(this), this.areaMeasure = new Ct(this), this.angleMeasure = new Et(this), this.annotationContainer = document.createElement("div"), this.annotationContainer.className = "annotation-container", this.annotationContainer.style.pointerEvents = "none", this.annotationContainer.style.zIndex = "20", this.container.appendChild(this.annotationContainer);
4946
+ this.engine = e, this.container = e.container, this.distanceMeasure = new Et(this), this.areaMeasure = new Ct(this), this.angleMeasure = new kt(this), this.annotationContainer = document.createElement("div"), this.annotationContainer.className = "annotation-container", this.annotationContainer.style.pointerEvents = "none", this.annotationContainer.style.zIndex = "20", this.container.appendChild(this.annotationContainer);
4937
4947
  }
4938
4948
  /** 开启 2D 测量事件;只停用图元点选,不停用 pan/zoom 视图控制。 */
4939
4949
  active() {
@@ -5192,7 +5202,7 @@ const $ = {
5192
5202
  strokeWidth: 2,
5193
5203
  fontSize: 16,
5194
5204
  cloudRadius: 10
5195
- }, Lt = {
5205
+ }, St = {
5196
5206
  none: A("/assets/icon/选择.svg", import.meta.url),
5197
5207
  line: A("/assets/icon/线.svg", import.meta.url),
5198
5208
  arrow: A("/assets/icon/箭头.svg", import.meta.url),
@@ -5201,8 +5211,8 @@ const $ = {
5201
5211
  polygon: A("/assets/icon/面积.svg", import.meta.url),
5202
5212
  text: A("/assets/icon/文字.svg", import.meta.url),
5203
5213
  cloudline: A("/assets/icon/云线.svg", import.meta.url)
5204
- }, St = "data:image/svg+xml;utf8," + encodeURIComponent('<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="#1f2937" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="M3 6h18"/><path d="M8 6V4h8v2"/><path d="M6 6l1 16h10l1-16"/><path d="M10 11v6"/><path d="M14 11v6"/></svg>'), Tt = "data:image/svg+xml;utf8," + encodeURIComponent('<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="#1f2937" stroke-width="2" stroke-linecap="round"><path d="M6 6l12 12"/><path d="M18 6L6 18"/></svg>');
5205
- class Pt {
5214
+ }, Tt = "data:image/svg+xml;utf8," + encodeURIComponent('<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="#1f2937" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="M3 6h18"/><path d="M8 6V4h8v2"/><path d="M6 6l1 16h10l1-16"/><path d="M10 11v6"/><path d="M14 11v6"/></svg>'), Pt = "data:image/svg+xml;utf8," + encodeURIComponent('<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="#1f2937" stroke-width="2" stroke-linecap="round"><path d="M6 6l12 12"/><path d="M18 6L6 18"/></svg>');
5215
+ class It {
5206
5216
  engine;
5207
5217
  container;
5208
5218
  layer;
@@ -5382,7 +5392,7 @@ class Pt {
5382
5392
  { type: "cloudline", title: "云线,双击或 Enter 结束" },
5383
5393
  { type: "text", title: "文字" }
5384
5394
  ].forEach((a) => {
5385
- const l = this.createIconButton(a.title, Lt[a.type]);
5395
+ const l = this.createIconButton(a.title, St[a.type]);
5386
5396
  l.onclick = () => {
5387
5397
  this.active(), this.setDrawType(a.type);
5388
5398
  }, a.type !== "none" && (this.buttons[a.type] = l), e.appendChild(l);
@@ -5399,9 +5409,9 @@ class Pt {
5399
5409
  n.type = "number", n.min = "10", n.max = "72", n.value = `${this.style.fontSize}`, n.title = "字号", n.onchange = () => {
5400
5410
  this.style.fontSize = this.normalizeNumber(n.valueAsNumber, 10, 72, $.fontSize);
5401
5411
  }, e.appendChild(n), e.appendChild(this.createDivider());
5402
- const o = this.createIconButton("清空", St);
5412
+ const o = this.createIconButton("清空", Tt);
5403
5413
  o.onclick = () => this.clearAll(), e.appendChild(o);
5404
- const r = this.createIconButton("关闭", Tt);
5414
+ const r = this.createIconButton("关闭", Pt);
5405
5415
  return r.onclick = () => {
5406
5416
  this.hideToolbar(), this.disActive();
5407
5417
  }, e.appendChild(r), e;
@@ -5602,7 +5612,7 @@ class Pt {
5602
5612
  return `markup-2d-${Date.now()}-${Math.random().toString(16).slice(2)}`;
5603
5613
  }
5604
5614
  }
5605
- class It {
5615
+ class At {
5606
5616
  engine;
5607
5617
  manager;
5608
5618
  constructor(e) {
@@ -5669,7 +5679,7 @@ class It {
5669
5679
  return { x: i.x, y: i.y, z: 0 };
5670
5680
  }
5671
5681
  }
5672
- class At {
5682
+ class Dt {
5673
5683
  engine;
5674
5684
  mainViewPort = null;
5675
5685
  constructor(e) {
@@ -5705,7 +5715,7 @@ class At {
5705
5715
  };
5706
5716
  }
5707
5717
  }
5708
- class Dt {
5718
+ class Nt {
5709
5719
  constructor(e, t) {
5710
5720
  this.container = e, this.engine = t, this.el = document.createElement("div"), this.el.className = "engine-2d-workspace-tabs", this.container.appendChild(this.el), this.unsubscribe = this.engine.events?.on(L.ModelLoaded, () => this.refresh()) ?? (() => {
5711
5721
  }), this.refresh();
@@ -5744,7 +5754,7 @@ class Dt {
5744
5754
  this.unsubscribe(), this.el.remove();
5745
5755
  }
5746
5756
  }
5747
- class Nt {
5757
+ class Rt {
5748
5758
  // 配置选项
5749
5759
  options;
5750
5760
  container = null;
@@ -5803,13 +5813,13 @@ class Nt {
5803
5813
  ]
5804
5814
  }, this.enablePerformanceMonitoring = e.enablePerformanceMonitoring ?? !1, this.container = document.getElementById(e.containerId), !this.container)
5805
5815
  throw new Error(`Container ${e.containerId} not found`);
5806
- this.initialize(), this.handelBehaved2d = dt(this), this.interactionModule2d = new gt(this), this.interactionModule2d.init(), this.interactionModule2d.active();
5816
+ this.initialize(), this.handelBehaved2d = ut(this), this.interactionModule2d = new mt(this), this.interactionModule2d.init(), this.interactionModule2d.active();
5807
5817
  }
5808
5818
  /**
5809
5819
  * 初始化引擎
5810
5820
  */
5811
5821
  initialize() {
5812
- this.events = new $e(!1), this.sceneModule2d = new tt(this, this.options), this.scene = this.sceneModule2d.scene, this.cameraModule2d = new st(this, this.container), this.camera = this.cameraModule2d.orthographicCamera, this.renderModule2d = new nt(this, this.container, this.options), this.renderer = this.renderModule2d.renderer, this.controlModule2d = new rt(this), this.loaderModule2d = new qe(this), this.themeManager = new bt(this.container), this.layerManager = new re(this), this.searchManager = new xt(this), this.measure = new kt(this), this.markup = new Pt(this), this.label = new It(this), this.viewCube = new At(this), this.octreeBox2d = new at(this), this.modelToolModule2d = new ct(this), this.engineStatus2d = new it(this), this.linkView2d3d = new lt(this), this.linkElement2d3d = new ht(this), this.sceneModule2d.initGrid(), this.cadCursorUI = new mt(this.container, this.renderer.domElement, this.options.cursorStyle ?? "short-crosshair"), this.cadCursorUI.setBackgroundColor(this.options.backgroundColor ?? 1710618), this.loadingUI = new ft(this.container, this.options.loadingStyle), this.events.on(L.ModelLoadStart, () => this.loadingUI.show("正在加载...", 0)), this.events.on(L.ModelLoadProgress, (e) => this.loadingUI.update(e.text, e.progress)), this.events.on(L.ModelLoaded, () => this.loadingUI.hide()), this.events.on(L.ModelLoadError, () => this.loadingUI.hide()), this.versionEl = document.createElement("div"), this.versionEl.className = "engine-2d-version-text", this.updateVersionDisplay(), this.container.appendChild(this.versionEl), this.workspaceTabsUI = new Dt(this.container, this), this.contextMenuUI = new pt(
5822
+ this.events = new $e(!1), this.sceneModule2d = new tt(this, this.options), this.scene = this.sceneModule2d.scene, this.cameraModule2d = new st(this, this.container), this.camera = this.cameraModule2d.orthographicCamera, this.renderModule2d = new nt(this, this.container, this.options), this.renderer = this.renderModule2d.renderer, this.controlModule2d = new rt(this), this.loaderModule2d = new qe(this), this.themeManager = new Mt(this.container), this.layerManager = new re(this), this.searchManager = new bt(this), this.measure = new Lt(this), this.markup = new It(this), this.label = new At(this), this.viewCube = new Dt(this), this.octreeBox2d = new at(this), this.modelToolModule2d = new dt(this), this.engineStatus2d = new it(this), this.linkView2d3d = new lt(this), this.linkElement2d3d = new ct(this), this.sceneModule2d.initGrid(), this.cadCursorUI = new pt(this.container, this.renderer.domElement, this.options.cursorStyle ?? "short-crosshair"), this.cadCursorUI.setBackgroundColor(this.options.backgroundColor ?? 1710618), this.loadingUI = new yt(this.container, this.options.loadingStyle), this.events.on(L.ModelLoadStart, () => this.loadingUI.show("正在加载...", 0)), this.events.on(L.ModelLoadProgress, (e) => this.loadingUI.update(e.text, e.progress)), this.events.on(L.ModelLoaded, () => this.loadingUI.hide()), this.events.on(L.ModelLoadError, () => this.loadingUI.hide()), this.versionEl = document.createElement("div"), this.versionEl.className = "engine-2d-version-text", this.updateVersionDisplay(), this.container.appendChild(this.versionEl), this.workspaceTabsUI = new Nt(this.container, this), this.contextMenuUI = new ft(
5813
5823
  this.container,
5814
5824
  this.renderer.domElement,
5815
5825
  (e) => {
@@ -6084,14 +6094,14 @@ class Nt {
6084
6094
  * 销毁引擎
6085
6095
  */
6086
6096
  dispose() {
6087
- console.log("[EngineKernel2d] Disposing engine..."), this.stopRendering(), this.cadCursorUI?.dispose(), this.contextMenuUI?.dispose(), this.loadingUI?.dispose(), this.workspaceTabsUI?.dispose(), this.versionEl?.parentElement?.removeChild(this.versionEl), this.searchManager?.dispose(), this.measure?.dispose(), this.markup?.dispose(), this.label?.dispose(), this.themeManager?.dispose(), this.loaderModule2d?.dispose(), this.controlModule2d?.dispose(), this.renderModule2d?.dispose(), this.cameraModule2d?.dispose(), this.sceneModule2d?.dispose(), this.events?.dispose(), this.stats?.dom?.parentElement && this.stats.dom.parentElement.removeChild(this.stats.dom), this.scene = null, this.camera = null, this.renderer = null, this.dwgData = null, this.stats = void 0, this.versionEl = null, console.log("[EngineKernel2d] Engine disposed");
6097
+ console.log("[EngineKernel2d] Disposing engine..."), this.stopRendering(), this.cadCursorUI?.dispose(), this.contextMenuUI?.dispose(), this.loadingUI?.dispose(), this.workspaceTabsUI?.dispose(), this.versionEl?.parentElement?.removeChild(this.versionEl), this.searchManager?.dispose(), this.measure?.dispose(), this.markup?.dispose(), this.label?.dispose(), this.themeManager?.dispose(), this.linkElement2d3d?.dispose(), this.loaderModule2d?.dispose(), this.controlModule2d?.dispose(), this.renderModule2d?.dispose(), this.cameraModule2d?.dispose(), this.sceneModule2d?.dispose(), this.events?.dispose(), this.stats?.dom?.parentElement && this.stats.dom.parentElement.removeChild(this.stats.dom), this.scene = null, this.camera = null, this.renderer = null, this.dwgData = null, this.stats = void 0, this.versionEl = null, console.log("[EngineKernel2d] Engine disposed");
6088
6098
  }
6089
6099
  }
6090
- const _t = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
6100
+ const jt = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
6091
6101
  __proto__: null,
6092
- EngineKernel2d: Nt
6102
+ EngineKernel2d: Rt
6093
6103
  }, Symbol.toStringTag, { value: "Module" }));
6094
6104
  export {
6095
- _t as E,
6105
+ jt as E,
6096
6106
  qe as L
6097
6107
  };