@giro3d/piero 1.0.0-beta.0 → 1.0.0-beta.1

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,58 +1,56 @@
1
- var K = Object.defineProperty;
2
- var X = (c, a, t) => a in c ? K(c, a, { enumerable: !0, configurable: !0, writable: !0, value: t }) : c[a] = t;
3
- var d = (c, a, t) => X(c, typeof a != "symbol" ? a + "" : a, t);
4
- import tt from "/builds/giro3d/piero/node_modules/@giro3d/giro3d/gui/EntityPanel.js";
5
- import { Components as et, SimpleScene as st, SimpleRenderer as ot, SimpleCamera as nt, SimpleRaycaster as it, IfcPropertiesUtils as b, FragmentBoundingBox as at, FragmentManager as rt, FragmentClassifier as ct, FragmentIfcLoader as lt, toCompositeID as ut, IfcCategoryMap as dt } from "/builds/giro3d/piero/node_modules/openbim-components/index.js";
6
- import { i as P, F as E, f as D, u as ht, e as mt, I as A, r as M, s as ft, _ as Y, j as pt, t as gt, y as U, h as yt } from "./Components.es.js";
7
- import V from "/builds/giro3d/piero/node_modules/@giro3d/giro3d/entities/Entity3D.js";
8
- import { Group as W, Vector3 as bt, MeshBasicMaterial as z, Matrix4 as wt, MathUtils as _t, MeshLambertMaterial as It, DoubleSide as Ct, Mesh as xt, Color as vt } from "/builds/giro3d/piero/node_modules/three";
9
- import St from "/builds/giro3d/piero/node_modules/@giro3d/giro3d/gui/EntityInspector.js";
10
- import { defineComponent as G, ref as Pt, resolveComponent as Et, createElementBlock as _, openBlock as y, createElementVNode as F, createCommentVNode as L, createBlock as Tt, createVNode as w, normalizeClass as R, toDisplayString as Ft, withCtx as j, unref as O, Fragment as $, renderList as q } from "/builds/giro3d/piero/node_modules/vue/dist/vue.runtime.esm-bundler.js";
11
- import { PLYLoader as kt } from "/builds/giro3d/piero/node_modules/three/examples/jsm/loaders/PLYLoader.js";
12
- import Bt from "/builds/giro3d/piero/node_modules/@giro3d/giro3d/entities/PointCloud.js";
13
- import Mt from "/builds/giro3d/piero/node_modules/@giro3d/giro3d/sources/PotreeSource.js";
14
- import g from "/builds/giro3d/piero/node_modules/shepherd.js/dist/js/shepherd.esm.js";
15
- const x = new wt(), Lt = {
16
- bbox: new z({
1
+ var dt = Object.defineProperty;
2
+ var ht = (p, i, t) => i in p ? dt(p, i, { enumerable: !0, configurable: !0, writable: !0, value: t }) : p[i] = t;
3
+ var w = (p, i, t) => ht(p, typeof i != "symbol" ? i + "" : i, t);
4
+ import pt from "@giro3d/giro3d/gui/EntityPanel";
5
+ import { Components as mt, SimpleScene as ft, SimpleRenderer as gt, SimpleCamera as yt, SimpleRaycaster as bt, IfcPropertiesUtils as M, FragmentBoundingBox as xt, FragmentManager as wt, FragmentClassifier as _t, FragmentIfcLoader as Ct, toCompositeID as It, IfcCategoryMap as vt } from "openbim-components";
6
+ import { j as O, G as tt, F as j, V as St, f as $, o as Z, M as Pt, i as Tt, u as Et, q as Bt, a3 as Q, a5 as G, a6 as Ft, _ as et, A as kt, a7 as Mt, ab as st, ac as Nt, ad as Lt, v as At, b as N, C as nt, ae as X, af as zt, z as Rt, n as Dt, h as Ot } from "./Components.es.js";
7
+ import ot from "@giro3d/giro3d/entities/Entity3D";
8
+ import jt from "@giro3d/giro3d/gui/EntityInspector";
9
+ import { defineComponent as it, ref as Vt, resolveComponent as Ut, createElementBlock as A, openBlock as k, createElementVNode as U, createCommentVNode as H, createBlock as Yt, createVNode as L, normalizeClass as J, toDisplayString as Gt, withCtx as K, unref as W, Fragment as at, renderList as rt } from "vue";
10
+ import Ht from "@giro3d/giro3d/entities/PointCloud";
11
+ import Wt from "@giro3d/giro3d/sources/PotreeSource";
12
+ import T from "shepherd.js";
13
+ const z = new Pt(), qt = {
14
+ bbox: new Z({
17
15
  color: "#FFFF00",
18
16
  depthTest: !0,
19
17
  opacity: 0.2,
20
18
  transparent: !0
21
19
  }),
22
- selection: new z({
20
+ selection: new Z({
23
21
  color: "#FF0000",
24
22
  depthTest: !1,
25
23
  opacity: 0.6,
26
24
  transparent: !0
27
25
  })
28
- }, Ot = 4186316022, Nt = 781010003, Dt = 2655215786, At = 3242617779, zt = 919958153, Rt = 1307041759, H = 1451395588, Q = 1883228015, jt = [H, Q], Yt = [
29
- Ot,
30
- Nt,
31
- Dt,
32
- At,
33
- zt,
34
- Rt
35
- ], J = (c) => P(c) && c.isIFCPickResult, v = class v extends V {
26
+ }, $t = 4186316022, Zt = 781010003, Qt = 2655215786, Xt = 3242617779, Jt = 919958153, Kt = 1307041759, ct = 1451395588, lt = 1883228015, te = [ct, lt], ee = [
27
+ $t,
28
+ Zt,
29
+ Qt,
30
+ Xt,
31
+ Jt,
32
+ Kt
33
+ ], ut = (p) => O(p) && p.isIFCPickResult, R = class R extends ot {
36
34
  constructor(t) {
37
- super(new W());
38
- d(this, "isIfcEntity", !0);
39
- d(this, "isPickableFeatures", !0);
40
- d(this, "type", "IfcEntity");
41
- d(this, "_classificationCache");
42
- d(this, "_components");
43
- d(this, "_fragmentBoundingBox");
44
- d(this, "_fragmentClassifier");
45
- d(this, "_fragmentManager");
46
- d(this, "_ifcSelection");
35
+ super(new tt());
36
+ w(this, "isIfcEntity", !0);
37
+ w(this, "isPickableFeatures", !0);
38
+ w(this, "type", "IfcEntity");
39
+ w(this, "_classificationCache");
40
+ w(this, "_components");
41
+ w(this, "_fragmentBoundingBox");
42
+ w(this, "_fragmentClassifier");
43
+ w(this, "_fragmentManager");
44
+ w(this, "_ifcSelection");
47
45
  // Currently selected fragments
48
- d(this, "_indexMap");
46
+ w(this, "_indexMap");
49
47
  // Properties relationships
50
- d(this, "_model");
51
- d(this, "_source");
52
- this._source = t, this._components = new et(), this._components.ui.enabled = !1, this._components.scene = new st(this._components), this._components.renderer = new ot(
48
+ w(this, "_model");
49
+ w(this, "_source");
50
+ this._source = t, this._components = new mt(), this._components.ui.enabled = !1, this._components.scene = new ft(this._components), this._components.renderer = new gt(
53
51
  this._components,
54
52
  document.createElement("div")
55
- ), this._components.camera = new nt(this._components), this._components.raycaster = new it(this._components), this._components.init(), this._ifcSelection = { bbox: {}, selection: {} }, this._indexMap = {}, this._classificationCache = null, this._fragmentBoundingBox = null;
53
+ ), this._components.camera = new yt(this._components), this._components.raycaster = new bt(this._components), this._components.init(), this._ifcSelection = { bbox: {}, selection: {} }, this._indexMap = {}, this._classificationCache = null, this._fragmentBoundingBox = null;
56
54
  }
57
55
  clearHighlight(t = "selection") {
58
56
  for (const e of Object.keys(this._ifcSelection[t])) {
@@ -71,12 +69,12 @@ const x = new wt(), Lt = {
71
69
  const o = this._ifcSelection.bbox;
72
70
  if (!Object.keys(o).length)
73
71
  return;
74
- for (const u of Object.keys(o)) {
75
- const f = s.list[u].fragments.bbox;
76
- e.addMesh(f.mesh);
72
+ for (const y of Object.keys(o)) {
73
+ const v = s.list[y].fragments.bbox;
74
+ e.addMesh(v.mesh);
77
75
  }
78
- const n = e.get(), { y: r, z: l } = n.min, { y: h, z: i } = n.max;
79
- return n.min.y = -i, n.max.y = -l, n.min.z = r, n.max.z = h, n.translate(this._model.position), this.clearHighlight("bbox"), n;
76
+ const n = e.get(), { y: d, z: m } = n.min, { y: x, z: a } = n.max;
77
+ return n.min.y = -a, n.max.y = -m, n.min.z = d, n.max.z = x, n.translate(this._model.position), this.clearHighlight("bbox"), n;
80
78
  }
81
79
  getClassification() {
82
80
  if (this._classificationCache === null)
@@ -91,37 +89,37 @@ const x = new wt(), Lt = {
91
89
  const n = s[o];
92
90
  if (n == null)
93
91
  continue;
94
- const { name: r } = b.getEntityName(s, o);
95
- if (r !== null) {
96
- if (n.type === H) {
97
- const l = b.getPsetProps(s, o);
98
- if (l !== null)
99
- for (const h of l) {
100
- if (s[h] == null)
92
+ const { name: d } = M.getEntityName(s, o);
93
+ if (d !== null) {
94
+ if (n.type === ct) {
95
+ const m = M.getPsetProps(s, o);
96
+ if (m !== null)
97
+ for (const x of m) {
98
+ if (s[x] == null)
101
99
  continue;
102
- const u = this.getProperty(h);
103
- u !== null && e.push({
104
- parentName: r,
105
- ...u
100
+ const y = this.getProperty(x);
101
+ y !== null && e.push({
102
+ parentName: d,
103
+ ...y
106
104
  });
107
105
  }
108
- } else if (n.type === Q) {
109
- const l = b.getQsetQuantities(
106
+ } else if (n.type === lt) {
107
+ const m = M.getQsetQuantities(
110
108
  s,
111
109
  o
112
110
  );
113
- if (l !== null)
114
- for (const h of l) {
115
- const { key: i } = b.getQuantityValue(
111
+ if (m !== null)
112
+ for (const x of m) {
113
+ const { key: a } = M.getQuantityValue(
116
114
  s,
117
- h
115
+ x
118
116
  );
119
- if (i === null)
117
+ if (a === null)
120
118
  continue;
121
- const u = this.getProperty(h);
122
- u !== null && e.push({
123
- parentName: r,
124
- ...u
119
+ const y = this.getProperty(x);
120
+ y !== null && e.push({
121
+ parentName: d,
122
+ ...y
125
123
  });
126
124
  }
127
125
  }
@@ -133,10 +131,10 @@ const x = new wt(), Lt = {
133
131
  const e = this._model.properties;
134
132
  if (e === void 0)
135
133
  return null;
136
- const { name: s } = b.getEntityName(e, t);
134
+ const { name: s } = M.getEntityName(e, t);
137
135
  if (s === null)
138
136
  return null;
139
- const { value: o } = b.getQuantityValue(e, t);
137
+ const { value: o } = M.getQuantityValue(e, t);
140
138
  return { name: s, value: o };
141
139
  }
142
140
  highlight(t, e, s) {
@@ -145,10 +143,10 @@ const x = new wt(), Lt = {
145
143
  this._ifcSelection[t][e.uuid].add(s), this.addComposites(t, e, o), this.regenerate(t, e.uuid);
146
144
  const n = e.fragment.group;
147
145
  if (n) {
148
- const r = n.data[o][0];
149
- for (let l = 0; l < r.length; l++) {
150
- const h = r[l], i = n.keyFragments[h], u = this._fragmentManager.list[i];
151
- i in this._ifcSelection[t] || (this._ifcSelection[t][i] = /* @__PURE__ */ new Set()), this._ifcSelection[t][i].add(s), this.addComposites(t, u.mesh, o), this.regenerate(t, i);
146
+ const d = n.data[o][0];
147
+ for (let m = 0; m < d.length; m++) {
148
+ const x = d[m], a = n.keyFragments[x], y = this._fragmentManager.list[a];
149
+ a in this._ifcSelection[t] || (this._ifcSelection[t][a] = /* @__PURE__ */ new Set()), this._ifcSelection[t][a].add(s), this.addComposites(t, y.mesh, o), this.regenerate(t, a);
152
150
  }
153
151
  }
154
152
  this.notifyChange(this);
@@ -157,10 +155,10 @@ const x = new wt(), Lt = {
157
155
  for (const s of Object.keys(t)) {
158
156
  s in this._ifcSelection[e] || (this._ifcSelection[e][s] = /* @__PURE__ */ new Set());
159
157
  const o = this._fragmentManager.list[s], n = /* @__PURE__ */ new Set();
160
- for (const r of t[s])
161
- this._ifcSelection[e][s].add(r), n.add(parseInt(r, 10));
162
- for (const r of n)
163
- this.addComposites(e, o.mesh, r);
158
+ for (const d of t[s])
159
+ this._ifcSelection[e][s].add(d), n.add(parseInt(d, 10));
160
+ for (const d of n)
161
+ this.addComposites(e, o.mesh, d);
164
162
  this.regenerate(e, s);
165
163
  }
166
164
  this.notifyChange(this);
@@ -178,10 +176,10 @@ const x = new wt(), Lt = {
178
176
  var s, o, n;
179
177
  const e = t.object;
180
178
  if (e.fragment != null && t.instanceId != null && t.face) {
181
- const r = e.fragment.getVertexBlockID(e.geometry, t.face.a), l = (s = e.fragment.getItemID(t.instanceId, r)) == null ? void 0 : s.replace(/\..*/, "");
182
- if (l && ((n = (o = e.fragment.group) == null ? void 0 : o.properties) == null ? void 0 : n[l]) != null) {
183
- const i = e.fragment.group.properties[l], m = [{ ifcProperties: this.getProperties(l), itemProperties: i }];
184
- return t.features = m, m;
179
+ const d = e.fragment.getVertexBlockID(e.geometry, t.face.a), m = (s = e.fragment.getItemID(t.instanceId, d)) == null ? void 0 : s.replace(/\..*/, "");
180
+ if (m && ((n = (o = e.fragment.group) == null ? void 0 : o.properties) == null ? void 0 : n[m]) != null) {
181
+ const a = e.fragment.group.properties[m], C = [{ ifcProperties: this.getProperties(m), itemProperties: a }];
182
+ return t.features = C, C;
185
183
  }
186
184
  }
187
185
  return [];
@@ -194,41 +192,41 @@ const x = new wt(), Lt = {
194
192
  ]), this._classificationCache.length === 0 && (this._classificationCache = await this.regenerateClassification([
195
193
  "entities"
196
194
  /* ENTITY */
197
- ])), this._fragmentBoundingBox = await this._components.tools.get(at);
195
+ ])), this._fragmentBoundingBox = await this._components.tools.get(xt);
198
196
  }
199
197
  async preprocess() {
200
- const t = await E.fetchArrayBuffer(this._source.url);
201
- this._fragmentManager = await this._components.tools.get(rt), this._fragmentClassifier = await this._components.tools.get(ct);
202
- const e = new lt(this._components);
198
+ const t = await j.fetchArrayBuffer(this._source.url);
199
+ this._fragmentManager = await this._components.tools.get(wt), this._fragmentClassifier = await this._components.tools.get(_t);
200
+ const e = new Ct(this._components);
203
201
  e.settings.webIfc.COORDINATE_TO_ORIGIN = !0, e.settings.webIfc.OPTIMIZE_PROFILES = !0;
204
202
  const s = new Uint8Array(t);
205
203
  this._model = await e.load(s, this._source.name), this._model.rotateX(Math.PI / 2);
206
- const o = new bt();
204
+ const o = new St();
207
205
  if (this._source.at)
208
206
  this._source.at.toVector3(o), this._model.position.copy(o);
209
207
  else {
210
- const r = this._model.coordinationMatrix.clone().invert();
211
- o.applyMatrix4(r), this._model.position.set(o.x, -o.z, o.y);
208
+ const d = this._model.coordinationMatrix.clone().invert();
209
+ o.applyMatrix4(d), this._model.position.set(o.x, -o.z, o.y);
212
210
  }
213
211
  this._model.updateWorldMatrix(!0, !0), this._model.updateMatrix(), this._model.updateMatrixWorld(!0), this.initializeEntityIndexes(), this._fragmentClassifier.byStorey(this._model), this._fragmentClassifier.byEntity(this._model), await this.initClassification(), this.object3d.add(this._model), this.onObjectCreated(this._model);
214
- const n = E.getContext(this._source.url);
215
- D(this, { filename: n.filename }), this.notifyChange(this.object3d);
212
+ const n = j.getContext(this._source.url);
213
+ $(this, { filename: n.filename }), this.notifyChange(this.object3d);
216
214
  }
217
215
  addComposites(t, e, s) {
218
216
  this.addHighlightToFragment(t, e.fragment);
219
217
  const o = e.fragment.composites[s];
220
218
  if (o)
221
219
  for (let n = 1; n < o; n++) {
222
- const r = ut(s, n);
223
- this._ifcSelection[t][e.uuid].add(r);
220
+ const d = It(s, n);
221
+ this._ifcSelection[t][e.uuid].add(d);
224
222
  }
225
223
  }
226
224
  addHighlightToFragment(t, e) {
227
225
  if (!(t in e.fragments)) {
228
- const s = e.addFragment(t, [Lt[t]]);
226
+ const s = e.addFragment(t, [qt[t]]);
229
227
  e.blocks.count > 1 && (s.setInstance(0, {
230
228
  ids: Array.from(e.ids),
231
- transform: x
229
+ transform: z
232
230
  }), s.blocks.setVisibility(!1)), this._model.add(s.mesh), s.mesh.renderOrder = 30, s.mesh.frustumCulled = !1, s.mesh.name = t, s.mesh.updateMatrixWorld(!0);
233
231
  }
234
232
  }
@@ -236,29 +234,29 @@ const x = new wt(), Lt = {
236
234
  this._indexMap = {};
237
235
  const t = this._model.properties;
238
236
  if (t !== void 0)
239
- for (const e of Yt)
240
- b.getRelationMap(t, e, (s, o) => {
237
+ for (const e of ee)
238
+ M.getRelationMap(t, e, (s, o) => {
241
239
  const n = t[s];
242
- jt.includes(n.type) || this.setEntityIndex(s);
243
- for (const r of o)
244
- this.setEntityIndex(r).add(s);
240
+ te.includes(n.type) || this.setEntityIndex(s);
241
+ for (const d of o)
242
+ this.setEntityIndex(d).add(s);
245
243
  });
246
244
  }
247
245
  regenerate(t, e) {
248
246
  this.updateFragmentFill(t, e);
249
247
  }
250
248
  async regenerateClassification(t, e = {}) {
251
- const s = this._fragmentClassifier.get(), o = [], n = t[0], r = s[n];
252
- if (n == null || r == null)
249
+ const s = this._fragmentClassifier.get(), o = [], n = t[0], d = s[n];
250
+ if (n == null || d == null)
253
251
  return o;
254
- for (const l of Object.keys(r)) {
255
- const h = { ...e, [n]: [l] }, i = await this._fragmentClassifier.find(h);
256
- if (Object.keys(i).length > 0) {
257
- const f = n[0].toUpperCase() + n.slice(1), p = await this.regenerateClassification(
252
+ for (const m of Object.keys(d)) {
253
+ const x = { ...e, [n]: [m] }, a = await this._fragmentClassifier.find(x);
254
+ if (Object.keys(a).length > 0) {
255
+ const v = n[0].toUpperCase() + n.slice(1), I = await this.regenerateClassification(
258
256
  t.slice(1),
259
- h
257
+ x
260
258
  );
261
- o.push({ children: p, fragments: i, name: l, treeItemName: f });
259
+ o.push({ children: I, fragments: a, name: m, treeItemName: v });
262
260
  }
263
261
  }
264
262
  return o;
@@ -273,209 +271,497 @@ const x = new wt(), Lt = {
273
271
  const n = o.fragments[t];
274
272
  if (n == null)
275
273
  return;
276
- const r = o.mesh.parent;
277
- if (r == null)
274
+ const d = o.mesh.parent;
275
+ if (d == null)
278
276
  return;
279
- if (r.add(n.mesh), n.blocks.count > 1)
280
- o.getInstance(0, x), n.setInstance(0, {
277
+ if (d.add(n.mesh), n.blocks.count > 1)
278
+ o.getInstance(0, z), n.setInstance(0, {
281
279
  ids: Array.from(o.ids),
282
- transform: x
280
+ transform: z
283
281
  }), n.blocks.setVisibility(!0, s, !0);
284
282
  else {
285
- let h = 0;
286
- for (const i of s) {
287
- n.mesh.count = h + 1;
288
- const { instanceID: u } = o.getInstanceAndBlockID(i);
289
- o.getInstance(u, x), n.setInstance(h, { ids: [i], transform: x }), h++;
283
+ let x = 0;
284
+ for (const a of s) {
285
+ n.mesh.count = x + 1;
286
+ const { instanceID: y } = o.getInstanceAndBlockID(a);
287
+ o.getInstance(y, z), n.setInstance(x, { ids: [a], transform: z }), x++;
290
288
  }
291
289
  }
292
290
  }
293
291
  };
294
- d(v, "isIFCEntity", (t) => P(t) && t.isIfcEntity), d(v, "isIFCPickResult", (t) => P(t) && v.isIFCEntity(t.entity));
295
- let N = v;
296
- class Ut extends St {
297
- constructor(a, t, e) {
298
- super(a, t, e, { visibility: !0 });
292
+ w(R, "isIFCEntity", (t) => O(t) && t.isIfcEntity), w(R, "isIFCPickResult", (t) => O(t) && R.isIFCEntity(t.entity));
293
+ let q = R;
294
+ class se extends jt {
295
+ constructor(i, t, e) {
296
+ super(i, t, e, { visibility: !0 });
299
297
  }
300
298
  }
301
- const Vt = { class: "d-flex" }, Wt = ["title"], Gt = ["id"], $t = { class: "list-unstyled border-start" }, qt = /* @__PURE__ */ G({
299
+ const ne = { class: "d-flex" }, oe = ["title"], ie = ["id"], ae = { class: "list-unstyled border-start" }, re = /* @__PURE__ */ it({
302
300
  __name: "IfcSubtree",
303
301
  props: {
304
302
  classificationElement: {},
305
303
  ifcEntity: {}
306
304
  },
307
- setup(c) {
308
- const a = c, t = _t.generateUUID(), e = `#${t}`, s = Pt(!1), o = ht(), n = mt();
309
- function r() {
310
- const i = a.ifcEntity.getBoundingBoxById(a.classificationElement.fragments);
311
- i && !i.isEmpty() && (n.setClippingBox(i), n.enableClippingBox(!0));
305
+ setup(p) {
306
+ const i = p, t = Tt.generateUUID(), e = `#${t}`, s = Vt(!1), o = Et(), n = Bt();
307
+ function d() {
308
+ const a = i.ifcEntity.getBoundingBoxById(i.classificationElement.fragments);
309
+ a && !a.isEmpty() && (n.setClippingBox(a), n.enableClippingBox(!0));
312
310
  }
313
- function l() {
314
- s.value = !0, a.ifcEntity.clearHighlight(), a.ifcEntity.highlightById(a.classificationElement.fragments), setTimeout(() => s.value = !1, 2e3);
311
+ function m() {
312
+ s.value = !0, i.ifcEntity.clearHighlight(), i.ifcEntity.highlightById(i.classificationElement.fragments), setTimeout(() => s.value = !1, 2e3);
315
313
  }
316
- function h() {
317
- const i = a.ifcEntity.getBoundingBoxById(a.classificationElement.fragments);
318
- i && !i.isEmpty() && o.lookTopDownAt(i);
314
+ function x() {
315
+ const a = i.ifcEntity.getBoundingBoxById(i.classificationElement.fragments);
316
+ a && !a.isEmpty() && o.lookTopDownAt(a);
319
317
  }
320
- return (i, u) => {
321
- const m = Et("IfcSubtree", !0);
322
- return y(), _("div", null, [
323
- F("div", Vt, [
324
- F("span", {
325
- class: R([
318
+ return (a, y) => {
319
+ const C = Ut("IfcSubtree", !0);
320
+ return k(), A("div", null, [
321
+ U("div", ne, [
322
+ U("span", {
323
+ class: J([
326
324
  "border rounded px-1 py-0 fw-normal",
327
325
  s.value ? "text-danger border-danger" : "text-secondary border-secondary"
328
326
  ]),
329
- title: i.classificationElement.treeItemName
330
- }, Ft(i.classificationElement.treeItemName), 11, Wt),
331
- i.classificationElement.children.length > 0 ? (y(), Tt(A, { key: 0 }, {
332
- default: j(() => [
333
- w(M, {
327
+ title: a.classificationElement.treeItemName
328
+ }, Gt(a.classificationElement.treeItemName), 11, oe),
329
+ a.classificationElement.children.length > 0 ? (k(), Yt(Q, { key: 0 }, {
330
+ default: K(() => [
331
+ L(G, {
334
332
  title: "Expand group",
335
333
  icon: "bi-chevron-down",
336
334
  "data-bs-toggle": "collapse",
337
335
  "data-bs-target": e,
338
- "aria-controls": O(t),
336
+ "aria-controls": W(t),
339
337
  "aria-expanded": "true"
340
338
  }, null, 8, ["aria-controls"])
341
339
  ]),
342
340
  _: 1
343
- })) : L("", !0),
344
- w(ft, {
345
- class: R(["label", s.value ? "text-danger-emphasis" : "text-muted"]),
346
- text: i.classificationElement.name,
347
- title: `Zoom to ${i.classificationElement.name}`,
348
- onClick: h
341
+ })) : H("", !0),
342
+ L(Ft, {
343
+ class: J(["label", s.value ? "text-danger-emphasis" : "text-muted"]),
344
+ text: a.classificationElement.name,
345
+ title: `Zoom to ${a.classificationElement.name}`,
346
+ onClick: x
349
347
  }, null, 8, ["class", "text", "title"]),
350
- w(A, { class: "ms-1" }, {
351
- default: j(() => [
352
- w(M, {
348
+ L(Q, { class: "ms-1" }, {
349
+ default: K(() => [
350
+ L(G, {
353
351
  title: "Highlight",
354
352
  icon: "bi-highlighter",
355
- onClick: l
353
+ onClick: m
356
354
  }),
357
- w(M, {
355
+ L(G, {
358
356
  title: "Clip to",
359
357
  icon: "bi-bounding-box",
360
- onClick: r
358
+ onClick: d
361
359
  })
362
360
  ]),
363
361
  _: 1
364
362
  })
365
363
  ]),
366
- i.classificationElement.children.length > 0 ? (y(), _("div", {
364
+ a.classificationElement.children.length > 0 ? (k(), A("div", {
367
365
  key: 0,
368
- id: O(t),
366
+ id: W(t),
369
367
  class: "collapse show"
370
368
  }, [
371
- F("ul", $t, [
372
- (y(!0), _($, null, q(i.classificationElement.children, (f, p) => (y(), _("li", { key: p }, [
373
- w(m, {
374
- "ifc-entity": a.ifcEntity,
375
- "classification-element": f
369
+ U("ul", ae, [
370
+ (k(!0), A(at, null, rt(a.classificationElement.children, (v, I) => (k(), A("li", { key: I }, [
371
+ L(C, {
372
+ "ifc-entity": i.ifcEntity,
373
+ "classification-element": v
376
374
  }, null, 8, ["ifc-entity", "classification-element"])
377
375
  ]))), 128))
378
376
  ])
379
- ], 8, Gt)) : L("", !0)
377
+ ], 8, ie)) : H("", !0)
380
378
  ]);
381
379
  };
382
380
  }
383
- }), Ht = /* @__PURE__ */ Y(qt, [["__scopeId", "data-v-c2ab888d"]]), Qt = { key: 0 }, Jt = /* @__PURE__ */ G({
381
+ }), ce = /* @__PURE__ */ et(re, [["__scopeId", "data-v-c2ab888d"]]), le = { key: 0 }, ue = /* @__PURE__ */ it({
384
382
  __name: "IfcPropertyView",
385
383
  props: {
386
384
  dataset: {}
387
385
  },
388
- setup(c) {
389
- const a = pt(), t = c, e = gt(t.dataset, "isPreloaded");
386
+ setup(p) {
387
+ const i = kt(), t = p, e = Mt(t.dataset, "isPreloaded");
390
388
  function s() {
391
389
  const n = o();
392
390
  return n == null ? null : n.getClassification();
393
391
  }
394
392
  function o() {
395
- const n = a.getEntity(t.dataset);
393
+ const n = i.getEntity(t.dataset);
396
394
  return n ?? null;
397
395
  }
398
- return (n, r) => O(e) ? (y(), _("div", Qt, [
399
- F("ul", null, [
400
- (y(!0), _($, null, q(s(), (l, h) => (y(), _("li", { key: h }, [
401
- w(Ht, {
396
+ return (n, d) => W(e) ? (k(), A("div", le, [
397
+ U("ul", null, [
398
+ (k(!0), A(at, null, rt(s(), (m, x) => (k(), A("li", { key: x }, [
399
+ L(ce, {
402
400
  "ifc-entity": o(),
403
- "classification-element": l
401
+ "classification-element": m
404
402
  }, null, 8, ["ifc-entity", "classification-element"])
405
403
  ]))), 128))
406
404
  ])
407
- ])) : L("", !0);
408
- }
409
- }), Zt = /* @__PURE__ */ Y(Jt, [["__scopeId", "data-v-d2d82ae7"]]), Kt = (c) => {
410
- if (J(c)) {
411
- const a = c.object;
412
- if (a.fragment != null && c.face && c.instanceId != null) {
413
- const t = a.fragment.getVertexBlockID(a.geometry, c.face.a), e = a.fragment.getItemID(c.instanceId, t).replace(/\..*/, "");
414
- return c.entity.highlight("selection", a, e), () => c.entity.clearHighlight();
405
+ ])) : H("", !0);
406
+ }
407
+ }), de = /* @__PURE__ */ et(ue, [["__scopeId", "data-v-d2d82ae7"]]), he = (p) => {
408
+ if (ut(p)) {
409
+ const i = p.object;
410
+ if (i.fragment != null && p.face && p.instanceId != null) {
411
+ const t = i.fragment.getVertexBlockID(i.geometry, p.face.a), e = i.fragment.getItemID(p.instanceId, t).replace(/\..*/, "");
412
+ return p.entity.highlight("selection", i, e), () => p.entity.clearHighlight();
415
413
  }
416
414
  }
417
415
  return null;
418
- }, Xt = (c) => ({
419
- name: c.filename,
416
+ }, pe = (p) => ({
417
+ name: p.filename,
420
418
  source: {
421
- url: c.file
419
+ url: p.file
422
420
  },
423
421
  type: "ifc",
424
422
  visible: !0
425
- }), te = (c, a) => {
426
- var l, h, i, u, m, f, p, I, C;
427
- if (!J(c))
423
+ }), me = (p, i) => {
424
+ var m, x, a, y, C, v, I, B, r;
425
+ if (!ut(p))
428
426
  return;
429
- const t = (l = c.features) == null ? void 0 : l.at(0);
427
+ const t = (m = p.features) == null ? void 0 : m.at(0);
430
428
  if (!t)
431
429
  return;
432
- a.has("IFC") || a.set("IFC", []);
433
- const e = a.get("IFC"), { ifcProperties: s, itemProperties: o } = t, n = "NULL", r = ((h = o.Name) == null ? void 0 : h.value) ?? n;
430
+ i.has("IFC") || i.set("IFC", []);
431
+ const e = i.get("IFC"), { ifcProperties: s, itemProperties: o } = t, n = "NULL", d = ((x = o.Name) == null ? void 0 : x.value) ?? n;
434
432
  e.push({
435
433
  key: "Site",
436
- value: ((u = (i = c.entity.object3d.userData) == null ? void 0 : i.dataset) == null ? void 0 : u.name) ?? n
434
+ value: ((y = (a = p.entity.object3d.userData) == null ? void 0 : a.dataset) == null ? void 0 : y.name) ?? n
437
435
  }), e.push({
438
436
  key: "IFCType",
439
- value: dt[o.type] ?? n
440
- }), e.push({ key: "Name", value: r }), e.push({ key: "ID", value: o.expressID }), e.push({ key: "GlobalId", value: ((m = o.GlobalId) == null ? void 0 : m.value) ?? n }), ((f = o.Description) == null ? void 0 : f.value) != null && e.push({ key: "Description", value: o.Description.value }), ((p = o.PredefinedType) == null ? void 0 : p.value) != null && e.push({ key: "PredefinedType", value: o.PredefinedType.value }), ((I = o.ObjectType) == null ? void 0 : I.value) != null && e.push({ key: "ObjectType", value: o.ObjectType.value });
441
- for (const { name: T, parentName: B, value: Z } of s)
442
- a.has(B) || a.set(B, []), (C = a.get(B)) == null || C.push({ key: T, value: Z });
443
- }, ee = (c) => {
444
- const a = c.dataset, t = a.config, e = U(t.source.position ?? a.get("position")), s = new N({
437
+ value: vt[o.type] ?? n
438
+ }), e.push({ key: "Name", value: d }), e.push({ key: "ID", value: o.expressID }), e.push({ key: "GlobalId", value: ((C = o.GlobalId) == null ? void 0 : C.value) ?? n }), ((v = o.Description) == null ? void 0 : v.value) != null && e.push({ key: "Description", value: o.Description.value }), ((I = o.PredefinedType) == null ? void 0 : I.value) != null && e.push({ key: "PredefinedType", value: o.PredefinedType.value }), ((B = o.ObjectType) == null ? void 0 : B.value) != null && e.push({ key: "ObjectType", value: o.ObjectType.value });
439
+ for (const { name: u, parentName: l, value: c } of s)
440
+ i.has(l) || i.set(l, []), (r = i.get(l)) == null || r.push({ key: u, value: c });
441
+ }, fe = (p) => {
442
+ const i = p.dataset, t = i.config, e = st(t.source.position ?? i.get("position")), s = new q({
445
443
  ...t.source,
446
444
  at: e,
447
- name: a.name
445
+ name: i.name
448
446
  });
449
447
  return Promise.resolve(s);
450
448
  };
451
- class be {
449
+ class Me {
452
450
  constructor() {
453
- d(this, "name", "IFC");
451
+ w(this, "name", "IFC");
454
452
  }
455
- async initialize(a) {
456
- a.datasets.registerDatasetType("ifc", {
457
- attributeExtractor: te,
458
- entityBuilder: ee,
453
+ async initialize(i) {
454
+ i.datasets.registerDatasetType("ifc", {
455
+ attributeExtractor: me,
456
+ entityBuilder: fe,
459
457
  fileExtensions: ["ifc"],
460
- highlight: Kt,
458
+ highlight: he,
461
459
  icon: "bi-building",
462
- loader: Xt,
460
+ loader: pe,
463
461
  name: "IFC",
464
- propertyView: Zt
465
- }), tt.registerInspector("IfcEntity", Ut), await E.fetch("web-ifc.wasm").catch((t) => {
462
+ propertyView: de
463
+ }), pt.registerInspector("IfcEntity", se), await j.fetch("web-ifc.wasm").catch((t) => {
466
464
  console.warn("Could not load web-ifc.wasm", t);
467
465
  });
468
466
  }
469
467
  }
470
- const S = class S extends xt {
468
+ const E = new nt();
469
+ let ge = class extends Nt {
470
+ constructor(i) {
471
+ super(i), this.propertyNameMapping = {}, this.customPropertyMapping = {};
472
+ }
473
+ load(i, t, e, s) {
474
+ const o = this, n = new Lt(this.manager);
475
+ n.setPath(this.path), n.setResponseType("arraybuffer"), n.setRequestHeader(this.requestHeader), n.setWithCredentials(this.withCredentials), n.load(i, function(d) {
476
+ try {
477
+ t(o.parse(d));
478
+ } catch (m) {
479
+ s ? s(m) : console.error(m), o.manager.itemError(i);
480
+ }
481
+ }, e, s);
482
+ }
483
+ setPropertyNameMapping(i) {
484
+ this.propertyNameMapping = i;
485
+ }
486
+ setCustomPropertyNameMapping(i) {
487
+ this.customPropertyMapping = i;
488
+ }
489
+ parse(i) {
490
+ function t(r, u = 0) {
491
+ const l = /^ply([\s\S]*)end_header(\r\n|\r|\n)/;
492
+ let c = "";
493
+ const h = l.exec(r);
494
+ h !== null && (c = h[1]);
495
+ const f = {
496
+ comments: [],
497
+ elements: [],
498
+ headerLength: u,
499
+ objInfo: ""
500
+ }, b = c.split(/\r\n|\r|\n/);
501
+ let g;
502
+ function F(S, P) {
503
+ const _ = { type: S[0] };
504
+ return _.type === "list" ? (_.name = S[3], _.countType = S[1], _.itemType = S[2]) : _.name = S[1], _.name in P && (_.name = P[_.name]), _;
505
+ }
506
+ for (let S = 0; S < b.length; S++) {
507
+ let P = b[S];
508
+ if (P = P.trim(), P === "") continue;
509
+ const _ = P.split(/\s+/), V = _.shift();
510
+ switch (P = _.join(" "), V) {
511
+ case "format":
512
+ f.format = _[0], f.version = _[1];
513
+ break;
514
+ case "comment":
515
+ f.comments.push(P);
516
+ break;
517
+ case "element":
518
+ g !== void 0 && f.elements.push(g), g = {}, g.name = _[0], g.count = parseInt(_[1]), g.properties = [];
519
+ break;
520
+ case "property":
521
+ g.properties.push(F(_, B.propertyNameMapping));
522
+ break;
523
+ case "obj_info":
524
+ f.objInfo = P;
525
+ break;
526
+ default:
527
+ console.log("unhandled", V, _);
528
+ }
529
+ }
530
+ return g !== void 0 && f.elements.push(g), f;
531
+ }
532
+ function e(r, u) {
533
+ switch (u) {
534
+ case "char":
535
+ case "uchar":
536
+ case "short":
537
+ case "ushort":
538
+ case "int":
539
+ case "uint":
540
+ case "int8":
541
+ case "uint8":
542
+ case "int16":
543
+ case "uint16":
544
+ case "int32":
545
+ case "uint32":
546
+ return parseInt(r);
547
+ case "float":
548
+ case "double":
549
+ case "float32":
550
+ case "float64":
551
+ return parseFloat(r);
552
+ }
553
+ }
554
+ function s(r, u) {
555
+ const l = {};
556
+ for (let c = 0; c < r.length; c++) {
557
+ if (u.empty()) return null;
558
+ if (r[c].type === "list") {
559
+ const h = [], f = e(u.next(), r[c].countType);
560
+ for (let b = 0; b < f; b++) {
561
+ if (u.empty()) return null;
562
+ h.push(e(u.next(), r[c].itemType));
563
+ }
564
+ l[r[c].name] = h;
565
+ } else
566
+ l[r[c].name] = e(u.next(), r[c].type);
567
+ }
568
+ return l;
569
+ }
570
+ function o() {
571
+ const r = {
572
+ indices: [],
573
+ vertices: [],
574
+ normals: [],
575
+ uvs: [],
576
+ faceVertexUvs: [],
577
+ colors: [],
578
+ faceVertexColors: []
579
+ };
580
+ for (const u of Object.keys(B.customPropertyMapping))
581
+ r[u] = [];
582
+ return r;
583
+ }
584
+ function n(r) {
585
+ const u = r.map((c) => c.name);
586
+ function l(c) {
587
+ for (let h = 0, f = c.length; h < f; h++) {
588
+ const b = c[h];
589
+ if (u.includes(b)) return b;
590
+ }
591
+ return null;
592
+ }
593
+ return {
594
+ attrX: l(["x", "px", "posx"]) || "x",
595
+ attrY: l(["y", "py", "posy"]) || "y",
596
+ attrZ: l(["z", "pz", "posz"]) || "z",
597
+ attrNX: l(["nx", "normalx"]),
598
+ attrNY: l(["ny", "normaly"]),
599
+ attrNZ: l(["nz", "normalz"]),
600
+ attrS: l(["s", "u", "texture_u", "tx"]),
601
+ attrT: l(["t", "v", "texture_v", "ty"]),
602
+ attrR: l(["red", "diffuse_red", "r", "diffuse_r"]),
603
+ attrG: l(["green", "diffuse_green", "g", "diffuse_g"]),
604
+ attrB: l(["blue", "diffuse_blue", "b", "diffuse_b"])
605
+ };
606
+ }
607
+ function d(r, u) {
608
+ const l = o(), c = /end_header\s+(\S[\s\S]*\S|\S)\s*$/;
609
+ let h, f;
610
+ (f = c.exec(r)) !== null ? h = f[1].split(/\s+/) : h = [];
611
+ const b = new ye(h);
612
+ t: for (let g = 0; g < u.elements.length; g++) {
613
+ const F = u.elements[g], S = n(F.properties);
614
+ for (let P = 0; P < F.count; P++) {
615
+ const _ = s(F.properties, b);
616
+ if (!_) break t;
617
+ x(l, F.name, _, S);
618
+ }
619
+ }
620
+ return m(l);
621
+ }
622
+ function m(r) {
623
+ let u = new At();
624
+ r.indices.length > 0 && u.setIndex(r.indices), u.setAttribute("position", new N(r.vertices, 3)), r.normals.length > 0 && u.setAttribute("normal", new N(r.normals, 3)), r.uvs.length > 0 && u.setAttribute("uv", new N(r.uvs, 2)), r.colors.length > 0 && u.setAttribute("color", new N(r.colors, 3)), (r.faceVertexUvs.length > 0 || r.faceVertexColors.length > 0) && (u = u.toNonIndexed(), r.faceVertexUvs.length > 0 && u.setAttribute("uv", new N(r.faceVertexUvs, 2)), r.faceVertexColors.length > 0 && u.setAttribute("color", new N(r.faceVertexColors, 3)));
625
+ for (const l of Object.keys(B.customPropertyMapping))
626
+ r[l].length > 0 && u.setAttribute(
627
+ l,
628
+ new N(
629
+ r[l],
630
+ B.customPropertyMapping[l].length
631
+ )
632
+ );
633
+ return u.computeBoundingSphere(), u;
634
+ }
635
+ function x(r, u, l, c) {
636
+ if (u === "vertex") {
637
+ r.vertices.push(l[c.attrX], l[c.attrY], l[c.attrZ]), c.attrNX !== null && c.attrNY !== null && c.attrNZ !== null && r.normals.push(l[c.attrNX], l[c.attrNY], l[c.attrNZ]), c.attrS !== null && c.attrT !== null && r.uvs.push(l[c.attrS], l[c.attrT]), c.attrR !== null && c.attrG !== null && c.attrB !== null && (E.setRGB(
638
+ l[c.attrR] / 255,
639
+ l[c.attrG] / 255,
640
+ l[c.attrB] / 255,
641
+ X
642
+ ), r.colors.push(E.r, E.g, E.b));
643
+ for (const h of Object.keys(B.customPropertyMapping))
644
+ for (const f of B.customPropertyMapping[h])
645
+ r[h].push(l[f]);
646
+ } else if (u === "face") {
647
+ const h = l.vertex_indices || l.vertex_index, f = l.texcoord;
648
+ h.length === 3 ? (r.indices.push(h[0], h[1], h[2]), f && f.length === 6 && (r.faceVertexUvs.push(f[0], f[1]), r.faceVertexUvs.push(f[2], f[3]), r.faceVertexUvs.push(f[4], f[5]))) : h.length === 4 && (r.indices.push(h[0], h[1], h[3]), r.indices.push(h[1], h[2], h[3])), c.attrR !== null && c.attrG !== null && c.attrB !== null && (E.setRGB(
649
+ l[c.attrR] / 255,
650
+ l[c.attrG] / 255,
651
+ l[c.attrB] / 255,
652
+ X
653
+ ), r.faceVertexColors.push(E.r, E.g, E.b), r.faceVertexColors.push(E.r, E.g, E.b), r.faceVertexColors.push(E.r, E.g, E.b));
654
+ }
655
+ }
656
+ function a(r, u) {
657
+ const l = {};
658
+ let c = 0;
659
+ for (let h = 0; h < u.length; h++) {
660
+ const f = u[h], b = f.valueReader;
661
+ if (f.type === "list") {
662
+ const g = [], F = f.countReader.read(r + c);
663
+ c += f.countReader.size;
664
+ for (let S = 0; S < F; S++)
665
+ g.push(b.read(r + c)), c += b.size;
666
+ l[f.name] = g;
667
+ } else
668
+ l[f.name] = b.read(r + c), c += b.size;
669
+ }
670
+ return [l, c];
671
+ }
672
+ function y(r, u, l) {
673
+ function c(h, f, b) {
674
+ switch (f) {
675
+ // corespondences for non-specific length types here match rply:
676
+ case "int8":
677
+ case "char":
678
+ return { read: (g) => h.getInt8(g), size: 1 };
679
+ case "uint8":
680
+ case "uchar":
681
+ return { read: (g) => h.getUint8(g), size: 1 };
682
+ case "int16":
683
+ case "short":
684
+ return { read: (g) => h.getInt16(g, b), size: 2 };
685
+ case "uint16":
686
+ case "ushort":
687
+ return { read: (g) => h.getUint16(g, b), size: 2 };
688
+ case "int32":
689
+ case "int":
690
+ return { read: (g) => h.getInt32(g, b), size: 4 };
691
+ case "uint32":
692
+ case "uint":
693
+ return { read: (g) => h.getUint32(g, b), size: 4 };
694
+ case "float32":
695
+ case "float":
696
+ return { read: (g) => h.getFloat32(g, b), size: 4 };
697
+ case "float64":
698
+ case "double":
699
+ return { read: (g) => h.getFloat64(g, b), size: 8 };
700
+ }
701
+ }
702
+ for (let h = 0, f = r.length; h < f; h++) {
703
+ const b = r[h];
704
+ b.type === "list" ? (b.countReader = c(u, b.countType, l), b.valueReader = c(u, b.itemType, l)) : b.valueReader = c(u, b.type, l);
705
+ }
706
+ }
707
+ function C(r, u) {
708
+ const l = o(), c = u.format === "binary_little_endian", h = new DataView(r, u.headerLength);
709
+ let f, b = 0;
710
+ for (let g = 0; g < u.elements.length; g++) {
711
+ const F = u.elements[g], S = F.properties, P = n(S);
712
+ y(S, h, c);
713
+ for (let _ = 0; _ < F.count; _++) {
714
+ f = a(b, S), b += f[1];
715
+ const V = f[0];
716
+ x(l, F.name, V, P);
717
+ }
718
+ }
719
+ return m(l);
720
+ }
721
+ function v(r) {
722
+ let u = 0, l = !0, c = "";
723
+ const h = [], f = new TextDecoder().decode(r.subarray(0, 5)), b = /^ply\r\n/.test(f);
724
+ do {
725
+ const g = String.fromCharCode(r[u++]);
726
+ g !== `
727
+ ` && g !== "\r" ? c += g : (c === "end_header" && (l = !1), c !== "" && (h.push(c), c = ""));
728
+ } while (l && u < r.length);
729
+ return b === !0 && u++, { headerText: h.join("\r") + "\r", headerLength: u };
730
+ }
731
+ let I;
732
+ const B = this;
733
+ if (i instanceof ArrayBuffer) {
734
+ const r = new Uint8Array(i), { headerText: u, headerLength: l } = v(r), c = t(u, l);
735
+ if (c.format === "ascii") {
736
+ const h = new TextDecoder().decode(r);
737
+ I = d(h, c);
738
+ } else
739
+ I = C(i, c);
740
+ } else
741
+ I = d(i, t(i));
742
+ return I;
743
+ }
744
+ };
745
+ class ye {
746
+ constructor(i) {
747
+ this.arr = i, this.i = 0;
748
+ }
749
+ empty() {
750
+ return this.i >= this.arr.length;
751
+ }
752
+ next() {
753
+ return this.arr[this.i++];
754
+ }
755
+ }
756
+ const D = class D extends Dt {
471
757
  constructor() {
472
758
  super(...arguments);
473
- d(this, "isPickableFeatures", !0);
474
- d(this, "isPlyMesh", !0);
759
+ w(this, "isPickableFeatures", !0);
760
+ w(this, "isPlyMesh", !0);
475
761
  }
476
762
  pickFeaturesFrom(t) {
477
763
  if (this.geometry.hasAttribute("color") && t.face) {
478
- const e = this.geometry.getAttribute("color").array, s = t.face, n = [{ color: new vt(
764
+ const e = this.geometry.getAttribute("color").array, s = t.face, n = [{ color: new nt(
479
765
  e[s.a * 3],
480
766
  e[s.a * 3 + 1],
481
767
  e[s.a * 3 + 2]
@@ -485,122 +771,122 @@ const S = class S extends xt {
485
771
  return [];
486
772
  }
487
773
  };
488
- d(S, "isPlyMesh", (t) => P(t) && t.isPlyMesh), d(S, "isPlyPickResult", (t) => P(t) && S.isPlyMesh(t == null ? void 0 : t.object));
489
- let k = S;
490
- class se extends V {
774
+ w(D, "isPlyMesh", (t) => O(t) && t.isPlyMesh), w(D, "isPlyPickResult", (t) => O(t) && D.isPlyMesh(t == null ? void 0 : t.object));
775
+ let Y = D;
776
+ class be extends ot {
491
777
  constructor(t) {
492
- super(new W());
493
- d(this, "isPlyEntity", !0);
494
- d(this, "source");
778
+ super(new tt());
779
+ w(this, "isPlyEntity", !0);
780
+ w(this, "source");
495
781
  this.source = t;
496
782
  }
497
783
  async preprocess() {
498
- const t = await E.fetchArrayBuffer(this.source.url), e = this.source.at.as(this.source.featureProjection).toVector3(), o = new kt().parse(t), n = new It({
499
- side: Ct
784
+ const t = await j.fetchArrayBuffer(this.source.url), e = this.source.at.as(this.source.featureProjection).toVector3(), o = new ge().parse(t), n = new zt({
785
+ side: Rt
500
786
  });
501
787
  o.hasAttribute("color") && (n.vertexColors = !0), o.computeVertexNormals();
502
- const r = new k(o, n);
503
- r.name = "plyModel", o.computeBoundingBox(), r.position.copy(e), r.updateWorldMatrix(!0, !0), this.object3d.add(r), this.onObjectCreated(r);
504
- const l = E.getContext(this.source.url);
505
- D(this, { filename: l.filename }), this.notifyChange(this.object3d);
788
+ const d = new Y(o, n);
789
+ d.name = "plyModel", o.computeBoundingBox(), d.position.copy(e), d.updateWorldMatrix(!0, !0), this.object3d.add(d), this.onObjectCreated(d);
790
+ const m = j.getContext(this.source.url);
791
+ $(this, { filename: m.filename }), this.notifyChange(this.object3d);
506
792
  }
507
793
  }
508
- const oe = (c) => {
509
- const { dataset: a, instance: t } = c, e = a.config, s = U(e.source.position ?? a.get("position")), o = new se({
794
+ const xe = (p) => {
795
+ const { dataset: i, instance: t } = p, e = i.config, s = st(e.source.position ?? i.get("position")), o = new be({
510
796
  ...e.source,
511
797
  at: s,
512
798
  featureProjection: t.referenceCrs
513
799
  });
514
800
  return Promise.resolve(o);
515
- }, ne = (c, a) => {
801
+ }, we = (p, i) => {
516
802
  var s;
517
- if (!k.isPlyPickResult(c))
803
+ if (!Y.isPlyPickResult(p))
518
804
  return;
519
- const t = (s = c.features) == null ? void 0 : s.at(0);
805
+ const t = (s = p.features) == null ? void 0 : s.at(0);
520
806
  if (!t)
521
807
  return;
522
- a.has("PLY") || a.set("PLY", []), a.get("PLY").push({ key: "Color", value: t.color });
808
+ i.has("PLY") || i.set("PLY", []), i.get("PLY").push({ key: "Color", value: t.color });
523
809
  };
524
- class we {
810
+ class Le {
525
811
  constructor() {
526
- d(this, "name", "PLY");
812
+ w(this, "name", "PLY");
527
813
  }
528
- initialize(a) {
529
- a.datasets.registerDatasetType("ply", {
530
- attributeExtractor: ne,
531
- entityBuilder: oe,
814
+ initialize(i) {
815
+ i.datasets.registerDatasetType("ply", {
816
+ attributeExtractor: we,
817
+ entityBuilder: xe,
532
818
  icon: "bi-file-earmark-binary",
533
819
  name: "PLY"
534
820
  });
535
821
  }
536
822
  }
537
- const ie = (c) => {
538
- const a = c.dataset.config, t = new Bt({
539
- source: new Mt({ url: `${a.source.url}/${a.source.filename}` })
823
+ const _e = (p) => {
824
+ const i = p.dataset.config, t = new Ht({
825
+ source: new Wt({ url: `${i.source.url}/${i.source.filename}` })
540
826
  });
541
- return D(t, {
542
- filename: a.source.url
827
+ return $(t, {
828
+ filename: i.source.url
543
829
  }), Promise.resolve(t);
544
830
  };
545
- class _e {
831
+ class Ae {
546
832
  constructor() {
547
- d(this, "name", "Potree");
833
+ w(this, "name", "Potree");
548
834
  }
549
- initialize(a) {
550
- a.datasets.registerDatasetType("potree", {
551
- entityBuilder: ie,
835
+ initialize(i) {
836
+ i.datasets.registerDatasetType("potree", {
837
+ entityBuilder: _e,
552
838
  icon: "fg-multipoint",
553
839
  name: "Potree Point Cloud"
554
840
  });
555
841
  }
556
842
  }
557
- class Ie {
843
+ class ze {
558
844
  constructor() {
559
- d(this, "name", "Tour");
560
- d(this, "_camera", null);
561
- d(this, "_cameraCallback", null);
562
- d(this, "_context", null);
563
- d(this, "_tours", null);
845
+ w(this, "name", "Tour");
846
+ w(this, "_camera", null);
847
+ w(this, "_cameraCallback", null);
848
+ w(this, "_context", null);
849
+ w(this, "_tours", null);
564
850
  }
565
- initialize(a) {
566
- this._context = a, a.events.addEventListener("ready", this.start.bind(this));
851
+ initialize(i) {
852
+ this._context = i, i.events.addEventListener("ready", this.start.bind(this));
567
853
  }
568
854
  buildTours() {
569
- const a = this._camera, t = new g.Tour({
855
+ const i = this._camera, t = new T.Tour({
570
856
  tourName: "main",
571
857
  useModalOverlay: !0
572
- }), e = new g.Tour({
858
+ }), e = new T.Tour({
573
859
  tourName: "navigating",
574
860
  useModalOverlay: !0
575
- }), s = new g.Tour({
861
+ }), s = new T.Tour({
576
862
  tourName: "analyzing",
577
863
  useModalOverlay: !0
578
864
  }), o = [
579
865
  { action: () => {
580
- var i;
581
- return (i = g.activeTour) == null ? void 0 : i.next();
866
+ var a;
867
+ return (a = T.activeTour) == null ? void 0 : a.next();
582
868
  }, text: "Next" },
583
869
  { action: () => {
584
- var i;
585
- return (i = g.activeTour) == null ? void 0 : i.cancel();
870
+ var a;
871
+ return (a = T.activeTour) == null ? void 0 : a.cancel();
586
872
  }, secondary: !0, text: "Exit" }
587
873
  ], n = () => {
588
- var C, T;
589
- const i = (C = g.activeTour) == null ? void 0 : C.getCurrentStep(), u = i == null ? void 0 : i.getElement(), m = u == null ? void 0 : u.querySelector(".shepherd-text"), f = (T = g.activeTour) == null ? void 0 : T.steps;
590
- if (i == null || u == null || m == null || f == null)
874
+ var r, u;
875
+ const a = (r = T.activeTour) == null ? void 0 : r.getCurrentStep(), y = a == null ? void 0 : a.getElement(), C = y == null ? void 0 : y.querySelector(".shepherd-text"), v = (u = T.activeTour) == null ? void 0 : u.steps;
876
+ if (a == null || y == null || C == null || v == null)
591
877
  return;
592
- const p = document.createElement("div");
593
- p.className = "progress mt-3", p.setAttribute("role", "progressbar"), p.style.height = "2px";
594
878
  const I = document.createElement("div");
595
- I.className = "progress-bar bg-success", I.style.width = `${100 * (f.indexOf(i) / f.length)}%`, p.appendChild(I), m.appendChild(p);
596
- }, r = async (i, u) => new Promise((m) => {
597
- const f = document.getElementById(i);
598
- if (f && !f.classList.contains("active") && f.click(), document.querySelector(u))
599
- return m(document.querySelector(u));
600
- const p = new MutationObserver(() => {
601
- document.querySelector(u) && (p.disconnect(), m(document.querySelector(u)));
879
+ I.className = "progress mt-3", I.setAttribute("role", "progressbar"), I.style.height = "2px";
880
+ const B = document.createElement("div");
881
+ B.className = "progress-bar bg-success", B.style.width = `${100 * (v.indexOf(a) / v.length)}%`, I.appendChild(B), C.appendChild(I);
882
+ }, d = async (a, y) => new Promise((C) => {
883
+ const v = document.getElementById(a);
884
+ if (v && !v.classList.contains("active") && v.click(), document.querySelector(y))
885
+ return C(document.querySelector(y));
886
+ const I = new MutationObserver(() => {
887
+ document.querySelector(y) && (I.disconnect(), C(document.querySelector(y)));
602
888
  });
603
- p.observe(document.body, {
889
+ I.observe(document.body, {
604
890
  childList: !0,
605
891
  subtree: !0
606
892
  });
@@ -609,22 +895,22 @@ class Ie {
609
895
  buttons: [
610
896
  {
611
897
  action: () => {
612
- var i;
613
- (i = g.activeTour) == null || i.complete(), e.show(0);
898
+ var a;
899
+ (a = T.activeTour) == null || a.complete(), e.show(0);
614
900
  },
615
901
  text: "Navigating"
616
902
  },
617
903
  {
618
904
  action: () => {
619
- var i;
620
- (i = g.activeTour) == null || i.complete(), s.show(0);
905
+ var a;
906
+ (a = T.activeTour) == null || a.complete(), s.show(0);
621
907
  },
622
908
  text: "Analyzing data"
623
909
  },
624
910
  {
625
911
  action: () => {
626
- var i;
627
- return (i = g.activeTour) == null ? void 0 : i.cancel();
912
+ var a;
913
+ return (a = T.activeTour) == null ? void 0 : a.cancel();
628
914
  },
629
915
  secondary: !0,
630
916
  text: "Exit"
@@ -658,14 +944,14 @@ class Ie {
658
944
  text: '<p>This application integrates <a href="https://github.com/yomotsu/camera-controls">camera-controls</a>, a camera control for three.js.</p><p><b>Click</b> to move the camera. <b>Right-click</b> to rotate around a point. <b>Scroll</b> to zoom in or out.</p>',
659
945
  when: {
660
946
  hide: () => {
661
- this._cameraCallback && a.removeEventListener("interaction-end", this._cameraCallback), this._cameraCallback = null;
947
+ this._cameraCallback && i.removeEventListener("interaction-end", this._cameraCallback), this._cameraCallback = null;
662
948
  },
663
949
  show: () => {
664
- let i = 0;
950
+ let a = 0;
665
951
  this._cameraCallback = () => {
666
- var u;
667
- i += 1, i > 2 && ((u = g.activeTour) == null || u.next());
668
- }, a.addEventListener("interaction-end", this._cameraCallback), n();
952
+ var y;
953
+ a += 1, a > 2 && ((y = T.activeTour) == null || y.next());
954
+ }, i.addEventListener("interaction-end", this._cameraCallback), n();
669
955
  }
670
956
  }
671
957
  }), e.addStep({
@@ -673,7 +959,7 @@ class Ie {
673
959
  element: "#toolbar",
674
960
  on: "right"
675
961
  },
676
- beforeShowPromise: () => r("toolbar-datasets", "#datasets-drop-zone"),
962
+ beforeShowPromise: () => d("toolbar-datasets", "#datasets-drop-zone"),
677
963
  buttons: o,
678
964
  id: "toolbar-layers",
679
965
  text: "<p>Giro3D supports multiple datasets.</p><p>You can toggle datasets as you wish with the <b>Datasets</b> panel.</p>",
@@ -685,7 +971,7 @@ class Ie {
685
971
  element: "#basemap-list",
686
972
  on: "right"
687
973
  },
688
- beforeShowPromise: () => r("toolbar-datasets", "#datasets-drop-zone"),
974
+ beforeShowPromise: () => d("toolbar-datasets", "#datasets-drop-zone"),
689
975
  buttons: o,
690
976
  id: "basemaps",
691
977
  text: "<p><b>Basemaps</b> are color and elevation layers that make the basic shape and aspect of the <b>Map</b>.</p>",
@@ -697,7 +983,7 @@ class Ie {
697
983
  element: "#overlay-list",
698
984
  on: "right"
699
985
  },
700
- beforeShowPromise: () => r("toolbar-datasets", "#datasets-drop-zone"),
986
+ beforeShowPromise: () => d("toolbar-datasets", "#datasets-drop-zone"),
701
987
  buttons: o,
702
988
  id: "overlays",
703
989
  text: "<p><b>Overlays</b> are vector layers in various formats (WFS, GML, GeoJSON...).</p>",
@@ -709,7 +995,7 @@ class Ie {
709
995
  element: "#dataset-list",
710
996
  on: "right"
711
997
  },
712
- beforeShowPromise: () => r("toolbar-datasets", "#datasets-drop-zone"),
998
+ beforeShowPromise: () => d("toolbar-datasets", "#datasets-drop-zone"),
713
999
  buttons: o,
714
1000
  id: "layers",
715
1001
  text: "<p>The <b>Datasets</b> panel contains all 3D objects in the scene.</><p>You can toggle their visibility and delete them.<p><p>Most objects leverage Giro3D's adaptive resolution to optimize their display.</p>",
@@ -721,7 +1007,7 @@ class Ie {
721
1007
  element: "#datasets-drop-zone",
722
1008
  on: "right"
723
1009
  },
724
- beforeShowPromise: () => r("toolbar-datasets", "#datasets-drop-zone"),
1010
+ beforeShowPromise: () => d("toolbar-datasets", "#datasets-drop-zone"),
725
1011
  buttons: o,
726
1012
  id: "adddata",
727
1013
  text: "<p>You can add your own data from your computer by <b>dragging the file</b> into this page.</p><p>While you won't benefit from Giro3D's tiling mechanism, this can be a great way to quickly visualize datasets up to 100MB.</p><p>This application supports CityJSONs, IFCs, LAS/LAZs, CSV pointclouds, and simple GeoJSON features.</p>",
@@ -747,15 +1033,15 @@ class Ie {
747
1033
  buttons: [
748
1034
  {
749
1035
  action: () => {
750
- var i;
751
- (i = g.activeTour) == null || i.complete(), s.show(0);
1036
+ var a;
1037
+ (a = T.activeTour) == null || a.complete(), s.show(0);
752
1038
  },
753
1039
  text: "Analyzing data"
754
1040
  },
755
1041
  {
756
1042
  action: () => {
757
- var i;
758
- return (i = g.activeTour) == null ? void 0 : i.complete();
1043
+ var a;
1044
+ return (a = T.activeTour) == null ? void 0 : a.complete();
759
1045
  },
760
1046
  secondary: !0,
761
1047
  text: "Exit"
@@ -771,7 +1057,7 @@ class Ie {
771
1057
  element: "#annotations-fieldset",
772
1058
  on: "right"
773
1059
  },
774
- beforeShowPromise: () => r("toolbar-annotations", "#annotations-fieldset"),
1060
+ beforeShowPromise: () => d("toolbar-annotations", "#annotations-fieldset"),
775
1061
  buttons: o,
776
1062
  id: "annotation",
777
1063
  text: "<p>You can <strong>annotate</strong> any data displayed using Giro3D native tools.<br>Select the <strong>geometry</strong> of your annotation, and <strong>click</strong> on the scene to add points. <strong>Right-click</strong> to end the shape.</p>",
@@ -783,19 +1069,19 @@ class Ie {
783
1069
  element: "#annotations-fieldset",
784
1070
  on: "right"
785
1071
  },
786
- beforeShowPromise: () => r("toolbar-annotations", "#annotations-fieldset"),
1072
+ beforeShowPromise: () => d("toolbar-annotations", "#annotations-fieldset"),
787
1073
  buttons: o,
788
1074
  id: "annotations",
789
1075
  text: "You can download your annotations as GeoJSON files. You can also upload your own by dragging them into this panel.",
790
1076
  when: {
791
1077
  show: n
792
1078
  }
793
- }), yt("measurements") && s.addStep({
1079
+ }), Ot("measurements") && s.addStep({
794
1080
  attachTo: {
795
1081
  element: "#panel-container",
796
1082
  on: "right"
797
1083
  },
798
- beforeShowPromise: () => r("toolbar-measures", "#measures-fieldset"),
1084
+ beforeShowPromise: () => d("toolbar-measures", "#measures-fieldset"),
799
1085
  buttons: o,
800
1086
  id: "measurements",
801
1087
  text: "You can add <strong>measurements</strong> to easily get distances betwween objects.<br>Once started, moving the mouse will display the measure. <strong>Click</strong> to save the measurement. <strong>Right-click</strong> to end.",
@@ -807,10 +1093,10 @@ class Ie {
807
1093
  element: "#panel-container",
808
1094
  on: "right"
809
1095
  },
810
- beforeShowPromise: () => r("toolbar-analysis", "#panel-container .card"),
1096
+ beforeShowPromise: () => d("toolbar-analysis", "#panel-container .card"),
811
1097
  buttons: [{ action: () => {
812
- var i;
813
- return (i = g.activeTour) == null ? void 0 : i.complete();
1098
+ var a;
1099
+ return (a = T.activeTour) == null ? void 0 : a.complete();
814
1100
  }, text: "Done!" }],
815
1101
  id: "analysis",
816
1102
  text: "In the <strong>Analysis</strong> panel you'll find some advanced analysis tools.",
@@ -818,39 +1104,39 @@ class Ie {
818
1104
  show: n
819
1105
  }
820
1106
  });
821
- const l = () => {
822
- const i = new URL(document.URL);
823
- i.searchParams.delete("tourStep"), i.searchParams.set("tour", "none"), window.history.replaceState({}, "", i.toString());
824
- }, h = (i) => {
825
- const u = new URL(document.URL);
826
- let m = "main";
827
- i.tour.id.startsWith("navigating") ? m = "navigating" : i.tour.id.startsWith("analyzing") && (m = "analyzing"), u.searchParams.set("tour", m), u.searchParams.set("tourStep", i.step.id), window.history.replaceState({}, "", u.toString());
1107
+ const m = () => {
1108
+ const a = new URL(document.URL);
1109
+ a.searchParams.delete("tourStep"), a.searchParams.set("tour", "none"), window.history.replaceState({}, "", a.toString());
1110
+ }, x = (a) => {
1111
+ const y = new URL(document.URL);
1112
+ let C = "main";
1113
+ a.tour.id.startsWith("navigating") ? C = "navigating" : a.tour.id.startsWith("analyzing") && (C = "analyzing"), y.searchParams.set("tour", C), y.searchParams.set("tourStep", a.step.id), window.history.replaceState({}, "", y.toString());
828
1114
  };
829
- return t.on("cancel", l), t.on("complete", l), t.on("show", h), e.on("cancel", l), e.on("complete", l), e.on("show", h), s.on("cancel", l), s.on("complete", l), s.on("show", h), { analyzingTour: s, mainTour: t, navigatingTour: e };
1115
+ return t.on("cancel", m), t.on("complete", m), t.on("show", x), e.on("cancel", m), e.on("complete", m), e.on("show", x), s.on("cancel", m), s.on("complete", m), s.on("show", x), { analyzingTour: s, mainTour: t, navigatingTour: e };
830
1116
  }
831
1117
  getTours() {
832
1118
  return this._tours || (this._tours = this.buildTours()), this._tours;
833
1119
  }
834
1120
  restart() {
835
- const { mainTour: a } = this.getTours();
836
- a.show(0);
1121
+ const { mainTour: i } = this.getTours();
1122
+ i.show(0);
837
1123
  }
838
1124
  start() {
839
1125
  if (!this._context)
840
1126
  throw new Error("module is not initialized");
841
- const { analyzingTour: a, mainTour: t, navigatingTour: e } = this.getTours();
1127
+ const { analyzingTour: i, mainTour: t, navigatingTour: e } = this.getTours();
842
1128
  this._camera = this._context.view.getCameraController();
843
1129
  const s = new URL(document.URL), o = s.searchParams.get("tour") ?? "main";
844
1130
  if (o !== "none") {
845
1131
  const n = s.searchParams.get("tourStep") ?? 0;
846
- o === "navigating" ? e.show(n) : o === "analyzing" ? a.show(n) : t.show(n);
1132
+ o === "navigating" ? e.show(n) : o === "analyzing" ? i.show(n) : t.show(n);
847
1133
  }
848
1134
  }
849
1135
  }
850
1136
  export {
851
- be as IFCLoader,
852
- we as PLYLoader,
853
- _e as PotreeLoader,
854
- Ie as Tour
1137
+ Me as IFCLoader,
1138
+ Le as PLYLoader,
1139
+ Ae as PotreeLoader,
1140
+ ze as Tour
855
1141
  };
856
1142
  //# sourceMappingURL=modules.es.js.map