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

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.
Files changed (59) hide show
  1. package/dist/Components.cjs.js +2 -2
  2. package/dist/Components.cjs.js.map +1 -1
  3. package/dist/Components.es.js +2410 -1513
  4. package/dist/Components.es.js.map +1 -1
  5. package/dist/assets/piero.css +2 -2
  6. package/dist/index.cjs.js +5 -5
  7. package/dist/index.cjs.js.map +1 -1
  8. package/dist/index.es.js +4420 -5626
  9. package/dist/index.es.js.map +1 -1
  10. package/dist/modules.cjs.js +2 -2
  11. package/dist/modules.cjs.js.map +1 -1
  12. package/dist/modules.es.js +944 -593
  13. package/dist/modules.es.js.map +1 -1
  14. package/dist/src/api/AnalysisApi.d.ts +15 -0
  15. package/dist/src/api/DatasetApi.d.ts +28 -0
  16. package/dist/src/api/NotificationApi.d.ts +10 -0
  17. package/dist/src/api/ViewApi.d.ts +4 -0
  18. package/dist/src/api/index.d.ts +2 -2
  19. package/dist/src/components/panels/AnalysisPanel.vue.d.ts +1 -1
  20. package/dist/src/components/panels/DatasetOrGroupItem.vue.d.ts +0 -2
  21. package/dist/src/components/panels/analysis/ToolWrapper.vue.d.ts +1 -6
  22. package/dist/src/context.d.ts +7 -0
  23. package/dist/src/index.d.ts +2 -1
  24. package/dist/src/module.d.ts +4 -0
  25. package/dist/src/modules/ClippingBoxAnalysis.d.ts +18 -0
  26. package/dist/src/modules/CrossSectionAnalysis.d.ts +11 -0
  27. package/dist/src/modules/DownloadDataset.d.ts +12 -0
  28. package/dist/src/modules/FloodingPlaneAnalysis.d.ts +11 -0
  29. package/dist/src/modules/IFCLoader.d.ts +1 -0
  30. package/dist/src/modules/PLYLoader.d.ts +1 -0
  31. package/dist/src/modules/PotreeLoader.d.ts +1 -0
  32. package/dist/src/modules/Tour.d.ts +1 -0
  33. package/dist/src/{services/analysis → modules/clippingBoxAnalysis}/ClippingBoxManager.d.ts +9 -3
  34. package/dist/src/modules/clippingBoxAnalysis/store.d.ts +2268 -0
  35. package/dist/src/modules/crossSectionAnalysis/CrossSectionManager.d.ts +8 -0
  36. package/dist/src/modules/crossSectionAnalysis/store.d.ts +522 -0
  37. package/dist/src/modules/floodingPlaneAnalysis/FloodingPlaneManager.d.ts +9 -0
  38. package/dist/src/{types/FloodingPlane.d.ts → modules/floodingPlaneAnalysis/FloodingPlaneObject.d.ts} +2 -2
  39. package/dist/src/modules/floodingPlaneAnalysis/store.d.ts +16 -0
  40. package/dist/src/modules/index.d.ts +5 -1
  41. package/dist/src/services/Giro3DManager.d.ts +0 -2
  42. package/dist/src/services/Picker.d.ts +1 -1
  43. package/dist/src/stores/analysis.d.ts +19 -1569
  44. package/dist/src/stores/datasets.d.ts +23 -1
  45. package/dist/src/stores/modules.d.ts +5 -1
  46. package/dist/src/stores/modules.test.d.ts +1 -0
  47. package/dist/src/stores/notifications.d.ts +1 -0
  48. package/package.json +1 -1
  49. package/dist/src/components/charts/BarChart.vue.d.ts +0 -4
  50. package/dist/src/components/charts/DoughnutChart.vue.d.ts +0 -4
  51. package/dist/src/components/panels/LoadingIndicator.vue.d.ts +0 -6
  52. package/dist/src/components/panels/analysis/FloodingPlane.vue.d.ts +0 -2
  53. package/dist/src/services/AnalysisManager.d.ts +0 -10
  54. package/dist/src/services/analysis/CrossSectionManager.d.ts +0 -9
  55. package/dist/src/services/analysis/FloodingPlaneManager.d.ts +0 -11
  56. package/dist/src/stores/statistics.d.ts +0 -8
  57. /package/dist/src/{components/panels/analysis → modules/clippingBoxAnalysis}/ClippingBox.vue.d.ts +0 -0
  58. /package/dist/src/{components/panels/analysis → modules/crossSectionAnalysis}/CrossSection.vue.d.ts +0 -0
  59. /package/dist/src/{components/panels/analysis/Statistics.vue.d.ts → modules/floodingPlaneAnalysis/FloodingPlane.vue.d.ts} +0 -0
@@ -1,16 +1,354 @@
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 = {
1
+ var xt = Object.defineProperty;
2
+ var Ct = (l, e, t) => e in l ? xt(l, e, { enumerable: !0, configurable: !0, writable: !0, value: t }) : l[e] = t;
3
+ var m = (l, e, t) => Ct(l, typeof e != "symbol" ? e + "" : e, t);
4
+ import { V as Y, N as rt, i as lt, a2 as et, F as R, s as It, P as Pt, o as Z, n as ct, j as $, G as ut, f as K, M as St, u as Tt, q as Et, r as Ft, U as nt, X, Y as Bt, _ as dt, w as Mt, Z as kt, a3 as pt, a4 as Dt, a5 as Nt, z as At, b as L, C as ht, a6 as st, a7 as Lt, a8 as zt, h as Ot } from "./Components.es.js";
5
+ import { a9 as xn } from "./Components.es.js";
6
+ import { ref as O, defineComponent as q, createElementBlock as N, openBlock as D, createElementVNode as v, createVNode as A, unref as M, Fragment as tt, resolveComponent as Rt, createCommentVNode as H, createBlock as ot, normalizeClass as it, toDisplayString as jt, withCtx as at, renderList as ft } from "vue";
7
+ import { defineStore as mt } from "pinia";
8
+ import Ut from "@giro3d/giro3d/core/geographic/Coordinates";
9
+ import gt, { isEntity3D as Vt } from "@giro3d/giro3d/entities/Entity3D";
10
+ import Yt from "@giro3d/giro3d/gui/EntityPanel";
11
+ import { Components as $t, SimpleScene as Gt, SimpleRenderer as Ht, SimpleCamera as Wt, SimpleRaycaster as qt, IfcPropertiesUtils as z, FragmentBoundingBox as Xt, FragmentManager as Zt, FragmentClassifier as Qt, FragmentIfcLoader as Jt, toCompositeID as Kt, IfcCategoryMap as te } from "openbim-components";
12
+ import ee from "@giro3d/giro3d/gui/EntityInspector";
13
+ import ne from "@giro3d/giro3d/entities/PointCloud";
14
+ import se from "@giro3d/giro3d/sources/PotreeSource";
15
+ import F from "shepherd.js";
16
+ const yt = mt("crossSection", () => {
17
+ const l = O(0), e = O(new Y(0, 0, 0)), t = O(!1);
18
+ function s(n) {
19
+ t.value = n;
20
+ }
21
+ function o(n) {
22
+ l.value = n;
23
+ }
24
+ function i(n) {
25
+ e.value = n;
26
+ }
27
+ return {
28
+ center: e,
29
+ enable: t,
30
+ orientation: l,
31
+ setCenter: i,
32
+ setEnabled: s,
33
+ setOrientation: o
34
+ };
35
+ }), oe = { class: "input-group mb-3" }, ie = { class: "input-group mb-3" }, ae = ["value"], re = { class: "input-group mb-3" }, le = ["value"], ce = { class: "input-group" }, ue = { class: "input-group" }, de = ["value"], pe = ["value"], he = /* @__PURE__ */ q({
36
+ __name: "CrossSection",
37
+ setup(l) {
38
+ const e = yt();
39
+ function t(i) {
40
+ e.setOrientation(i);
41
+ }
42
+ function s(i) {
43
+ const n = e.center.clone();
44
+ n.setX(i), e.setCenter(n);
45
+ }
46
+ function o(i) {
47
+ const n = e.center.clone();
48
+ n.setY(i), e.setCenter(n);
49
+ }
50
+ return (i, n) => (D(), N("div", null, [
51
+ v("div", oe, [
52
+ A(rt, {
53
+ "model-value": M(e).enable,
54
+ "onUpdate:modelValue": n[0] || (n[0] = (r) => M(e).setEnabled(r)),
55
+ id: "cross-section-enable",
56
+ title: "foo"
57
+ }, null, 8, ["model-value"]),
58
+ n[5] || (n[5] = v("label", {
59
+ for: "cross-section-enable",
60
+ class: "form-label"
61
+ }, "Enable cross section", -1))
62
+ ]),
63
+ v("div", ie, [
64
+ n[6] || (n[6] = v("label", {
65
+ for: "plane-orientation-range",
66
+ class: "form-label"
67
+ }, "Plane orientation (0-360°)", -1)),
68
+ v("input", {
69
+ id: "plane-orientation-range",
70
+ title: "Altitude",
71
+ type: "range",
72
+ class: "form-range",
73
+ min: "0",
74
+ step: "0.1",
75
+ max: "360",
76
+ value: M(e).orientation,
77
+ onInput: n[1] || (n[1] = (r) => t(Number.parseFloat(r.target.value)))
78
+ }, null, 40, ae)
79
+ ]),
80
+ v("div", re, [
81
+ v("input", {
82
+ type: "number",
83
+ class: "form-control",
84
+ id: "plane-orientation-number",
85
+ step: "0.1",
86
+ value: M(e).orientation,
87
+ onInput: n[2] || (n[2] = (r) => t(Number.parseFloat(r.target.value)))
88
+ }, null, 40, le)
89
+ ]),
90
+ n[8] || (n[8] = v("hr", null, null, -1)),
91
+ v("div", ce, [
92
+ n[7] || (n[7] = v("label", { class: "form-label" }, "Center (x, y)", -1)),
93
+ v("div", ue, [
94
+ v("input", {
95
+ type: "number",
96
+ class: "form-control",
97
+ id: "plane-center-x",
98
+ value: M(e).center.x,
99
+ onInput: n[3] || (n[3] = (r) => s(Number.parseFloat(r.target.value)))
100
+ }, null, 40, de),
101
+ v("input", {
102
+ type: "number",
103
+ class: "form-control",
104
+ id: "plane-center-y",
105
+ value: M(e).center.y,
106
+ onInput: n[4] || (n[4] = (r) => o(Number.parseFloat(r.target.value)))
107
+ }, null, 40, pe)
108
+ ])
109
+ ])
110
+ ]));
111
+ }
112
+ });
113
+ class fe {
114
+ constructor(e) {
115
+ m(this, "_store", yt());
116
+ this.context = e, e.events.addEventListener("ready", () => {
117
+ const t = e.configuration.default_crs, s = e.configuration.analysis.cross_section;
118
+ this._store.setOrientation(s.orientation);
119
+ const o = s.pivot, i = new Ut(o.crs ?? t, o.x, o.y, 0).as(
120
+ t
121
+ );
122
+ this._store.setCenter(i.toVector3()), this._store.$onAction(({ after: n, name: r }) => {
123
+ n(() => {
124
+ switch (r) {
125
+ case "setCenter":
126
+ case "setEnabled":
127
+ case "setOrientation":
128
+ this.updateCrossSection();
129
+ break;
130
+ }
131
+ });
132
+ }), this.updateCrossSection();
133
+ });
134
+ }
135
+ dispose() {
136
+ }
137
+ updateCrossSection() {
138
+ const e = [];
139
+ if (this._store.enable) {
140
+ const s = lt.DEG2RAD * this._store.orientation, o = Math.cos(s), i = Math.sin(s), n = new Y(o, i, 0), r = new et(n, 0).distanceToPoint(this._store.center), g = new et(n, -r);
141
+ e.push(g);
142
+ }
143
+ const t = this.context.view.getInstance();
144
+ t.renderer.clippingPlanes = e;
145
+ for (const s of this.context.view.getInstance().getEntities())
146
+ Vt(s) && s.dispatchEvent({
147
+ clippingPlanes: e,
148
+ type: "clippingPlanes-property-changed"
149
+ });
150
+ t.notifyChange();
151
+ }
152
+ }
153
+ class pn {
154
+ constructor() {
155
+ m(this, "id", "builtin-cross-section-analysis");
156
+ m(this, "name", "Cross section");
157
+ m(this, "_manager", null);
158
+ }
159
+ initialize(e) {
160
+ e.analysis.registerTool({
161
+ component: he,
162
+ icon: "bi-circle-half",
163
+ name: "Cross section"
164
+ }), this._manager = new fe(e);
165
+ }
166
+ }
167
+ function Q(l) {
168
+ if ("url" in l.config && typeof l.config.url == "string")
169
+ return l.config.url;
170
+ if ("source" in l.config && typeof l.config.source == "object" && "url" in l.config.source && typeof l.config.source.url == "string")
171
+ return l.config.source.url;
172
+ }
173
+ function me(l) {
174
+ return Q(l) != null;
175
+ }
176
+ class hn {
177
+ constructor() {
178
+ m(this, "id", "builtin-download-dataset");
179
+ m(this, "name", "Download dataset");
180
+ m(this, "_context", null);
181
+ }
182
+ initialize(e) {
183
+ this._context = e, e.datasets.registerDatasetAction({
184
+ action: this.download.bind(this),
185
+ icon: "bi-download",
186
+ predicate: me,
187
+ title: "Download dataset"
188
+ });
189
+ }
190
+ download(e) {
191
+ const t = Q(e);
192
+ if (t == null) {
193
+ console.warn("invalid");
194
+ return;
195
+ }
196
+ const s = this._context, o = new URL(t).pathname.split("/"), i = o[o.length - 1];
197
+ console.info(`download ${Q(e)}`), R.fetch(t).then((n) => {
198
+ if (!n.ok)
199
+ throw new Error(`${n.status} ${n.statusText}`);
200
+ return n.blob();
201
+ }).then((n) => {
202
+ It.downloadBlob(n, i), s.notifications.pushNotification({
203
+ level: "success",
204
+ text: i,
205
+ title: "Download successful"
206
+ });
207
+ }).catch((n) => {
208
+ console.error(n);
209
+ const r = n instanceof Error ? n.message : "Download failed";
210
+ s.notifications.pushNotification({
211
+ level: "error",
212
+ text: r,
213
+ title: e.name
214
+ });
215
+ });
216
+ }
217
+ }
218
+ const bt = mt("floodingPlane", () => {
219
+ const l = O(0), e = O(!1);
220
+ function t() {
221
+ return l.value;
222
+ }
223
+ function s(i) {
224
+ l.value = i;
225
+ }
226
+ function o(i) {
227
+ e.value = i;
228
+ }
229
+ return { enable: e, getHeight: t, setEnabled: o, setHeight: s };
230
+ }), ge = { class: "input-group mb-3" }, ye = { class: "input-group mb-3" }, be = ["value"], _e = { class: "input-group mb-3" }, we = ["value"], ve = /* @__PURE__ */ q({
231
+ __name: "FloodingPlane",
232
+ setup(l) {
233
+ const e = bt();
234
+ function t(s) {
235
+ e.setHeight(s);
236
+ }
237
+ return (s, o) => (D(), N(tt, null, [
238
+ v("div", ge, [
239
+ A(rt, {
240
+ "model-value": M(e).enable,
241
+ "onUpdate:modelValue": o[0] || (o[0] = (i) => M(e).setEnabled(i)),
242
+ id: "flooding-plane-enable",
243
+ title: "foo"
244
+ }, null, 8, ["model-value"]),
245
+ o[3] || (o[3] = v("label", {
246
+ for: "flooding-plane-enable",
247
+ class: "form-label"
248
+ }, "Enable flooding plane", -1))
249
+ ]),
250
+ v("div", ye, [
251
+ o[5] || (o[5] = v("label", {
252
+ for: "flooding-altitude-range",
253
+ class: "form-label"
254
+ }, "Altitude", -1)),
255
+ v("input", {
256
+ id: "flooding-altitude-range",
257
+ title: "Altitude",
258
+ type: "range",
259
+ class: "form-range",
260
+ min: "0",
261
+ step: "0.1",
262
+ max: "500",
263
+ value: M(e).getHeight(),
264
+ onInput: o[1] || (o[1] = (i) => t(Number.parseFloat(i.target.value)))
265
+ }, null, 40, be),
266
+ v("div", _e, [
267
+ v("input", {
268
+ type: "number",
269
+ class: "form-control",
270
+ id: "flooding-altitude-number",
271
+ step: "0.1",
272
+ value: M(e).getHeight(),
273
+ onInput: o[2] || (o[2] = (i) => t(Number.parseFloat(i.target.value)))
274
+ }, null, 40, we),
275
+ o[4] || (o[4] = v("span", { class: "input-group-text" }, "m", -1))
276
+ ])
277
+ ])
278
+ ], 64));
279
+ }
280
+ });
281
+ class xe {
282
+ constructor() {
283
+ m(this, "geometry");
284
+ m(this, "material");
285
+ m(this, "object3D");
286
+ m(this, "_height");
287
+ this.geometry = new Pt(1, 1, 1, 1), this.material = new Z({ color: 43690, opacity: 0.5, transparent: !0 }), this.object3D = new ct(this.geometry, this.material), this.object3D.renderOrder = 2, this.visible = !1, this._height = 0;
288
+ }
289
+ set height(e) {
290
+ this._height = e;
291
+ }
292
+ get height() {
293
+ return this._height;
294
+ }
295
+ set visible(e) {
296
+ this.object3D.visible = e;
297
+ }
298
+ get visible() {
299
+ return this.object3D.visible;
300
+ }
301
+ dispose() {
302
+ this.object3D.removeFromParent(), this.geometry.dispose(), this.material.dispose();
303
+ }
304
+ setPosition(e, t, s, o, i) {
305
+ this.object3D.scale.set(o, i, 1), this.object3D.position.set(e, t, s), this.object3D.updateMatrixWorld();
306
+ }
307
+ }
308
+ class Ce {
309
+ constructor(e) {
310
+ m(this, "_context");
311
+ m(this, "_plane");
312
+ m(this, "_store", bt());
313
+ this._context = e, this._plane = null, e.events.addEventListener("ready", () => {
314
+ this._store.$onAction(({ after: t, name: s }) => {
315
+ t(() => {
316
+ switch (s) {
317
+ case "setEnabled":
318
+ this.updatePlane();
319
+ break;
320
+ case "setHeight":
321
+ this.updatePlane();
322
+ break;
323
+ }
324
+ });
325
+ });
326
+ });
327
+ }
328
+ dispose() {
329
+ this._plane && (this._context.view.getInstance().remove(this._plane.object3D), this._plane.dispose());
330
+ }
331
+ async updatePlane() {
332
+ this._plane || (this._plane = new xe(), await this._context.view.getInstance().add(this._plane.object3D));
333
+ const e = this._context.view.getBoundingBox(), t = e.getCenter(new Y()), s = e.getSize(new Y());
334
+ this._plane.visible = this._store.enable, this._plane.setPosition(t.x, t.y, this._store.getHeight(), s.x, s.y), this._context.view.getInstance().notifyChange();
335
+ }
336
+ }
337
+ class fn {
338
+ constructor() {
339
+ m(this, "id", "builtin-flooding-plane-analysis");
340
+ m(this, "name", "Flooding plane");
341
+ m(this, "_manager", null);
342
+ }
343
+ initialize(e) {
344
+ e.analysis.registerTool({
345
+ component: ve,
346
+ icon: "bi-layers-half",
347
+ name: "Flooding plane"
348
+ }), this._manager = new Ce(e);
349
+ }
350
+ }
351
+ const j = new St(), Ie = {
14
352
  bbox: new Z({
15
353
  color: "#FFFF00",
16
354
  depthTest: !0,
@@ -23,58 +361,58 @@ const z = new Pt(), qt = {
23
361
  opacity: 0.6,
24
362
  transparent: !0
25
363
  })
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 {
364
+ }, Pe = 4186316022, Se = 781010003, Te = 2655215786, Ee = 3242617779, Fe = 919958153, Be = 1307041759, _t = 1451395588, wt = 1883228015, Me = [_t, wt], ke = [
365
+ Pe,
366
+ Se,
367
+ Te,
368
+ Ee,
369
+ Fe,
370
+ Be
371
+ ], vt = (l) => $(l) && l.isIFCPickResult, U = class U extends gt {
34
372
  constructor(t) {
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");
373
+ super(new ut());
374
+ m(this, "isIfcEntity", !0);
375
+ m(this, "isPickableFeatures", !0);
376
+ m(this, "type", "IfcEntity");
377
+ m(this, "_classificationCache");
378
+ m(this, "_components");
379
+ m(this, "_fragmentBoundingBox");
380
+ m(this, "_fragmentClassifier");
381
+ m(this, "_fragmentManager");
382
+ m(this, "_ifcSelection");
45
383
  // Currently selected fragments
46
- w(this, "_indexMap");
384
+ m(this, "_indexMap");
47
385
  // Properties relationships
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(
386
+ m(this, "_model");
387
+ m(this, "_source");
388
+ this._source = t, this._components = new $t(), this._components.ui.enabled = !1, this._components.scene = new Gt(this._components), this._components.renderer = new Ht(
51
389
  this._components,
52
390
  document.createElement("div")
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;
391
+ ), this._components.camera = new Wt(this._components), this._components.raycaster = new qt(this._components), this._components.init(), this._ifcSelection = { bbox: {}, selection: {} }, this._indexMap = {}, this._classificationCache = null, this._fragmentBoundingBox = null;
54
392
  }
55
393
  clearHighlight(t = "selection") {
56
- for (const e of Object.keys(this._ifcSelection[t])) {
57
- const s = this._fragmentManager.list[e], o = s == null ? void 0 : s.fragments[t];
58
- o != null && o.mesh.removeFromParent();
394
+ for (const s of Object.keys(this._ifcSelection[t])) {
395
+ const o = this._fragmentManager.list[s], i = o == null ? void 0 : o.fragments[t];
396
+ i != null && i.mesh.removeFromParent();
59
397
  }
60
398
  this.notifyChange(this), this._ifcSelection[t] = {};
61
399
  }
62
400
  getBoundingBoxById(t) {
63
401
  this.clearHighlight("bbox"), this.highlightById(t, "bbox");
64
- const e = this._fragmentBoundingBox;
65
- if (e === null)
402
+ const s = this._fragmentBoundingBox;
403
+ if (s === null)
66
404
  throw new Error("Must call initClassification before getBoundingBoxById");
67
- const s = this._fragmentManager;
68
- e.reset();
69
- const o = this._ifcSelection.bbox;
70
- if (!Object.keys(o).length)
405
+ const o = this._fragmentManager;
406
+ s.reset();
407
+ const i = this._ifcSelection.bbox;
408
+ if (!Object.keys(i).length)
71
409
  return;
72
- for (const y of Object.keys(o)) {
73
- const v = s.list[y].fragments.bbox;
74
- e.addMesh(v.mesh);
410
+ for (const f of Object.keys(i)) {
411
+ const P = o.list[f].fragments.bbox;
412
+ s.addMesh(P.mesh);
75
413
  }
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;
414
+ const n = s.get(), { y: r, z: g } = n.min, { y: w, z: u } = n.max;
415
+ return n.min.y = -u, n.max.y = -g, n.min.z = r, n.max.z = w, n.translate(this._model.position), this.clearHighlight("bbox"), n;
78
416
  }
79
417
  getClassification() {
80
418
  if (this._classificationCache === null)
@@ -82,103 +420,103 @@ const z = new Pt(), qt = {
82
420
  return this._classificationCache;
83
421
  }
84
422
  getProperties(t) {
85
- const e = [], s = this._model.properties;
86
- if (!s)
423
+ const s = [], o = this._model.properties;
424
+ if (!o)
87
425
  return [];
88
- for (const o of this._indexMap[t]) {
89
- const n = s[o];
426
+ for (const i of this._indexMap[t]) {
427
+ const n = o[i];
90
428
  if (n == null)
91
429
  continue;
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)
430
+ const { name: r } = z.getEntityName(o, i);
431
+ if (r !== null) {
432
+ if (n.type === _t) {
433
+ const g = z.getPsetProps(o, i);
434
+ if (g !== null)
435
+ for (const w of g) {
436
+ if (o[w] == null)
99
437
  continue;
100
- const y = this.getProperty(x);
101
- y !== null && e.push({
102
- parentName: d,
103
- ...y
438
+ const f = this.getProperty(w);
439
+ f !== null && s.push({
440
+ parentName: r,
441
+ ...f
104
442
  });
105
443
  }
106
- } else if (n.type === lt) {
107
- const m = M.getQsetQuantities(
108
- s,
109
- o
444
+ } else if (n.type === wt) {
445
+ const g = z.getQsetQuantities(
446
+ o,
447
+ i
110
448
  );
111
- if (m !== null)
112
- for (const x of m) {
113
- const { key: a } = M.getQuantityValue(
114
- s,
115
- x
449
+ if (g !== null)
450
+ for (const w of g) {
451
+ const { key: u } = z.getQuantityValue(
452
+ o,
453
+ w
116
454
  );
117
- if (a === null)
455
+ if (u === null)
118
456
  continue;
119
- const y = this.getProperty(x);
120
- y !== null && e.push({
121
- parentName: d,
122
- ...y
457
+ const f = this.getProperty(w);
458
+ f !== null && s.push({
459
+ parentName: r,
460
+ ...f
123
461
  });
124
462
  }
125
463
  }
126
464
  }
127
465
  }
128
- return e;
466
+ return s;
129
467
  }
130
468
  getProperty(t) {
131
- const e = this._model.properties;
132
- if (e === void 0)
469
+ const s = this._model.properties;
470
+ if (s === void 0)
133
471
  return null;
134
- const { name: s } = M.getEntityName(e, t);
135
- if (s === null)
472
+ const { name: o } = z.getEntityName(s, t);
473
+ if (o === null)
136
474
  return null;
137
- const { value: o } = M.getQuantityValue(e, t);
138
- return { name: s, value: o };
139
- }
140
- highlight(t, e, s) {
141
- this._ifcSelection[t][e.uuid] = /* @__PURE__ */ new Set();
142
- const o = parseInt(s, 10);
143
- this._ifcSelection[t][e.uuid].add(s), this.addComposites(t, e, o), this.regenerate(t, e.uuid);
144
- const n = e.fragment.group;
475
+ const { value: i } = z.getQuantityValue(s, t);
476
+ return { name: o, value: i };
477
+ }
478
+ highlight(t, s, o) {
479
+ this._ifcSelection[t][s.uuid] = /* @__PURE__ */ new Set();
480
+ const i = parseInt(o, 10);
481
+ this._ifcSelection[t][s.uuid].add(o), this.addComposites(t, s, i), this.regenerate(t, s.uuid);
482
+ const n = s.fragment.group;
145
483
  if (n) {
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);
484
+ const r = n.data[i][0];
485
+ for (let g = 0; g < r.length; g++) {
486
+ const w = r[g], u = n.keyFragments[w], f = this._fragmentManager.list[u];
487
+ u in this._ifcSelection[t] || (this._ifcSelection[t][u] = /* @__PURE__ */ new Set()), this._ifcSelection[t][u].add(o), this.addComposites(t, f.mesh, i), this.regenerate(t, u);
150
488
  }
151
489
  }
152
490
  this.notifyChange(this);
153
491
  }
154
- highlightById(t, e = "selection") {
155
- for (const s of Object.keys(t)) {
156
- s in this._ifcSelection[e] || (this._ifcSelection[e][s] = /* @__PURE__ */ new Set());
157
- const o = this._fragmentManager.list[s], n = /* @__PURE__ */ new Set();
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);
162
- this.regenerate(e, s);
492
+ highlightById(t, s = "selection") {
493
+ for (const o of Object.keys(t)) {
494
+ o in this._ifcSelection[s] || (this._ifcSelection[s][o] = /* @__PURE__ */ new Set());
495
+ const i = this._fragmentManager.list[o], n = /* @__PURE__ */ new Set();
496
+ for (const r of t[o])
497
+ this._ifcSelection[s][o].add(r), n.add(parseInt(r, 10));
498
+ for (const r of n)
499
+ this.addComposites(s, i.mesh, r);
500
+ this.regenerate(s, o);
163
501
  }
164
502
  this.notifyChange(this);
165
503
  }
166
- pick(t, e) {
167
- return super.pick(t, e).map((s) => ({
168
- ...s,
504
+ pick(t, s) {
505
+ return super.pick(t, s).map((o) => ({
506
+ ...o,
169
507
  entity: this,
170
- features: s.features,
508
+ features: o.features,
171
509
  isIFCPickResult: !0,
172
- object: s.object
510
+ object: o.object
173
511
  }));
174
512
  }
175
513
  pickFeaturesFrom(t) {
176
- var s, o, n;
177
- const e = t.object;
178
- if (e.fragment != null && t.instanceId != null && t.face) {
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 }];
514
+ var o, i, n;
515
+ const s = t.object;
516
+ if (s.fragment != null && t.instanceId != null && t.face) {
517
+ const r = s.fragment.getVertexBlockID(s.geometry, t.face.a), g = (o = s.fragment.getItemID(t.instanceId, r)) == null ? void 0 : o.replace(/\..*/, "");
518
+ if (g && ((n = (i = s.fragment.group) == null ? void 0 : i.properties) == null ? void 0 : n[g]) != null) {
519
+ const u = s.fragment.group.properties[g], C = [{ ifcProperties: this.getProperties(g), itemProperties: u }];
182
520
  return t.features = C, C;
183
521
  }
184
522
  }
@@ -192,345 +530,351 @@ const z = new Pt(), qt = {
192
530
  ]), this._classificationCache.length === 0 && (this._classificationCache = await this.regenerateClassification([
193
531
  "entities"
194
532
  /* ENTITY */
195
- ])), this._fragmentBoundingBox = await this._components.tools.get(xt);
533
+ ])), this._fragmentBoundingBox = await this._components.tools.get(Xt);
196
534
  }
197
535
  async preprocess() {
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);
201
- e.settings.webIfc.COORDINATE_TO_ORIGIN = !0, e.settings.webIfc.OPTIMIZE_PROFILES = !0;
202
- const s = new Uint8Array(t);
203
- this._model = await e.load(s, this._source.name), this._model.rotateX(Math.PI / 2);
204
- const o = new St();
536
+ const t = await R.fetchArrayBuffer(this._source.url);
537
+ this._fragmentManager = await this._components.tools.get(Zt), this._fragmentClassifier = await this._components.tools.get(Qt);
538
+ const s = new Jt(this._components);
539
+ s.settings.webIfc.COORDINATE_TO_ORIGIN = !0, s.settings.webIfc.OPTIMIZE_PROFILES = !0;
540
+ const o = new Uint8Array(t);
541
+ this._model = await s.load(o, this._source.name), this._model.rotateX(Math.PI / 2);
542
+ const i = new Y();
205
543
  if (this._source.at)
206
- this._source.at.toVector3(o), this._model.position.copy(o);
544
+ this._source.at.toVector3(i), this._model.position.copy(i);
207
545
  else {
208
- const d = this._model.coordinationMatrix.clone().invert();
209
- o.applyMatrix4(d), this._model.position.set(o.x, -o.z, o.y);
546
+ const r = this._model.coordinationMatrix.clone().invert();
547
+ i.applyMatrix4(r), this._model.position.set(i.x, -i.z, i.y);
210
548
  }
211
549
  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);
212
- const n = j.getContext(this._source.url);
213
- $(this, { filename: n.filename }), this.notifyChange(this.object3d);
214
- }
215
- addComposites(t, e, s) {
216
- this.addHighlightToFragment(t, e.fragment);
217
- const o = e.fragment.composites[s];
218
- if (o)
219
- for (let n = 1; n < o; n++) {
220
- const d = It(s, n);
221
- this._ifcSelection[t][e.uuid].add(d);
550
+ const n = R.getContext(this._source.url);
551
+ K(this, { filename: n.filename }), this.notifyChange(this.object3d);
552
+ }
553
+ addComposites(t, s, o) {
554
+ this.addHighlightToFragment(t, s.fragment);
555
+ const i = s.fragment.composites[o];
556
+ if (i)
557
+ for (let n = 1; n < i; n++) {
558
+ const r = Kt(o, n);
559
+ this._ifcSelection[t][s.uuid].add(r);
222
560
  }
223
561
  }
224
- addHighlightToFragment(t, e) {
225
- if (!(t in e.fragments)) {
226
- const s = e.addFragment(t, [qt[t]]);
227
- e.blocks.count > 1 && (s.setInstance(0, {
228
- ids: Array.from(e.ids),
229
- transform: z
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);
562
+ addHighlightToFragment(t, s) {
563
+ if (!(t in s.fragments)) {
564
+ const o = s.addFragment(t, [Ie[t]]);
565
+ s.blocks.count > 1 && (o.setInstance(0, {
566
+ ids: Array.from(s.ids),
567
+ transform: j
568
+ }), o.blocks.setVisibility(!1)), this._model.add(o.mesh), o.mesh.renderOrder = 30, o.mesh.frustumCulled = !1, o.mesh.name = t, o.mesh.updateMatrixWorld(!0);
231
569
  }
232
570
  }
233
571
  initializeEntityIndexes() {
234
572
  this._indexMap = {};
235
573
  const t = this._model.properties;
236
574
  if (t !== void 0)
237
- for (const e of ee)
238
- M.getRelationMap(t, e, (s, o) => {
239
- const n = t[s];
240
- te.includes(n.type) || this.setEntityIndex(s);
241
- for (const d of o)
242
- this.setEntityIndex(d).add(s);
575
+ for (const s of ke)
576
+ z.getRelationMap(t, s, (o, i) => {
577
+ const n = t[o];
578
+ Me.includes(n.type) || this.setEntityIndex(o);
579
+ for (const r of i)
580
+ this.setEntityIndex(r).add(o);
243
581
  });
244
582
  }
245
- regenerate(t, e) {
246
- this.updateFragmentFill(t, e);
247
- }
248
- async regenerateClassification(t, e = {}) {
249
- const s = this._fragmentClassifier.get(), o = [], n = t[0], d = s[n];
250
- if (n == null || d == null)
251
- return o;
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(
583
+ regenerate(t, s) {
584
+ this.updateFragmentFill(t, s);
585
+ }
586
+ async regenerateClassification(t, s = {}) {
587
+ const o = this._fragmentClassifier.get(), i = [], n = t[0], r = o[n];
588
+ if (n == null || r == null)
589
+ return i;
590
+ for (const g of Object.keys(r)) {
591
+ const w = { ...s, [n]: [g] }, u = await this._fragmentClassifier.find(w);
592
+ if (Object.keys(u).length > 0) {
593
+ const P = n[0].toUpperCase() + n.slice(1), I = await this.regenerateClassification(
256
594
  t.slice(1),
257
- x
595
+ w
258
596
  );
259
- o.push({ children: I, fragments: a, name: m, treeItemName: v });
597
+ i.push({ children: I, fragments: u, name: g, treeItemName: P });
260
598
  }
261
599
  }
262
- return o;
600
+ return i;
263
601
  }
264
602
  setEntityIndex(t) {
265
603
  return t in this._indexMap || (this._indexMap[t] = /* @__PURE__ */ new Set()), this._indexMap[t];
266
604
  }
267
- updateFragmentFill(t, e) {
268
- const s = this._ifcSelection[t][e], o = this._fragmentManager.list[e];
269
- if (o == null)
605
+ updateFragmentFill(t, s) {
606
+ const o = this._ifcSelection[t][s], i = this._fragmentManager.list[s];
607
+ if (i == null)
270
608
  return;
271
- const n = o.fragments[t];
609
+ const n = i.fragments[t];
272
610
  if (n == null)
273
611
  return;
274
- const d = o.mesh.parent;
275
- if (d == null)
612
+ const r = i.mesh.parent;
613
+ if (r == null)
276
614
  return;
277
- if (d.add(n.mesh), n.blocks.count > 1)
278
- o.getInstance(0, z), n.setInstance(0, {
279
- ids: Array.from(o.ids),
280
- transform: z
281
- }), n.blocks.setVisibility(!0, s, !0);
615
+ if (r.add(n.mesh), n.blocks.count > 1)
616
+ i.getInstance(0, j), n.setInstance(0, {
617
+ ids: Array.from(i.ids),
618
+ transform: j
619
+ }), n.blocks.setVisibility(!0, o, !0);
282
620
  else {
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++;
621
+ let w = 0;
622
+ for (const u of o) {
623
+ n.mesh.count = w + 1;
624
+ const { instanceID: f } = i.getInstanceAndBlockID(u);
625
+ i.getInstance(f, j), n.setInstance(w, { ids: [u], transform: j }), w++;
288
626
  }
289
627
  }
290
628
  }
291
629
  };
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 });
630
+ m(U, "isIFCEntity", (t) => $(t) && t.isIfcEntity), m(U, "isIFCPickResult", (t) => $(t) && U.isIFCEntity(t.entity));
631
+ let J = U;
632
+ class De extends ee {
633
+ constructor(e, t, s) {
634
+ super(e, t, s, { visibility: !0 });
297
635
  }
298
636
  }
299
- const ne = { class: "d-flex" }, oe = ["title"], ie = ["id"], ae = { class: "list-unstyled border-start" }, re = /* @__PURE__ */ it({
637
+ const Ne = { class: "d-flex" }, Ae = ["title"], Le = ["id"], ze = { class: "list-unstyled border-start" }, Oe = /* @__PURE__ */ q({
300
638
  __name: "IfcSubtree",
301
639
  props: {
302
640
  classificationElement: {},
303
641
  ifcEntity: {}
304
642
  },
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));
643
+ setup(l) {
644
+ const e = l, t = lt.generateUUID(), s = `#${t}`, o = O(!1), i = Tt(), r = Et().getModule(Ft);
645
+ function g() {
646
+ if (r == null) {
647
+ console.warn("Cannot clip IFC element, ClippingBoxAnalysis module is not present");
648
+ return;
649
+ }
650
+ const f = e.ifcEntity.getBoundingBoxById(e.classificationElement.fragments);
651
+ f && !f.isEmpty() && r.setClippingBox(f);
310
652
  }
311
- function m() {
312
- s.value = !0, i.ifcEntity.clearHighlight(), i.ifcEntity.highlightById(i.classificationElement.fragments), setTimeout(() => s.value = !1, 2e3);
653
+ function w() {
654
+ o.value = !0, e.ifcEntity.clearHighlight(), e.ifcEntity.highlightById(e.classificationElement.fragments), setTimeout(() => o.value = !1, 2e3);
313
655
  }
314
- function x() {
315
- const a = i.ifcEntity.getBoundingBoxById(i.classificationElement.fragments);
316
- a && !a.isEmpty() && o.lookTopDownAt(a);
656
+ function u() {
657
+ const f = e.ifcEntity.getBoundingBoxById(e.classificationElement.fragments);
658
+ f && !f.isEmpty() && i.lookTopDownAt(f);
317
659
  }
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([
660
+ return (f, C) => {
661
+ const P = Rt("IfcSubtree", !0);
662
+ return D(), N("div", null, [
663
+ v("div", Ne, [
664
+ v("span", {
665
+ class: it([
324
666
  "border rounded px-1 py-0 fw-normal",
325
- s.value ? "text-danger border-danger" : "text-secondary border-secondary"
667
+ o.value ? "text-danger border-danger" : "text-secondary border-secondary"
326
668
  ]),
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, {
669
+ title: f.classificationElement.treeItemName
670
+ }, jt(f.classificationElement.treeItemName), 11, Ae),
671
+ f.classificationElement.children.length > 0 ? (D(), ot(nt, { key: 0 }, {
672
+ default: at(() => [
673
+ A(X, {
332
674
  title: "Expand group",
333
675
  icon: "bi-chevron-down",
334
676
  "data-bs-toggle": "collapse",
335
- "data-bs-target": e,
336
- "aria-controls": W(t),
677
+ "data-bs-target": s,
678
+ "aria-controls": M(t),
337
679
  "aria-expanded": "true"
338
680
  }, null, 8, ["aria-controls"])
339
681
  ]),
340
682
  _: 1
341
683
  })) : 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
684
+ A(Bt, {
685
+ class: it(["label", o.value ? "text-danger-emphasis" : "text-muted"]),
686
+ text: f.classificationElement.name,
687
+ title: `Zoom to ${f.classificationElement.name}`,
688
+ onClick: u
347
689
  }, null, 8, ["class", "text", "title"]),
348
- L(Q, { class: "ms-1" }, {
349
- default: K(() => [
350
- L(G, {
690
+ A(nt, { class: "ms-1" }, {
691
+ default: at(() => [
692
+ A(X, {
351
693
  title: "Highlight",
352
694
  icon: "bi-highlighter",
353
- onClick: m
695
+ onClick: w
354
696
  }),
355
- L(G, {
697
+ M(r) != null ? (D(), ot(X, {
698
+ key: 0,
356
699
  title: "Clip to",
357
700
  icon: "bi-bounding-box",
358
- onClick: d
359
- })
701
+ onClick: g
702
+ })) : H("", !0)
360
703
  ]),
361
704
  _: 1
362
705
  })
363
706
  ]),
364
- a.classificationElement.children.length > 0 ? (k(), A("div", {
707
+ f.classificationElement.children.length > 0 ? (D(), N("div", {
365
708
  key: 0,
366
- id: W(t),
709
+ id: M(t),
367
710
  class: "collapse show"
368
711
  }, [
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
712
+ v("ul", ze, [
713
+ (D(!0), N(tt, null, ft(f.classificationElement.children, (I, T) => (D(), N("li", { key: T }, [
714
+ A(P, {
715
+ "ifc-entity": e.ifcEntity,
716
+ "classification-element": I
374
717
  }, null, 8, ["ifc-entity", "classification-element"])
375
718
  ]))), 128))
376
719
  ])
377
- ], 8, ie)) : H("", !0)
720
+ ], 8, Le)) : H("", !0)
378
721
  ]);
379
722
  };
380
723
  }
381
- }), ce = /* @__PURE__ */ et(re, [["__scopeId", "data-v-c2ab888d"]]), le = { key: 0 }, ue = /* @__PURE__ */ it({
724
+ }), Re = /* @__PURE__ */ dt(Oe, [["__scopeId", "data-v-804ca598"]]), je = { key: 0 }, Ue = /* @__PURE__ */ q({
382
725
  __name: "IfcPropertyView",
383
726
  props: {
384
727
  dataset: {}
385
728
  },
386
- setup(p) {
387
- const i = kt(), t = p, e = Mt(t.dataset, "isPreloaded");
388
- function s() {
389
- const n = o();
729
+ setup(l) {
730
+ const e = Mt(), t = l, s = kt(t.dataset, "isPreloaded");
731
+ function o() {
732
+ const n = i();
390
733
  return n == null ? null : n.getClassification();
391
734
  }
392
- function o() {
393
- const n = i.getEntity(t.dataset);
735
+ function i() {
736
+ const n = e.getEntity(t.dataset);
394
737
  return n ?? null;
395
738
  }
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, {
400
- "ifc-entity": o(),
401
- "classification-element": m
739
+ return (n, r) => M(s) ? (D(), N("div", je, [
740
+ v("ul", null, [
741
+ (D(!0), N(tt, null, ft(o(), (g, w) => (D(), N("li", { key: w }, [
742
+ A(Re, {
743
+ "ifc-entity": i(),
744
+ "classification-element": g
402
745
  }, null, 8, ["ifc-entity", "classification-element"])
403
746
  ]))), 128))
404
747
  ])
405
748
  ])) : H("", !0);
406
749
  }
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();
750
+ }), Ve = /* @__PURE__ */ dt(Ue, [["__scopeId", "data-v-d2d82ae7"]]), Ye = (l) => {
751
+ if (vt(l)) {
752
+ const e = l.object;
753
+ if (e.fragment != null && l.face && l.instanceId != null) {
754
+ const t = e.fragment.getVertexBlockID(e.geometry, l.face.a), s = e.fragment.getItemID(l.instanceId, t).replace(/\..*/, "");
755
+ return l.entity.highlight("selection", e, s), () => l.entity.clearHighlight();
413
756
  }
414
757
  }
415
758
  return null;
416
- }, pe = (p) => ({
417
- name: p.filename,
759
+ }, $e = (l) => ({
760
+ name: l.filename,
418
761
  source: {
419
- url: p.file
762
+ url: l.file
420
763
  },
421
764
  type: "ifc",
422
765
  visible: !0
423
- }), me = (p, i) => {
424
- var m, x, a, y, C, v, I, B, r;
425
- if (!ut(p))
766
+ }), Ge = (l, e) => {
767
+ var g, w, u, f, C, P, I, T, a;
768
+ if (!vt(l))
426
769
  return;
427
- const t = (m = p.features) == null ? void 0 : m.at(0);
770
+ const t = (g = l.features) == null ? void 0 : g.at(0);
428
771
  if (!t)
429
772
  return;
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;
432
- e.push({
773
+ e.has("IFC") || e.set("IFC", []);
774
+ const s = e.get("IFC"), { ifcProperties: o, itemProperties: i } = t, n = "NULL", r = ((w = i.Name) == null ? void 0 : w.value) ?? n;
775
+ s.push({
433
776
  key: "Site",
434
- value: ((y = (a = p.entity.object3d.userData) == null ? void 0 : a.dataset) == null ? void 0 : y.name) ?? n
435
- }), e.push({
777
+ value: ((f = (u = l.entity.object3d.userData) == null ? void 0 : u.dataset) == null ? void 0 : f.name) ?? n
778
+ }), s.push({
436
779
  key: "IFCType",
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({
780
+ value: te[i.type] ?? n
781
+ }), s.push({ key: "Name", value: r }), s.push({ key: "ID", value: i.expressID }), s.push({ key: "GlobalId", value: ((C = i.GlobalId) == null ? void 0 : C.value) ?? n }), ((P = i.Description) == null ? void 0 : P.value) != null && s.push({ key: "Description", value: i.Description.value }), ((I = i.PredefinedType) == null ? void 0 : I.value) != null && s.push({ key: "PredefinedType", value: i.PredefinedType.value }), ((T = i.ObjectType) == null ? void 0 : T.value) != null && s.push({ key: "ObjectType", value: i.ObjectType.value });
782
+ for (const { name: p, parentName: d, value: c } of o)
783
+ e.has(d) || e.set(d, []), (a = e.get(d)) == null || a.push({ key: p, value: c });
784
+ }, He = (l) => {
785
+ const e = l.dataset, t = e.config, s = pt(t.source.position ?? e.get("position")), o = new J({
443
786
  ...t.source,
444
- at: e,
445
- name: i.name
787
+ at: s,
788
+ name: e.name
446
789
  });
447
- return Promise.resolve(s);
790
+ return Promise.resolve(o);
448
791
  };
449
- class Me {
792
+ class mn {
450
793
  constructor() {
451
- w(this, "name", "IFC");
794
+ m(this, "id", "builtin-ifc-loader");
795
+ m(this, "name", "IFC");
452
796
  }
453
- async initialize(i) {
454
- i.datasets.registerDatasetType("ifc", {
455
- attributeExtractor: me,
456
- entityBuilder: fe,
797
+ async initialize(e) {
798
+ e.datasets.registerDatasetType("ifc", {
799
+ attributeExtractor: Ge,
800
+ entityBuilder: He,
457
801
  fileExtensions: ["ifc"],
458
- highlight: he,
802
+ highlight: Ye,
459
803
  icon: "bi-building",
460
- loader: pe,
804
+ loader: $e,
461
805
  name: "IFC",
462
- propertyView: de
463
- }), pt.registerInspector("IfcEntity", se), await j.fetch("web-ifc.wasm").catch((t) => {
806
+ propertyView: Ve
807
+ }), Yt.registerInspector("IfcEntity", De), await R.fetch("web-ifc.wasm").catch((t) => {
464
808
  console.warn("Could not load web-ifc.wasm", t);
465
809
  });
466
810
  }
467
811
  }
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) {
812
+ const B = new ht();
813
+ let We = class extends Dt {
814
+ constructor(e) {
815
+ super(e), this.propertyNameMapping = {}, this.customPropertyMapping = {};
816
+ }
817
+ load(e, t, s, o) {
818
+ const i = this, n = new Nt(this.manager);
819
+ n.setPath(this.path), n.setResponseType("arraybuffer"), n.setRequestHeader(this.requestHeader), n.setWithCredentials(this.withCredentials), n.load(e, function(r) {
476
820
  try {
477
- t(o.parse(d));
478
- } catch (m) {
479
- s ? s(m) : console.error(m), o.manager.itemError(i);
821
+ t(i.parse(r));
822
+ } catch (g) {
823
+ o ? o(g) : console.error(g), i.manager.itemError(e);
480
824
  }
481
- }, e, s);
825
+ }, s, o);
482
826
  }
483
- setPropertyNameMapping(i) {
484
- this.propertyNameMapping = i;
827
+ setPropertyNameMapping(e) {
828
+ this.propertyNameMapping = e;
485
829
  }
486
- setCustomPropertyNameMapping(i) {
487
- this.customPropertyMapping = i;
830
+ setCustomPropertyNameMapping(e) {
831
+ this.customPropertyMapping = e;
488
832
  }
489
- parse(i) {
490
- function t(r, u = 0) {
491
- const l = /^ply([\s\S]*)end_header(\r\n|\r|\n)/;
833
+ parse(e) {
834
+ function t(a, p = 0) {
835
+ const d = /^ply([\s\S]*)end_header(\r\n|\r|\n)/;
492
836
  let c = "";
493
- const h = l.exec(r);
837
+ const h = d.exec(a);
494
838
  h !== null && (c = h[1]);
495
- const f = {
839
+ const y = {
496
840
  comments: [],
497
841
  elements: [],
498
- headerLength: u,
842
+ headerLength: p,
499
843
  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]), _;
844
+ }, _ = c.split(/\r\n|\r|\n/);
845
+ let b;
846
+ function k(S, E) {
847
+ const x = { type: S[0] };
848
+ return x.type === "list" ? (x.name = S[3], x.countType = S[1], x.itemType = S[2]) : x.name = S[1], x.name in E && (x.name = E[x.name]), x;
505
849
  }
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) {
850
+ for (let S = 0; S < _.length; S++) {
851
+ let E = _[S];
852
+ if (E = E.trim(), E === "") continue;
853
+ const x = E.split(/\s+/), G = x.shift();
854
+ switch (E = x.join(" "), G) {
511
855
  case "format":
512
- f.format = _[0], f.version = _[1];
856
+ y.format = x[0], y.version = x[1];
513
857
  break;
514
858
  case "comment":
515
- f.comments.push(P);
859
+ y.comments.push(E);
516
860
  break;
517
861
  case "element":
518
- g !== void 0 && f.elements.push(g), g = {}, g.name = _[0], g.count = parseInt(_[1]), g.properties = [];
862
+ b !== void 0 && y.elements.push(b), b = {}, b.name = x[0], b.count = parseInt(x[1]), b.properties = [];
519
863
  break;
520
864
  case "property":
521
- g.properties.push(F(_, B.propertyNameMapping));
865
+ b.properties.push(k(x, T.propertyNameMapping));
522
866
  break;
523
867
  case "obj_info":
524
- f.objInfo = P;
868
+ y.objInfo = E;
525
869
  break;
526
870
  default:
527
- console.log("unhandled", V, _);
871
+ console.log("unhandled", G, x);
528
872
  }
529
873
  }
530
- return g !== void 0 && f.elements.push(g), f;
874
+ return b !== void 0 && y.elements.push(b), y;
531
875
  }
532
- function e(r, u) {
533
- switch (u) {
876
+ function s(a, p) {
877
+ switch (p) {
534
878
  case "char":
535
879
  case "uchar":
536
880
  case "short":
@@ -543,32 +887,32 @@ let ge = class extends Nt {
543
887
  case "uint16":
544
888
  case "int32":
545
889
  case "uint32":
546
- return parseInt(r);
890
+ return parseInt(a);
547
891
  case "float":
548
892
  case "double":
549
893
  case "float32":
550
894
  case "float64":
551
- return parseFloat(r);
895
+ return parseFloat(a);
552
896
  }
553
897
  }
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));
898
+ function o(a, p) {
899
+ const d = {};
900
+ for (let c = 0; c < a.length; c++) {
901
+ if (p.empty()) return null;
902
+ if (a[c].type === "list") {
903
+ const h = [], y = s(p.next(), a[c].countType);
904
+ for (let _ = 0; _ < y; _++) {
905
+ if (p.empty()) return null;
906
+ h.push(s(p.next(), a[c].itemType));
563
907
  }
564
- l[r[c].name] = h;
908
+ d[a[c].name] = h;
565
909
  } else
566
- l[r[c].name] = e(u.next(), r[c].type);
910
+ d[a[c].name] = s(p.next(), a[c].type);
567
911
  }
568
- return l;
912
+ return d;
569
913
  }
570
- function o() {
571
- const r = {
914
+ function i() {
915
+ const a = {
572
916
  indices: [],
573
917
  vertices: [],
574
918
  normals: [],
@@ -577,174 +921,174 @@ let ge = class extends Nt {
577
921
  colors: [],
578
922
  faceVertexColors: []
579
923
  };
580
- for (const u of Object.keys(B.customPropertyMapping))
581
- r[u] = [];
582
- return r;
924
+ for (const p of Object.keys(T.customPropertyMapping))
925
+ a[p] = [];
926
+ return a;
583
927
  }
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;
928
+ function n(a) {
929
+ const p = a.map((c) => c.name);
930
+ function d(c) {
931
+ for (let h = 0, y = c.length; h < y; h++) {
932
+ const _ = c[h];
933
+ if (p.includes(_)) return _;
590
934
  }
591
935
  return null;
592
936
  }
593
937
  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"])
938
+ attrX: d(["x", "px", "posx"]) || "x",
939
+ attrY: d(["y", "py", "posy"]) || "y",
940
+ attrZ: d(["z", "pz", "posz"]) || "z",
941
+ attrNX: d(["nx", "normalx"]),
942
+ attrNY: d(["ny", "normaly"]),
943
+ attrNZ: d(["nz", "normalz"]),
944
+ attrS: d(["s", "u", "texture_u", "tx"]),
945
+ attrT: d(["t", "v", "texture_v", "ty"]),
946
+ attrR: d(["red", "diffuse_red", "r", "diffuse_r"]),
947
+ attrG: d(["green", "diffuse_green", "g", "diffuse_g"]),
948
+ attrB: d(["blue", "diffuse_blue", "b", "diffuse_b"])
605
949
  };
606
950
  }
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);
951
+ function r(a, p) {
952
+ const d = i(), c = /end_header\s+(\S[\s\S]*\S|\S)\s*$/;
953
+ let h, y;
954
+ (y = c.exec(a)) !== null ? h = y[1].split(/\s+/) : h = [];
955
+ const _ = new qe(h);
956
+ t: for (let b = 0; b < p.elements.length; b++) {
957
+ const k = p.elements[b], S = n(k.properties);
958
+ for (let E = 0; E < k.count; E++) {
959
+ const x = o(k.properties, _);
960
+ if (!x) break t;
961
+ w(d, k.name, x, S);
618
962
  }
619
963
  }
620
- return m(l);
964
+ return g(d);
621
965
  }
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
966
+ function g(a) {
967
+ let p = new At();
968
+ a.indices.length > 0 && p.setIndex(a.indices), p.setAttribute("position", new L(a.vertices, 3)), a.normals.length > 0 && p.setAttribute("normal", new L(a.normals, 3)), a.uvs.length > 0 && p.setAttribute("uv", new L(a.uvs, 2)), a.colors.length > 0 && p.setAttribute("color", new L(a.colors, 3)), (a.faceVertexUvs.length > 0 || a.faceVertexColors.length > 0) && (p = p.toNonIndexed(), a.faceVertexUvs.length > 0 && p.setAttribute("uv", new L(a.faceVertexUvs, 2)), a.faceVertexColors.length > 0 && p.setAttribute("color", new L(a.faceVertexColors, 3)));
969
+ for (const d of Object.keys(T.customPropertyMapping))
970
+ a[d].length > 0 && p.setAttribute(
971
+ d,
972
+ new L(
973
+ a[d],
974
+ T.customPropertyMapping[d].length
631
975
  )
632
976
  );
633
- return u.computeBoundingSphere(), u;
977
+ return p.computeBoundingSphere(), p;
634
978
  }
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));
979
+ function w(a, p, d, c) {
980
+ if (p === "vertex") {
981
+ a.vertices.push(d[c.attrX], d[c.attrY], d[c.attrZ]), c.attrNX !== null && c.attrNY !== null && c.attrNZ !== null && a.normals.push(d[c.attrNX], d[c.attrNY], d[c.attrNZ]), c.attrS !== null && c.attrT !== null && a.uvs.push(d[c.attrS], d[c.attrT]), c.attrR !== null && c.attrG !== null && c.attrB !== null && (B.setRGB(
982
+ d[c.attrR] / 255,
983
+ d[c.attrG] / 255,
984
+ d[c.attrB] / 255,
985
+ st
986
+ ), a.colors.push(B.r, B.g, B.b));
987
+ for (const h of Object.keys(T.customPropertyMapping))
988
+ for (const y of T.customPropertyMapping[h])
989
+ a[h].push(d[y]);
990
+ } else if (p === "face") {
991
+ const h = d.vertex_indices || d.vertex_index, y = d.texcoord;
992
+ h.length === 3 ? (a.indices.push(h[0], h[1], h[2]), y && y.length === 6 && (a.faceVertexUvs.push(y[0], y[1]), a.faceVertexUvs.push(y[2], y[3]), a.faceVertexUvs.push(y[4], y[5]))) : h.length === 4 && (a.indices.push(h[0], h[1], h[3]), a.indices.push(h[1], h[2], h[3])), c.attrR !== null && c.attrG !== null && c.attrB !== null && (B.setRGB(
993
+ d[c.attrR] / 255,
994
+ d[c.attrG] / 255,
995
+ d[c.attrB] / 255,
996
+ st
997
+ ), a.faceVertexColors.push(B.r, B.g, B.b), a.faceVertexColors.push(B.r, B.g, B.b), a.faceVertexColors.push(B.r, B.g, B.b));
654
998
  }
655
999
  }
656
- function a(r, u) {
657
- const l = {};
1000
+ function u(a, p) {
1001
+ const d = {};
658
1002
  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;
1003
+ for (let h = 0; h < p.length; h++) {
1004
+ const y = p[h], _ = y.valueReader;
1005
+ if (y.type === "list") {
1006
+ const b = [], k = y.countReader.read(a + c);
1007
+ c += y.countReader.size;
1008
+ for (let S = 0; S < k; S++)
1009
+ b.push(_.read(a + c)), c += _.size;
1010
+ d[y.name] = b;
667
1011
  } else
668
- l[f.name] = b.read(r + c), c += b.size;
1012
+ d[y.name] = _.read(a + c), c += _.size;
669
1013
  }
670
- return [l, c];
1014
+ return [d, c];
671
1015
  }
672
- function y(r, u, l) {
673
- function c(h, f, b) {
674
- switch (f) {
1016
+ function f(a, p, d) {
1017
+ function c(h, y, _) {
1018
+ switch (y) {
675
1019
  // corespondences for non-specific length types here match rply:
676
1020
  case "int8":
677
1021
  case "char":
678
- return { read: (g) => h.getInt8(g), size: 1 };
1022
+ return { read: (b) => h.getInt8(b), size: 1 };
679
1023
  case "uint8":
680
1024
  case "uchar":
681
- return { read: (g) => h.getUint8(g), size: 1 };
1025
+ return { read: (b) => h.getUint8(b), size: 1 };
682
1026
  case "int16":
683
1027
  case "short":
684
- return { read: (g) => h.getInt16(g, b), size: 2 };
1028
+ return { read: (b) => h.getInt16(b, _), size: 2 };
685
1029
  case "uint16":
686
1030
  case "ushort":
687
- return { read: (g) => h.getUint16(g, b), size: 2 };
1031
+ return { read: (b) => h.getUint16(b, _), size: 2 };
688
1032
  case "int32":
689
1033
  case "int":
690
- return { read: (g) => h.getInt32(g, b), size: 4 };
1034
+ return { read: (b) => h.getInt32(b, _), size: 4 };
691
1035
  case "uint32":
692
1036
  case "uint":
693
- return { read: (g) => h.getUint32(g, b), size: 4 };
1037
+ return { read: (b) => h.getUint32(b, _), size: 4 };
694
1038
  case "float32":
695
1039
  case "float":
696
- return { read: (g) => h.getFloat32(g, b), size: 4 };
1040
+ return { read: (b) => h.getFloat32(b, _), size: 4 };
697
1041
  case "float64":
698
1042
  case "double":
699
- return { read: (g) => h.getFloat64(g, b), size: 8 };
1043
+ return { read: (b) => h.getFloat64(b, _), size: 8 };
700
1044
  }
701
1045
  }
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);
1046
+ for (let h = 0, y = a.length; h < y; h++) {
1047
+ const _ = a[h];
1048
+ _.type === "list" ? (_.countReader = c(p, _.countType, d), _.valueReader = c(p, _.itemType, d)) : _.valueReader = c(p, _.type, d);
705
1049
  }
706
1050
  }
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);
1051
+ function C(a, p) {
1052
+ const d = i(), c = p.format === "binary_little_endian", h = new DataView(a, p.headerLength);
1053
+ let y, _ = 0;
1054
+ for (let b = 0; b < p.elements.length; b++) {
1055
+ const k = p.elements[b], S = k.properties, E = n(S);
1056
+ f(S, h, c);
1057
+ for (let x = 0; x < k.count; x++) {
1058
+ y = u(_, S), _ += y[1];
1059
+ const G = y[0];
1060
+ w(d, k.name, G, E);
717
1061
  }
718
1062
  }
719
- return m(l);
1063
+ return g(d);
720
1064
  }
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);
1065
+ function P(a) {
1066
+ let p = 0, d = !0, c = "";
1067
+ const h = [], y = new TextDecoder().decode(a.subarray(0, 5)), _ = /^ply\r\n/.test(y);
724
1068
  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 };
1069
+ const b = String.fromCharCode(a[p++]);
1070
+ b !== `
1071
+ ` && b !== "\r" ? c += b : (c === "end_header" && (d = !1), c !== "" && (h.push(c), c = ""));
1072
+ } while (d && p < a.length);
1073
+ return _ === !0 && p++, { headerText: h.join("\r") + "\r", headerLength: p };
730
1074
  }
731
1075
  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);
1076
+ const T = this;
1077
+ if (e instanceof ArrayBuffer) {
1078
+ const a = new Uint8Array(e), { headerText: p, headerLength: d } = P(a), c = t(p, d);
735
1079
  if (c.format === "ascii") {
736
- const h = new TextDecoder().decode(r);
737
- I = d(h, c);
1080
+ const h = new TextDecoder().decode(a);
1081
+ I = r(h, c);
738
1082
  } else
739
- I = C(i, c);
1083
+ I = C(e, c);
740
1084
  } else
741
- I = d(i, t(i));
1085
+ I = r(e, t(e));
742
1086
  return I;
743
1087
  }
744
1088
  };
745
- class ye {
746
- constructor(i) {
747
- this.arr = i, this.i = 0;
1089
+ class qe {
1090
+ constructor(e) {
1091
+ this.arr = e, this.i = 0;
748
1092
  }
749
1093
  empty() {
750
1094
  return this.i >= this.arr.length;
@@ -753,138 +1097,141 @@ class ye {
753
1097
  return this.arr[this.i++];
754
1098
  }
755
1099
  }
756
- const D = class D extends Dt {
1100
+ const V = class V extends ct {
757
1101
  constructor() {
758
1102
  super(...arguments);
759
- w(this, "isPickableFeatures", !0);
760
- w(this, "isPlyMesh", !0);
1103
+ m(this, "isPickableFeatures", !0);
1104
+ m(this, "isPlyMesh", !0);
761
1105
  }
762
1106
  pickFeaturesFrom(t) {
763
1107
  if (this.geometry.hasAttribute("color") && t.face) {
764
- const e = this.geometry.getAttribute("color").array, s = t.face, n = [{ color: new nt(
765
- e[s.a * 3],
766
- e[s.a * 3 + 1],
767
- e[s.a * 3 + 2]
1108
+ const s = this.geometry.getAttribute("color").array, o = t.face, n = [{ color: new ht(
1109
+ s[o.a * 3],
1110
+ s[o.a * 3 + 1],
1111
+ s[o.a * 3 + 2]
768
1112
  ) }];
769
1113
  return t.features = n, n;
770
1114
  }
771
1115
  return [];
772
1116
  }
773
1117
  };
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 {
1118
+ m(V, "isPlyMesh", (t) => $(t) && t.isPlyMesh), m(V, "isPlyPickResult", (t) => $(t) && V.isPlyMesh(t == null ? void 0 : t.object));
1119
+ let W = V;
1120
+ class Xe extends gt {
777
1121
  constructor(t) {
778
- super(new tt());
779
- w(this, "isPlyEntity", !0);
780
- w(this, "source");
1122
+ super(new ut());
1123
+ m(this, "isPlyEntity", !0);
1124
+ m(this, "source");
781
1125
  this.source = t;
782
1126
  }
783
1127
  async preprocess() {
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
1128
+ const t = await R.fetchArrayBuffer(this.source.url), s = this.source.at.as(this.source.featureProjection).toVector3(), i = new We().parse(t), n = new Lt({
1129
+ side: zt
786
1130
  });
787
- o.hasAttribute("color") && (n.vertexColors = !0), o.computeVertexNormals();
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);
1131
+ i.hasAttribute("color") && (n.vertexColors = !0), i.computeVertexNormals();
1132
+ const r = new W(i, n);
1133
+ r.name = "plyModel", i.computeBoundingBox(), r.position.copy(s), r.updateWorldMatrix(!0, !0), this.object3d.add(r), this.onObjectCreated(r);
1134
+ const g = R.getContext(this.source.url);
1135
+ K(this, { filename: g.filename }), this.notifyChange(this.object3d);
792
1136
  }
793
1137
  }
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({
796
- ...e.source,
797
- at: s,
1138
+ const Ze = (l) => {
1139
+ const { dataset: e, instance: t } = l, s = e.config, o = pt(s.source.position ?? e.get("position")), i = new Xe({
1140
+ ...s.source,
1141
+ at: o,
798
1142
  featureProjection: t.referenceCrs
799
1143
  });
800
- return Promise.resolve(o);
801
- }, we = (p, i) => {
802
- var s;
803
- if (!Y.isPlyPickResult(p))
1144
+ return Promise.resolve(i);
1145
+ }, Qe = (l, e) => {
1146
+ var o;
1147
+ if (!W.isPlyPickResult(l))
804
1148
  return;
805
- const t = (s = p.features) == null ? void 0 : s.at(0);
1149
+ const t = (o = l.features) == null ? void 0 : o.at(0);
806
1150
  if (!t)
807
1151
  return;
808
- i.has("PLY") || i.set("PLY", []), i.get("PLY").push({ key: "Color", value: t.color });
1152
+ e.has("PLY") || e.set("PLY", []), e.get("PLY").push({ key: "Color", value: t.color });
809
1153
  };
810
- class Le {
1154
+ class yn {
811
1155
  constructor() {
812
- w(this, "name", "PLY");
1156
+ m(this, "id", "builtin-ply-loader");
1157
+ m(this, "name", "PLY");
813
1158
  }
814
- initialize(i) {
815
- i.datasets.registerDatasetType("ply", {
816
- attributeExtractor: we,
817
- entityBuilder: xe,
1159
+ initialize(e) {
1160
+ e.datasets.registerDatasetType("ply", {
1161
+ attributeExtractor: Qe,
1162
+ entityBuilder: Ze,
818
1163
  icon: "bi-file-earmark-binary",
819
1164
  name: "PLY"
820
1165
  });
821
1166
  }
822
1167
  }
823
- const _e = (p) => {
824
- const i = p.dataset.config, t = new Ht({
825
- source: new Wt({ url: `${i.source.url}/${i.source.filename}` })
1168
+ const Je = (l) => {
1169
+ const e = l.dataset.config, t = new ne({
1170
+ source: new se({ url: `${e.source.url}/${e.source.filename}` })
826
1171
  });
827
- return $(t, {
828
- filename: i.source.url
1172
+ return K(t, {
1173
+ filename: e.source.url
829
1174
  }), Promise.resolve(t);
830
1175
  };
831
- class Ae {
1176
+ class bn {
832
1177
  constructor() {
833
- w(this, "name", "Potree");
1178
+ m(this, "id", "builtin-potree-loader");
1179
+ m(this, "name", "Potree");
834
1180
  }
835
- initialize(i) {
836
- i.datasets.registerDatasetType("potree", {
837
- entityBuilder: _e,
1181
+ initialize(e) {
1182
+ e.datasets.registerDatasetType("potree", {
1183
+ entityBuilder: Je,
838
1184
  icon: "fg-multipoint",
839
1185
  name: "Potree Point Cloud"
840
1186
  });
841
1187
  }
842
1188
  }
843
- class ze {
1189
+ class _n {
844
1190
  constructor() {
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);
1191
+ m(this, "id", "builtin-tour");
1192
+ m(this, "name", "Tour");
1193
+ m(this, "_camera", null);
1194
+ m(this, "_cameraCallback", null);
1195
+ m(this, "_context", null);
1196
+ m(this, "_tours", null);
850
1197
  }
851
- initialize(i) {
852
- this._context = i, i.events.addEventListener("ready", this.start.bind(this));
1198
+ initialize(e) {
1199
+ this._context = e, e.events.addEventListener("ready", this.start.bind(this));
853
1200
  }
854
1201
  buildTours() {
855
- const i = this._camera, t = new T.Tour({
1202
+ const e = this._camera, t = new F.Tour({
856
1203
  tourName: "main",
857
1204
  useModalOverlay: !0
858
- }), e = new T.Tour({
1205
+ }), s = new F.Tour({
859
1206
  tourName: "navigating",
860
1207
  useModalOverlay: !0
861
- }), s = new T.Tour({
1208
+ }), o = new F.Tour({
862
1209
  tourName: "analyzing",
863
1210
  useModalOverlay: !0
864
- }), o = [
1211
+ }), i = [
865
1212
  { action: () => {
866
- var a;
867
- return (a = T.activeTour) == null ? void 0 : a.next();
1213
+ var u;
1214
+ return (u = F.activeTour) == null ? void 0 : u.next();
868
1215
  }, text: "Next" },
869
1216
  { action: () => {
870
- var a;
871
- return (a = T.activeTour) == null ? void 0 : a.cancel();
1217
+ var u;
1218
+ return (u = F.activeTour) == null ? void 0 : u.cancel();
872
1219
  }, secondary: !0, text: "Exit" }
873
1220
  ], n = () => {
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)
1221
+ var a, p;
1222
+ const u = (a = F.activeTour) == null ? void 0 : a.getCurrentStep(), f = u == null ? void 0 : u.getElement(), C = f == null ? void 0 : f.querySelector(".shepherd-text"), P = (p = F.activeTour) == null ? void 0 : p.steps;
1223
+ if (u == null || f == null || C == null || P == null)
877
1224
  return;
878
1225
  const I = document.createElement("div");
879
1226
  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));
1227
+ const T = document.createElement("div");
1228
+ T.className = "progress-bar bg-success", T.style.width = `${100 * (P.indexOf(u) / P.length)}%`, I.appendChild(T), C.appendChild(I);
1229
+ }, r = async (u, f) => new Promise((C) => {
1230
+ const P = document.getElementById(u);
1231
+ if (P && !P.classList.contains("active") && P.click(), document.querySelector(f))
1232
+ return C(document.querySelector(f));
886
1233
  const I = new MutationObserver(() => {
887
- document.querySelector(y) && (I.disconnect(), C(document.querySelector(y)));
1234
+ document.querySelector(f) && (I.disconnect(), C(document.querySelector(f)));
888
1235
  });
889
1236
  I.observe(document.body, {
890
1237
  childList: !0,
@@ -895,22 +1242,22 @@ class ze {
895
1242
  buttons: [
896
1243
  {
897
1244
  action: () => {
898
- var a;
899
- (a = T.activeTour) == null || a.complete(), e.show(0);
1245
+ var u;
1246
+ (u = F.activeTour) == null || u.complete(), s.show(0);
900
1247
  },
901
1248
  text: "Navigating"
902
1249
  },
903
1250
  {
904
1251
  action: () => {
905
- var a;
906
- (a = T.activeTour) == null || a.complete(), s.show(0);
1252
+ var u;
1253
+ (u = F.activeTour) == null || u.complete(), o.show(0);
907
1254
  },
908
1255
  text: "Analyzing data"
909
1256
  },
910
1257
  {
911
1258
  action: () => {
912
- var a;
913
- return (a = T.activeTour) == null ? void 0 : a.cancel();
1259
+ var u;
1260
+ return (u = F.activeTour) == null ? void 0 : u.cancel();
914
1261
  },
915
1262
  secondary: !0,
916
1263
  text: "Exit"
@@ -923,109 +1270,109 @@ class ze {
923
1270
  when: {
924
1271
  show: n
925
1272
  }
926
- }), e.addStep({
1273
+ }), s.addStep({
927
1274
  attachTo: {
928
1275
  element: "#main-view",
929
1276
  on: "bottom"
930
1277
  },
931
- buttons: o,
1278
+ buttons: i,
932
1279
  id: "view",
933
1280
  text: "<p>This is the <b>main view</b>.</p><p>Giro3D natively supports a broad range of data sources, from 2D raster and vector data, to 3D point clouds and tilesets.</p><p>Piero adds support for CityJSON and IFC files.</p>",
934
1281
  when: {
935
1282
  show: n
936
1283
  }
937
- }), e.addStep({
1284
+ }), s.addStep({
938
1285
  attachTo: {
939
1286
  element: "#main-view",
940
1287
  on: "bottom"
941
1288
  },
942
- buttons: o,
1289
+ buttons: i,
943
1290
  id: "navigate",
944
1291
  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>',
945
1292
  when: {
946
1293
  hide: () => {
947
- this._cameraCallback && i.removeEventListener("interaction-end", this._cameraCallback), this._cameraCallback = null;
1294
+ this._cameraCallback && e.removeEventListener("interaction-end", this._cameraCallback), this._cameraCallback = null;
948
1295
  },
949
1296
  show: () => {
950
- let a = 0;
1297
+ let u = 0;
951
1298
  this._cameraCallback = () => {
952
- var y;
953
- a += 1, a > 2 && ((y = T.activeTour) == null || y.next());
954
- }, i.addEventListener("interaction-end", this._cameraCallback), n();
1299
+ var f;
1300
+ u += 1, u > 2 && ((f = F.activeTour) == null || f.next());
1301
+ }, e.addEventListener("interaction-end", this._cameraCallback), n();
955
1302
  }
956
1303
  }
957
- }), e.addStep({
1304
+ }), s.addStep({
958
1305
  attachTo: {
959
1306
  element: "#toolbar",
960
1307
  on: "right"
961
1308
  },
962
- beforeShowPromise: () => d("toolbar-datasets", "#datasets-drop-zone"),
963
- buttons: o,
1309
+ beforeShowPromise: () => r("toolbar-datasets", "#datasets-drop-zone"),
1310
+ buttons: i,
964
1311
  id: "toolbar-layers",
965
1312
  text: "<p>Giro3D supports multiple datasets.</p><p>You can toggle datasets as you wish with the <b>Datasets</b> panel.</p>",
966
1313
  when: {
967
1314
  show: n
968
1315
  }
969
- }), e.addStep({
1316
+ }), s.addStep({
970
1317
  attachTo: {
971
1318
  element: "#basemap-list",
972
1319
  on: "right"
973
1320
  },
974
- beforeShowPromise: () => d("toolbar-datasets", "#datasets-drop-zone"),
975
- buttons: o,
1321
+ beforeShowPromise: () => r("toolbar-datasets", "#datasets-drop-zone"),
1322
+ buttons: i,
976
1323
  id: "basemaps",
977
1324
  text: "<p><b>Basemaps</b> are color and elevation layers that make the basic shape and aspect of the <b>Map</b>.</p>",
978
1325
  when: {
979
1326
  show: n
980
1327
  }
981
- }), e.addStep({
1328
+ }), s.addStep({
982
1329
  attachTo: {
983
1330
  element: "#overlay-list",
984
1331
  on: "right"
985
1332
  },
986
- beforeShowPromise: () => d("toolbar-datasets", "#datasets-drop-zone"),
987
- buttons: o,
1333
+ beforeShowPromise: () => r("toolbar-datasets", "#datasets-drop-zone"),
1334
+ buttons: i,
988
1335
  id: "overlays",
989
1336
  text: "<p><b>Overlays</b> are vector layers in various formats (WFS, GML, GeoJSON...).</p>",
990
1337
  when: {
991
1338
  show: n
992
1339
  }
993
- }), e.addStep({
1340
+ }), s.addStep({
994
1341
  attachTo: {
995
1342
  element: "#dataset-list",
996
1343
  on: "right"
997
1344
  },
998
- beforeShowPromise: () => d("toolbar-datasets", "#datasets-drop-zone"),
999
- buttons: o,
1345
+ beforeShowPromise: () => r("toolbar-datasets", "#datasets-drop-zone"),
1346
+ buttons: i,
1000
1347
  id: "layers",
1001
1348
  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>",
1002
1349
  when: {
1003
1350
  show: n
1004
1351
  }
1005
- }), e.addStep({
1352
+ }), s.addStep({
1006
1353
  attachTo: {
1007
1354
  element: "#datasets-drop-zone",
1008
1355
  on: "right"
1009
1356
  },
1010
- beforeShowPromise: () => d("toolbar-datasets", "#datasets-drop-zone"),
1011
- buttons: o,
1357
+ beforeShowPromise: () => r("toolbar-datasets", "#datasets-drop-zone"),
1358
+ buttons: i,
1012
1359
  id: "adddata",
1013
1360
  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>",
1014
1361
  when: {
1015
1362
  show: n
1016
1363
  }
1017
- }), e.addStep({
1364
+ }), s.addStep({
1018
1365
  attachTo: {
1019
1366
  element: "#main-view",
1020
1367
  on: "bottom"
1021
1368
  },
1022
- buttons: o,
1369
+ buttons: i,
1023
1370
  id: "attributes",
1024
1371
  text: "<p>By clicking on any feature on the map, you can see its <strong>Attribute table</strong>. Clickable features display a cursor when hovered.</p>",
1025
1372
  when: {
1026
1373
  show: n
1027
1374
  }
1028
- }), e.addStep({
1375
+ }), s.addStep({
1029
1376
  attachTo: {
1030
1377
  element: "#search-place-autocomplete",
1031
1378
  on: "bottom"
@@ -1033,15 +1380,15 @@ class ze {
1033
1380
  buttons: [
1034
1381
  {
1035
1382
  action: () => {
1036
- var a;
1037
- (a = T.activeTour) == null || a.complete(), s.show(0);
1383
+ var u;
1384
+ (u = F.activeTour) == null || u.complete(), o.show(0);
1038
1385
  },
1039
1386
  text: "Analyzing data"
1040
1387
  },
1041
1388
  {
1042
1389
  action: () => {
1043
- var a;
1044
- return (a = T.activeTour) == null ? void 0 : a.complete();
1390
+ var u;
1391
+ return (u = F.activeTour) == null ? void 0 : u.complete();
1045
1392
  },
1046
1393
  secondary: !0,
1047
1394
  text: "Exit"
@@ -1052,51 +1399,51 @@ class ze {
1052
1399
  when: {
1053
1400
  show: n
1054
1401
  }
1055
- }), s.addStep({
1402
+ }), o.addStep({
1056
1403
  attachTo: {
1057
1404
  element: "#annotations-fieldset",
1058
1405
  on: "right"
1059
1406
  },
1060
- beforeShowPromise: () => d("toolbar-annotations", "#annotations-fieldset"),
1061
- buttons: o,
1407
+ beforeShowPromise: () => r("toolbar-annotations", "#annotations-fieldset"),
1408
+ buttons: i,
1062
1409
  id: "annotation",
1063
1410
  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>",
1064
1411
  when: {
1065
1412
  show: n
1066
1413
  }
1067
- }), s.addStep({
1414
+ }), o.addStep({
1068
1415
  attachTo: {
1069
1416
  element: "#annotations-fieldset",
1070
1417
  on: "right"
1071
1418
  },
1072
- beforeShowPromise: () => d("toolbar-annotations", "#annotations-fieldset"),
1073
- buttons: o,
1419
+ beforeShowPromise: () => r("toolbar-annotations", "#annotations-fieldset"),
1420
+ buttons: i,
1074
1421
  id: "annotations",
1075
1422
  text: "You can download your annotations as GeoJSON files. You can also upload your own by dragging them into this panel.",
1076
1423
  when: {
1077
1424
  show: n
1078
1425
  }
1079
- }), Ot("measurements") && s.addStep({
1426
+ }), Ot("measurements") && o.addStep({
1080
1427
  attachTo: {
1081
1428
  element: "#panel-container",
1082
1429
  on: "right"
1083
1430
  },
1084
- beforeShowPromise: () => d("toolbar-measures", "#measures-fieldset"),
1085
- buttons: o,
1431
+ beforeShowPromise: () => r("toolbar-measures", "#measures-fieldset"),
1432
+ buttons: i,
1086
1433
  id: "measurements",
1087
1434
  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.",
1088
1435
  when: {
1089
1436
  show: n
1090
1437
  }
1091
- }), s.addStep({
1438
+ }), o.addStep({
1092
1439
  attachTo: {
1093
1440
  element: "#panel-container",
1094
1441
  on: "right"
1095
1442
  },
1096
- beforeShowPromise: () => d("toolbar-analysis", "#panel-container .card"),
1443
+ beforeShowPromise: () => r("toolbar-analysis", "#panel-container .card"),
1097
1444
  buttons: [{ action: () => {
1098
- var a;
1099
- return (a = T.activeTour) == null ? void 0 : a.complete();
1445
+ var u;
1446
+ return (u = F.activeTour) == null ? void 0 : u.complete();
1100
1447
  }, text: "Done!" }],
1101
1448
  id: "analysis",
1102
1449
  text: "In the <strong>Analysis</strong> panel you'll find some advanced analysis tools.",
@@ -1104,39 +1451,43 @@ class ze {
1104
1451
  show: n
1105
1452
  }
1106
1453
  });
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);
1454
+ const g = () => {
1455
+ const u = new URL(document.URL);
1456
+ u.searchParams.delete("tourStep"), u.searchParams.set("tour", "none"), window.history.replaceState({}, "", u.toString());
1457
+ }, w = (u) => {
1458
+ const f = new URL(document.URL);
1112
1459
  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());
1460
+ u.tour.id.startsWith("navigating") ? C = "navigating" : u.tour.id.startsWith("analyzing") && (C = "analyzing"), f.searchParams.set("tour", C), f.searchParams.set("tourStep", u.step.id), window.history.replaceState({}, "", f.toString());
1114
1461
  };
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 };
1462
+ return t.on("cancel", g), t.on("complete", g), t.on("show", w), s.on("cancel", g), s.on("complete", g), s.on("show", w), o.on("cancel", g), o.on("complete", g), o.on("show", w), { analyzingTour: o, mainTour: t, navigatingTour: s };
1116
1463
  }
1117
1464
  getTours() {
1118
1465
  return this._tours || (this._tours = this.buildTours()), this._tours;
1119
1466
  }
1120
1467
  restart() {
1121
- const { mainTour: i } = this.getTours();
1122
- i.show(0);
1468
+ const { mainTour: e } = this.getTours();
1469
+ e.show(0);
1123
1470
  }
1124
1471
  start() {
1125
1472
  if (!this._context)
1126
1473
  throw new Error("module is not initialized");
1127
- const { analyzingTour: i, mainTour: t, navigatingTour: e } = this.getTours();
1474
+ const { analyzingTour: e, mainTour: t, navigatingTour: s } = this.getTours();
1128
1475
  this._camera = this._context.view.getCameraController();
1129
- const s = new URL(document.URL), o = s.searchParams.get("tour") ?? "main";
1130
- if (o !== "none") {
1131
- const n = s.searchParams.get("tourStep") ?? 0;
1132
- o === "navigating" ? e.show(n) : o === "analyzing" ? i.show(n) : t.show(n);
1476
+ const o = new URL(document.URL), i = o.searchParams.get("tour") ?? "main";
1477
+ if (i !== "none") {
1478
+ const n = o.searchParams.get("tourStep") ?? 0;
1479
+ i === "navigating" ? s.show(n) : i === "analyzing" ? e.show(n) : t.show(n);
1133
1480
  }
1134
1481
  }
1135
1482
  }
1136
1483
  export {
1137
- Me as IFCLoader,
1138
- Le as PLYLoader,
1139
- Ae as PotreeLoader,
1140
- ze as Tour
1484
+ xn as ClippingBoxAnalysis,
1485
+ pn as CrossSectionAnalysis,
1486
+ hn as DownloadDataset,
1487
+ fn as FloodingPlaneAnalysis,
1488
+ mn as IFCLoader,
1489
+ yn as PLYLoader,
1490
+ bn as PotreeLoader,
1491
+ _n as Tour
1141
1492
  };
1142
1493
  //# sourceMappingURL=modules.es.js.map