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

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