@bimdata/viewer 2.6.0-beta.14 → 2.6.0-beta.15
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.
|
@@ -54494,11 +54494,16 @@ function eCt(t) {
|
|
|
54494
54494
|
);
|
|
54495
54495
|
}
|
|
54496
54496
|
function tCt(t) {
|
|
54497
|
-
const e = t.$viewer
|
|
54498
|
-
|
|
54499
|
-
|
|
54500
|
-
|
|
54501
|
-
|
|
54497
|
+
const { localContext: e } = t.$viewer, i = t.viewer, n = e.hub.on(
|
|
54498
|
+
"storey-selected",
|
|
54499
|
+
({ storey: s }) => {
|
|
54500
|
+
if (!s) return;
|
|
54501
|
+
const r = e.loadedModels.flatMap(
|
|
54502
|
+
(o) => o.objects.map((a) => String(a.id))
|
|
54503
|
+
);
|
|
54504
|
+
i.scene.hideObjects(r), ode(i, s.objects);
|
|
54505
|
+
}
|
|
54506
|
+
);
|
|
54502
54507
|
return {
|
|
54503
54508
|
destroy() {
|
|
54504
54509
|
e.hub.off(n);
|
|
@@ -130091,10 +130096,8 @@ const tXt = /* @__PURE__ */ z($Zt, [["render", eXt], ["__scopeId", "data-v-1fe63
|
|
|
130091
130096
|
watch: {
|
|
130092
130097
|
model(t) {
|
|
130093
130098
|
var n;
|
|
130094
|
-
if (!t)
|
|
130095
|
-
this.layers = [];
|
|
130099
|
+
if (!t)
|
|
130096
130100
|
return;
|
|
130097
|
-
}
|
|
130098
130101
|
const e = t.stateModel, i = e.parent_id ? this.$viewer.state.models.find((s) => s.id === e.parent_id) : e;
|
|
130099
130102
|
this.multiLayout = ((n = i.children) == null ? void 0 : n.length) > 1;
|
|
130100
130103
|
}
|
|
@@ -130231,18 +130234,13 @@ const tXt = /* @__PURE__ */ z($Zt, [["render", eXt], ["__scopeId", "data-v-1fe63
|
|
|
130231
130234
|
t.length > 0 ? this.viewer.camera.fitView(t) : this.viewer.camera.fitView();
|
|
130232
130235
|
},
|
|
130233
130236
|
async loadModel(t, e) {
|
|
130234
|
-
|
|
130237
|
+
if (e) {
|
|
130238
|
+
const s = e.parent_id || e.id;
|
|
130239
|
+
this.previousLayersModelId !== s && (this.layers = await this.getLayers(s), this.previousLayersModelId = s);
|
|
130240
|
+
}
|
|
130235
130241
|
const i = new Map(
|
|
130236
130242
|
t.objects.map((s) => [s.id, s])
|
|
130237
130243
|
);
|
|
130238
|
-
if ((e == null ? void 0 : e.storeys.length) > 0) {
|
|
130239
|
-
const s = e.storeys.find((o) => o.name === "Model") || e.storeys.find(
|
|
130240
|
-
(o) => o.name.toLowerCase().includes("model")
|
|
130241
|
-
) || e.storeys[0], r = new Set((s == null ? void 0 : s.uuids.keys()) ?? []);
|
|
130242
|
-
r.size > 0 && (t.objects.forEach((o) => {
|
|
130243
|
-
r.has(o.id) || i.delete(o.id);
|
|
130244
|
-
}), t.objects = [...i.values()]);
|
|
130245
|
-
}
|
|
130246
130244
|
this.layers.filter((s) => s.displayed === !1).forEach((s) => {
|
|
130247
130245
|
var r;
|
|
130248
130246
|
(r = s.elements) == null || r.forEach((o) => {
|
|
@@ -130316,10 +130314,10 @@ const tXt = /* @__PURE__ */ z($Zt, [["render", eXt], ["__scopeId", "data-v-1fe63
|
|
|
130316
130314
|
});
|
|
130317
130315
|
});
|
|
130318
130316
|
} catch {
|
|
130319
|
-
const
|
|
130320
|
-
return console.error(
|
|
130317
|
+
const e = `[Viewer ${this.plugin.modelType}] Impossible to get ${this.plugin.modelType} layers for model with id ${t}`;
|
|
130318
|
+
return console.error(e), this.$viewer.localContext.hub.emit("alert", {
|
|
130321
130319
|
type: "error",
|
|
130322
|
-
message:
|
|
130320
|
+
message: e
|
|
130323
130321
|
}), [];
|
|
130324
130322
|
}
|
|
130325
130323
|
},
|
|
@@ -130764,9 +130762,8 @@ const l$t = /* @__PURE__ */ z(r$t, [["render", a$t], ["__scopeId", "data-v-6b269
|
|
|
130764
130762
|
position: "absolute",
|
|
130765
130763
|
left: o.canvasPosition.x + "px",
|
|
130766
130764
|
top: o.canvasPosition.y + "px",
|
|
130767
|
-
transformOrigin: "top left"
|
|
130768
|
-
|
|
130769
|
-
// visibility: marker.visible ? "visible" : "hidden",
|
|
130765
|
+
transformOrigin: "top left",
|
|
130766
|
+
visibility: o.visible ? "visible" : "hidden"
|
|
130770
130767
|
},
|
|
130771
130768
|
onWheel: She(n.viewer.canvas),
|
|
130772
130769
|
scale: r.scale,
|
|
@@ -130781,13 +130778,7 @@ const l$t = /* @__PURE__ */ z(r$t, [["render", a$t], ["__scopeId", "data-v-6b269
|
|
|
130781
130778
|
let u$t = 0;
|
|
130782
130779
|
class d$t {
|
|
130783
130780
|
constructor(e, i, { x: n = 0, y: s = 0, component: r, listeners: o, rotation: a = 0, props: l = {} } = {}) {
|
|
130784
|
-
this.id = u$t++, this._x = n, this._y = s, this._rotation = a, this._engine2d = i, this._canvasPositionCache = null, this.props = l, this.component = r, this.listeners = o, this._markers = e, this.
|
|
130785
|
-
}
|
|
130786
|
-
get visible() {
|
|
130787
|
-
return this._visible.value;
|
|
130788
|
-
}
|
|
130789
|
-
set visible(e) {
|
|
130790
|
-
this._visible.value = e;
|
|
130781
|
+
this.id = u$t++, this._x = n, this._y = s, this._rotation = a, this._engine2d = i, this._canvasPositionCache = null, this.props = l, this.component = r, this.listeners = o, this._markers = e, this.visible = !0;
|
|
130791
130782
|
}
|
|
130792
130783
|
get rotation() {
|
|
130793
130784
|
return this._rotation;
|
|
@@ -155398,7 +155389,7 @@ class qCe {
|
|
|
155398
155389
|
}
|
|
155399
155390
|
/**
|
|
155400
155391
|
* @param { Object } drawingData
|
|
155401
|
-
* @returns { import("
|
|
155392
|
+
* @returns { import("../Drawer.js").Drawing }
|
|
155402
155393
|
*/
|
|
155403
155394
|
create(e, i) {
|
|
155404
155395
|
throw new Error("Not implemented");
|
|
@@ -156124,7 +156115,7 @@ class dpi {
|
|
|
156124
156115
|
if (this.clearDrawings(), !d || r.value === !1) return;
|
|
156125
156116
|
const h = await this._service.getDrawingsData(d.id);
|
|
156126
156117
|
for (const p of h)
|
|
156127
|
-
this.makeDrawing(p.type, p,
|
|
156118
|
+
this.makeDrawing(p.type, p, p.z);
|
|
156128
156119
|
u == null || u(), d.type === "METABUILDING" && (u = A());
|
|
156129
156120
|
}
|
|
156130
156121
|
);
|
|
@@ -166731,7 +166722,9 @@ async function mBi(t, e, i) {
|
|
|
166731
166722
|
var h, p, f, g;
|
|
166732
166723
|
const u = o.get(A.uuid) ?? 0;
|
|
166733
166724
|
A.elevation = u;
|
|
166734
|
-
const d = r.get(
|
|
166725
|
+
const d = r.get(
|
|
166726
|
+
(p = (h = A.object) == null ? void 0 : h.building) == null ? void 0 : p.uuid
|
|
166727
|
+
);
|
|
166735
166728
|
if (d == null) {
|
|
166736
166729
|
const m = s.get((g = (f = A.object) == null ? void 0 : f.site) == null ? void 0 : g.uuid) ?? 0;
|
|
166737
166730
|
A.absoluteElevation = u + m;
|
|
@@ -166743,7 +166736,9 @@ async function mBi(t, e, i) {
|
|
|
166743
166736
|
});
|
|
166744
166737
|
}
|
|
166745
166738
|
async function CBi(t, e, i) {
|
|
166746
|
-
e.every(
|
|
166739
|
+
e.every(
|
|
166740
|
+
(n) => n.bimdata_elevation !== null && n.bimdata_elevation !== void 0
|
|
166741
|
+
) ? (e.forEach((n) => {
|
|
166747
166742
|
n.elevation = n.bimdata_elevation, n.absoluteElevation = n.bimdata_elevation;
|
|
166748
166743
|
}), e.forEach((n, s) => {
|
|
166749
166744
|
var r, o;
|
|
@@ -166936,6 +166931,10 @@ class wBi extends fq {
|
|
|
166936
166931
|
const d = a.get(u.uuid);
|
|
166937
166932
|
u.objects = d ? [...d.values()] : [];
|
|
166938
166933
|
}
|
|
166934
|
+
this.objects.forEach((u) => {
|
|
166935
|
+
var d, h;
|
|
166936
|
+
u.parent = this.uuids.get((d = u.parent) == null ? void 0 : d.uuid), u.children = (h = u.children) == null ? void 0 : h.map((p) => this.uuids.get(p.uuid)).filter(Boolean);
|
|
166937
|
+
});
|
|
166939
166938
|
}
|
|
166940
166939
|
setZones(e = []) {
|
|
166941
166940
|
this.zones.forEach((i) => {
|
|
@@ -166967,10 +166966,7 @@ const EBi = (t, e, i) => {
|
|
|
166967
166966
|
systems: c,
|
|
166968
166967
|
storeys: A
|
|
166969
166968
|
});
|
|
166970
|
-
return d.
|
|
166971
|
-
var p, f;
|
|
166972
|
-
h.parent = d.uuids.get((p = h.parent) == null ? void 0 : p.uuid), h.children = (f = h.children) == null ? void 0 : f.map((g) => d.uuids.get(g.uuid)).filter(Boolean);
|
|
166973
|
-
}), await CBi(n, d.storeys, d.id), t.set(r, d), d;
|
|
166969
|
+
return await CBi(n, d.storeys, d.id), t.set(r, d), d;
|
|
166974
166970
|
}
|
|
166975
166971
|
return {
|
|
166976
166972
|
get models() {
|
|
@@ -169380,7 +169376,7 @@ let EEi = class {
|
|
|
169380
169376
|
);
|
|
169381
169377
|
}
|
|
169382
169378
|
};
|
|
169383
|
-
const vEi = "@bimdata/viewer", bEi = "module", xEi = "2.6.0-beta.
|
|
169379
|
+
const vEi = "@bimdata/viewer", bEi = "module", xEi = "2.6.0-beta.15", SEi = "A customizable BIM viewer.", kEi = [
|
|
169384
169380
|
"bim",
|
|
169385
169381
|
"viewer",
|
|
169386
169382
|
"bimdata",
|