@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.
- package/dist/Components.cjs.js +3 -2
- package/dist/Components.cjs.js.map +1 -1
- package/dist/Components.es.js +3193 -1778
- package/dist/Components.es.js.map +1 -1
- package/dist/assets/piero.css +2 -2
- package/dist/index.cjs.js +7 -7
- package/dist/index.cjs.js.map +1 -1
- package/dist/index.es.js +3192 -4319
- package/dist/index.es.js.map +1 -1
- package/dist/modules.cjs.js +1 -2
- package/dist/modules.cjs.js.map +1 -1
- package/dist/modules.es.js +981 -965
- package/dist/modules.es.js.map +1 -1
- package/dist/src/api/SearchApi.d.ts +34 -0
- package/dist/src/api/ViewApi.d.ts +2 -0
- package/dist/src/api/WidgetApi.d.ts +17 -0
- package/dist/src/api/index.d.ts +2 -1
- package/dist/src/components/CoordinateInput.vue.d.ts +31 -0
- package/dist/src/components/SearchOverlay.vue.d.ts +4 -5
- package/dist/src/context.d.ts +10 -0
- package/dist/src/events.d.ts +7 -1
- package/dist/src/modules/OpenLayersMinimap.d.ts +7 -0
- package/dist/src/modules/PostProcessEntities.d.ts +16 -0
- package/dist/src/modules/crossSectionAnalysis/CrossSection.vue.d.ts +1 -1
- package/dist/src/modules/crossSectionAnalysis/CrossSectionHelper.d.ts +4 -0
- package/dist/src/modules/crossSectionAnalysis/CrossSectionManager.d.ts +7 -0
- package/dist/src/modules/crossSectionAnalysis/store.d.ts +22 -2
- package/dist/src/modules/geocoding/CoordinatesSearch.d.ts +7 -0
- package/dist/src/modules/geocoding/FrenchBanGeocoder.d.ts +10 -0
- package/dist/src/modules/index.d.ts +5 -1
- package/dist/src/modules/minimap/OpenLayersMinimapComponent.vue.d.ts +8 -0
- package/dist/src/services/CameraController.d.ts +3 -3
- package/dist/src/services/Giro3DManager.d.ts +2 -0
- package/dist/src/services/SceneCursorManager.d.ts +19 -0
- package/dist/src/stores/giro3d.d.ts +1 -7
- package/dist/src/stores/search.d.ts +12 -0
- package/dist/src/stores/widgets.d.ts +12 -0
- package/dist/src/utils/Types.d.ts +1 -0
- package/package.json +2 -2
- package/dist/src/components/MinimapView.vue.d.ts +0 -4
- package/dist/src/providers/BanProvider.d.ts +0 -11
- package/dist/src/providers/Geocoding.d.ts +0 -7
- package/dist/src/services/MinimapController.d.ts +0 -19
package/dist/modules.es.js
CHANGED
|
@@ -1,71 +1,175 @@
|
|
|
1
|
-
var
|
|
2
|
-
var
|
|
3
|
-
var
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
7
|
-
import
|
|
8
|
-
import
|
|
9
|
-
import
|
|
10
|
-
import
|
|
11
|
-
import
|
|
12
|
-
import
|
|
13
|
-
import
|
|
14
|
-
import
|
|
15
|
-
import
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
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:
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
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
|
-
}),
|
|
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(
|
|
38
|
-
const
|
|
39
|
-
function
|
|
40
|
-
|
|
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
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
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: "
|
|
148
|
+
title: "Enable cross-section"
|
|
57
149
|
}, null, 8, ["model-value"]),
|
|
58
|
-
|
|
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
|
-
|
|
64
|
-
|
|
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
|
-
|
|
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:
|
|
77
|
-
onInput:
|
|
78
|
-
}, null, 40,
|
|
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
|
-
|
|
81
|
-
|
|
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:
|
|
87
|
-
onInput:
|
|
88
|
-
}, null, 40,
|
|
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
|
-
|
|
91
|
-
v(
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
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
|
|
114
|
-
constructor(
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
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(
|
|
123
|
-
|
|
124
|
-
switch (
|
|
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
|
-
|
|
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
|
|
141
|
-
|
|
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
|
-
|
|
145
|
-
|
|
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
|
|
278
|
+
class Bn {
|
|
154
279
|
constructor() {
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
280
|
+
c(this, "id", "builtin-cross-section-analysis");
|
|
281
|
+
c(this, "name", "Cross section");
|
|
282
|
+
c(this, "_manager", null);
|
|
158
283
|
}
|
|
159
|
-
initialize(
|
|
160
|
-
|
|
161
|
-
component:
|
|
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
|
|
289
|
+
}), this._manager = new Pt(t);
|
|
165
290
|
}
|
|
166
291
|
}
|
|
167
|
-
function Q(
|
|
168
|
-
if ("url" in
|
|
169
|
-
return
|
|
170
|
-
if ("source" in
|
|
171
|
-
return
|
|
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
|
|
174
|
-
return Q(
|
|
298
|
+
function Et(a) {
|
|
299
|
+
return Q(a) != null;
|
|
175
300
|
}
|
|
176
|
-
class
|
|
301
|
+
class Nn {
|
|
177
302
|
constructor() {
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
303
|
+
c(this, "id", "builtin-download-dataset");
|
|
304
|
+
c(this, "name", "Download dataset");
|
|
305
|
+
c(this, "_context", null);
|
|
181
306
|
}
|
|
182
|
-
initialize(
|
|
183
|
-
this._context =
|
|
307
|
+
initialize(t) {
|
|
308
|
+
this._context = t, t.datasets.registerDatasetAction({
|
|
184
309
|
action: this.download.bind(this),
|
|
185
310
|
icon: "bi-download",
|
|
186
|
-
predicate:
|
|
311
|
+
predicate: Et,
|
|
187
312
|
title: "Download dataset"
|
|
188
313
|
});
|
|
189
314
|
}
|
|
190
|
-
download(
|
|
191
|
-
const
|
|
192
|
-
if (
|
|
315
|
+
download(t) {
|
|
316
|
+
const e = Q(t);
|
|
317
|
+
if (e == null) {
|
|
193
318
|
console.warn("invalid");
|
|
194
319
|
return;
|
|
195
320
|
}
|
|
196
|
-
const
|
|
197
|
-
console.info(`download ${Q(
|
|
198
|
-
if (!
|
|
199
|
-
throw new Error(`${
|
|
200
|
-
return
|
|
201
|
-
}).then((
|
|
202
|
-
|
|
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:
|
|
329
|
+
text: o,
|
|
205
330
|
title: "Download successful"
|
|
206
331
|
});
|
|
207
|
-
}).catch((
|
|
208
|
-
console.error(
|
|
209
|
-
const
|
|
210
|
-
|
|
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:
|
|
213
|
-
title:
|
|
337
|
+
text: l,
|
|
338
|
+
title: t.name
|
|
214
339
|
});
|
|
215
340
|
});
|
|
216
341
|
}
|
|
217
342
|
}
|
|
218
|
-
const
|
|
219
|
-
const
|
|
220
|
-
function
|
|
221
|
-
return
|
|
343
|
+
const be = me("floodingPlane", () => {
|
|
344
|
+
const a = I(0), t = I(!1);
|
|
345
|
+
function e() {
|
|
346
|
+
return a.value;
|
|
222
347
|
}
|
|
223
|
-
function
|
|
224
|
-
|
|
348
|
+
function n(o) {
|
|
349
|
+
a.value = o;
|
|
225
350
|
}
|
|
226
|
-
function o
|
|
227
|
-
|
|
351
|
+
function s(o) {
|
|
352
|
+
t.value = o;
|
|
228
353
|
}
|
|
229
|
-
return { enable:
|
|
230
|
-
}),
|
|
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(
|
|
233
|
-
const
|
|
234
|
-
function
|
|
235
|
-
|
|
357
|
+
setup(a) {
|
|
358
|
+
const t = be();
|
|
359
|
+
function e(n) {
|
|
360
|
+
t.setHeight(n);
|
|
236
361
|
}
|
|
237
|
-
return (
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
"model-value":
|
|
241
|
-
"onUpdate:modelValue":
|
|
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
|
-
|
|
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
|
-
|
|
251
|
-
|
|
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
|
-
|
|
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:
|
|
264
|
-
onInput:
|
|
265
|
-
}, null, 40,
|
|
266
|
-
|
|
267
|
-
|
|
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:
|
|
273
|
-
onInput:
|
|
274
|
-
}, null, 40,
|
|
275
|
-
|
|
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
|
|
406
|
+
class Dt {
|
|
282
407
|
constructor() {
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
this.geometry = new
|
|
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(
|
|
290
|
-
this._height =
|
|
414
|
+
set height(t) {
|
|
415
|
+
this._height = t;
|
|
291
416
|
}
|
|
292
417
|
get height() {
|
|
293
418
|
return this._height;
|
|
294
419
|
}
|
|
295
|
-
set visible(
|
|
296
|
-
this.object3D.visible =
|
|
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,
|
|
305
|
-
this.object3D.scale.set(
|
|
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
|
|
309
|
-
constructor(
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
this._context =
|
|
314
|
-
this._store.$onAction(({ after:
|
|
315
|
-
|
|
316
|
-
switch (
|
|
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
|
|
333
|
-
const
|
|
334
|
-
this._plane.visible = this._store.enable, this._plane.setPosition(
|
|
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
|
|
462
|
+
class On {
|
|
338
463
|
constructor() {
|
|
339
|
-
|
|
340
|
-
|
|
341
|
-
|
|
464
|
+
c(this, "id", "builtin-flooding-plane-analysis");
|
|
465
|
+
c(this, "name", "Flooding plane");
|
|
466
|
+
c(this, "_manager", null);
|
|
342
467
|
}
|
|
343
|
-
initialize(
|
|
344
|
-
|
|
345
|
-
component:
|
|
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
|
|
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
|
-
|
|
352
|
-
|
|
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
|
|
554
|
+
selection: new R({
|
|
359
555
|
color: "#FF0000",
|
|
360
556
|
depthTest: !1,
|
|
361
557
|
opacity: 0.6,
|
|
362
558
|
transparent: !0
|
|
363
559
|
})
|
|
364
|
-
},
|
|
365
|
-
|
|
366
|
-
|
|
367
|
-
|
|
368
|
-
|
|
369
|
-
|
|
370
|
-
|
|
371
|
-
],
|
|
372
|
-
constructor(
|
|
373
|
-
super(new
|
|
374
|
-
|
|
375
|
-
|
|
376
|
-
|
|
377
|
-
|
|
378
|
-
|
|
379
|
-
|
|
380
|
-
|
|
381
|
-
|
|
382
|
-
|
|
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
|
-
|
|
580
|
+
c(this, "_indexMap");
|
|
385
581
|
// Properties relationships
|
|
386
|
-
|
|
387
|
-
|
|
388
|
-
this._source =
|
|
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
|
|
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(
|
|
394
|
-
for (const
|
|
395
|
-
const
|
|
396
|
-
|
|
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[
|
|
594
|
+
this.notifyChange(this), this._ifcSelection[e] = {};
|
|
399
595
|
}
|
|
400
|
-
getBoundingBoxById(
|
|
401
|
-
this.clearHighlight("bbox"), this.highlightById(
|
|
402
|
-
const
|
|
403
|
-
if (
|
|
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
|
|
406
|
-
|
|
407
|
-
const
|
|
408
|
-
if (!Object.keys(
|
|
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
|
|
411
|
-
const
|
|
412
|
-
|
|
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
|
|
415
|
-
return
|
|
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(
|
|
423
|
-
const
|
|
424
|
-
if (!
|
|
618
|
+
getProperties(e) {
|
|
619
|
+
const n = [], s = this._model.properties;
|
|
620
|
+
if (!s)
|
|
425
621
|
return [];
|
|
426
|
-
for (const
|
|
427
|
-
const
|
|
428
|
-
if (
|
|
622
|
+
for (const o of this._indexMap[e]) {
|
|
623
|
+
const i = s[o];
|
|
624
|
+
if (i == null)
|
|
429
625
|
continue;
|
|
430
|
-
const { name:
|
|
431
|
-
if (
|
|
432
|
-
if (
|
|
433
|
-
const
|
|
434
|
-
if (
|
|
435
|
-
for (const
|
|
436
|
-
if (
|
|
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
|
|
439
|
-
|
|
440
|
-
parentName:
|
|
441
|
-
...
|
|
634
|
+
const u = this.getProperty(p);
|
|
635
|
+
u !== null && n.push({
|
|
636
|
+
parentName: l,
|
|
637
|
+
...u
|
|
442
638
|
});
|
|
443
639
|
}
|
|
444
|
-
} else if (
|
|
445
|
-
const
|
|
446
|
-
|
|
447
|
-
|
|
640
|
+
} else if (i.type === _e) {
|
|
641
|
+
const d = M.getQsetQuantities(
|
|
642
|
+
s,
|
|
643
|
+
o
|
|
448
644
|
);
|
|
449
|
-
if (
|
|
450
|
-
for (const
|
|
451
|
-
const { key:
|
|
452
|
-
|
|
453
|
-
|
|
645
|
+
if (d !== null)
|
|
646
|
+
for (const p of d) {
|
|
647
|
+
const { key: r } = M.getQuantityValue(
|
|
648
|
+
s,
|
|
649
|
+
p
|
|
454
650
|
);
|
|
455
|
-
if (
|
|
651
|
+
if (r === null)
|
|
456
652
|
continue;
|
|
457
|
-
const
|
|
458
|
-
|
|
459
|
-
parentName:
|
|
460
|
-
...
|
|
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
|
|
662
|
+
return n;
|
|
467
663
|
}
|
|
468
|
-
getProperty(
|
|
469
|
-
const
|
|
470
|
-
if (
|
|
664
|
+
getProperty(e) {
|
|
665
|
+
const n = this._model.properties;
|
|
666
|
+
if (n === void 0)
|
|
471
667
|
return null;
|
|
472
|
-
const { name:
|
|
473
|
-
if (
|
|
668
|
+
const { name: s } = M.getEntityName(n, e);
|
|
669
|
+
if (s === null)
|
|
474
670
|
return null;
|
|
475
|
-
const { value:
|
|
476
|
-
return { name:
|
|
477
|
-
}
|
|
478
|
-
highlight(
|
|
479
|
-
this._ifcSelection[
|
|
480
|
-
const
|
|
481
|
-
this._ifcSelection[
|
|
482
|
-
const
|
|
483
|
-
if (
|
|
484
|
-
const
|
|
485
|
-
for (let
|
|
486
|
-
const
|
|
487
|
-
|
|
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(
|
|
493
|
-
for (const
|
|
494
|
-
|
|
495
|
-
const
|
|
496
|
-
for (const
|
|
497
|
-
this._ifcSelection[
|
|
498
|
-
for (const
|
|
499
|
-
this.addComposites(
|
|
500
|
-
this.regenerate(
|
|
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(
|
|
505
|
-
return super.pick(
|
|
506
|
-
...
|
|
700
|
+
pick(e, n) {
|
|
701
|
+
return super.pick(e, n).map((s) => ({
|
|
702
|
+
...s,
|
|
507
703
|
entity: this,
|
|
508
|
-
features:
|
|
704
|
+
features: s.features,
|
|
509
705
|
isIFCPickResult: !0,
|
|
510
|
-
object:
|
|
706
|
+
object: s.object
|
|
511
707
|
}));
|
|
512
708
|
}
|
|
513
|
-
pickFeaturesFrom(
|
|
514
|
-
var o, i
|
|
515
|
-
const
|
|
516
|
-
if (
|
|
517
|
-
const
|
|
518
|
-
if (
|
|
519
|
-
const
|
|
520
|
-
return
|
|
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(
|
|
729
|
+
])), this._fragmentBoundingBox = await this._components.tools.get(Qe);
|
|
534
730
|
}
|
|
535
731
|
async preprocess() {
|
|
536
|
-
const
|
|
537
|
-
this._fragmentManager = await this._components.tools.get(
|
|
538
|
-
const
|
|
539
|
-
|
|
540
|
-
const
|
|
541
|
-
this._model = await
|
|
542
|
-
const
|
|
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(
|
|
740
|
+
this._source.at.toVector3(o), this._model.position.copy(o);
|
|
545
741
|
else {
|
|
546
|
-
const
|
|
547
|
-
|
|
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
|
|
551
|
-
|
|
552
|
-
}
|
|
553
|
-
addComposites(
|
|
554
|
-
this.addHighlightToFragment(
|
|
555
|
-
const
|
|
556
|
-
if (
|
|
557
|
-
for (let
|
|
558
|
-
const
|
|
559
|
-
this._ifcSelection[
|
|
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(
|
|
563
|
-
if (!(
|
|
564
|
-
const
|
|
565
|
-
|
|
566
|
-
ids: Array.from(
|
|
567
|
-
transform:
|
|
568
|
-
}),
|
|
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
|
|
574
|
-
if (
|
|
575
|
-
for (const
|
|
576
|
-
|
|
577
|
-
const
|
|
578
|
-
|
|
579
|
-
for (const
|
|
580
|
-
this.setEntityIndex(
|
|
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(
|
|
584
|
-
this.updateFragmentFill(
|
|
585
|
-
}
|
|
586
|
-
async regenerateClassification(
|
|
587
|
-
const
|
|
588
|
-
if (
|
|
589
|
-
return
|
|
590
|
-
for (const
|
|
591
|
-
const
|
|
592
|
-
if (Object.keys(
|
|
593
|
-
const
|
|
594
|
-
|
|
595
|
-
|
|
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
|
-
|
|
793
|
+
o.push({ children: g, fragments: r, name: d, treeItemName: f });
|
|
598
794
|
}
|
|
599
795
|
}
|
|
600
|
-
return
|
|
796
|
+
return o;
|
|
601
797
|
}
|
|
602
|
-
setEntityIndex(
|
|
603
|
-
return
|
|
798
|
+
setEntityIndex(e) {
|
|
799
|
+
return e in this._indexMap || (this._indexMap[e] = /* @__PURE__ */ new Set()), this._indexMap[e];
|
|
604
800
|
}
|
|
605
|
-
updateFragmentFill(
|
|
606
|
-
const
|
|
607
|
-
if (
|
|
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
|
|
610
|
-
if (
|
|
805
|
+
const i = o.fragments[e];
|
|
806
|
+
if (i == null)
|
|
611
807
|
return;
|
|
612
|
-
const
|
|
613
|
-
if (
|
|
808
|
+
const l = o.mesh.parent;
|
|
809
|
+
if (l == null)
|
|
614
810
|
return;
|
|
615
|
-
if (
|
|
616
|
-
|
|
617
|
-
ids: Array.from(
|
|
618
|
-
transform:
|
|
619
|
-
}),
|
|
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
|
|
622
|
-
for (const
|
|
623
|
-
|
|
624
|
-
const { instanceID:
|
|
625
|
-
|
|
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
|
-
|
|
631
|
-
let
|
|
632
|
-
class
|
|
633
|
-
constructor(
|
|
634
|
-
super(
|
|
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
|
|
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(
|
|
644
|
-
const
|
|
645
|
-
function
|
|
646
|
-
if (
|
|
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
|
|
651
|
-
|
|
846
|
+
const u = t.ifcEntity.getBoundingBoxById(t.classificationElement.fragments);
|
|
847
|
+
u && !u.isEmpty() && l.setClippingBox(u);
|
|
652
848
|
}
|
|
653
|
-
function
|
|
654
|
-
|
|
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
|
|
657
|
-
const
|
|
658
|
-
|
|
852
|
+
function r() {
|
|
853
|
+
const u = t.ifcEntity.getBoundingBoxById(t.classificationElement.fragments);
|
|
854
|
+
u && !u.isEmpty() && o.lookTopDownAt(u);
|
|
659
855
|
}
|
|
660
|
-
return (
|
|
661
|
-
const
|
|
662
|
-
return
|
|
663
|
-
|
|
664
|
-
|
|
665
|
-
class:
|
|
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
|
-
|
|
863
|
+
s.value ? "text-danger border-danger" : "text-secondary border-secondary"
|
|
668
864
|
]),
|
|
669
|
-
title:
|
|
670
|
-
},
|
|
671
|
-
|
|
672
|
-
default:
|
|
673
|
-
|
|
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":
|
|
678
|
-
"aria-controls":
|
|
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
|
-
})) :
|
|
684
|
-
|
|
685
|
-
class:
|
|
686
|
-
text:
|
|
687
|
-
title: `Zoom to ${
|
|
688
|
-
onClick:
|
|
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
|
-
|
|
691
|
-
default:
|
|
692
|
-
|
|
886
|
+
T(ie, { class: "ms-1" }, {
|
|
887
|
+
default: re(() => [
|
|
888
|
+
T(W, {
|
|
693
889
|
title: "Highlight",
|
|
694
890
|
icon: "bi-highlighter",
|
|
695
|
-
onClick:
|
|
891
|
+
onClick: p
|
|
696
892
|
}),
|
|
697
|
-
|
|
893
|
+
b(l) != null ? (v(), V(W, {
|
|
698
894
|
key: 0,
|
|
699
895
|
title: "Clip to",
|
|
700
896
|
icon: "bi-bounding-box",
|
|
701
|
-
onClick:
|
|
702
|
-
})) :
|
|
897
|
+
onClick: d
|
|
898
|
+
})) : L("", !0)
|
|
703
899
|
]),
|
|
704
900
|
_: 1
|
|
705
901
|
})
|
|
706
902
|
]),
|
|
707
|
-
|
|
903
|
+
u.classificationElement.children.length > 0 ? (v(), P("div", {
|
|
708
904
|
key: 0,
|
|
709
|
-
id:
|
|
905
|
+
id: b(e),
|
|
710
906
|
class: "collapse show"
|
|
711
907
|
}, [
|
|
712
|
-
|
|
713
|
-
(
|
|
714
|
-
|
|
715
|
-
"ifc-entity":
|
|
716
|
-
"classification-element":
|
|
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,
|
|
916
|
+
], 8, Xt)) : L("", !0)
|
|
721
917
|
]);
|
|
722
918
|
};
|
|
723
919
|
}
|
|
724
|
-
}),
|
|
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(
|
|
730
|
-
const
|
|
731
|
-
function
|
|
732
|
-
const
|
|
733
|
-
return
|
|
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
|
|
736
|
-
const
|
|
737
|
-
return
|
|
931
|
+
function o() {
|
|
932
|
+
const i = t.getEntity(e.dataset);
|
|
933
|
+
return i ?? null;
|
|
738
934
|
}
|
|
739
|
-
return (
|
|
740
|
-
|
|
741
|
-
(
|
|
742
|
-
|
|
743
|
-
"ifc-entity":
|
|
744
|
-
"classification-element":
|
|
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
|
-
])) :
|
|
749
|
-
}
|
|
750
|
-
}),
|
|
751
|
-
if (
|
|
752
|
-
const
|
|
753
|
-
if (
|
|
754
|
-
const
|
|
755
|
-
return
|
|
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
|
-
},
|
|
760
|
-
name:
|
|
955
|
+
}, rn = (a) => ({
|
|
956
|
+
name: a.filename,
|
|
761
957
|
source: {
|
|
762
|
-
url:
|
|
958
|
+
url: a.file
|
|
763
959
|
},
|
|
764
960
|
type: "ifc",
|
|
765
961
|
visible: !0
|
|
766
|
-
}),
|
|
767
|
-
var
|
|
768
|
-
if (!
|
|
962
|
+
}), ln = (a, t) => {
|
|
963
|
+
var d, p, r, u, h, f, g, C, _;
|
|
964
|
+
if (!we(a))
|
|
769
965
|
return;
|
|
770
|
-
const
|
|
771
|
-
if (!
|
|
966
|
+
const e = (d = a.features) == null ? void 0 : d.at(0);
|
|
967
|
+
if (!e)
|
|
772
968
|
return;
|
|
773
|
-
|
|
774
|
-
const
|
|
775
|
-
|
|
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: ((
|
|
778
|
-
}),
|
|
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:
|
|
781
|
-
}),
|
|
782
|
-
for (const { name:
|
|
783
|
-
|
|
784
|
-
},
|
|
785
|
-
const
|
|
786
|
-
...
|
|
787
|
-
at:
|
|
788
|
-
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(
|
|
986
|
+
return Promise.resolve(s);
|
|
791
987
|
};
|
|
792
|
-
class
|
|
988
|
+
class jn {
|
|
793
989
|
constructor() {
|
|
794
|
-
|
|
795
|
-
|
|
990
|
+
c(this, "id", "builtin-ifc-loader");
|
|
991
|
+
c(this, "name", "IFC");
|
|
796
992
|
}
|
|
797
|
-
async initialize(
|
|
798
|
-
|
|
799
|
-
attributeExtractor:
|
|
800
|
-
entityBuilder:
|
|
993
|
+
async initialize(t) {
|
|
994
|
+
t.datasets.registerDatasetType("ifc", {
|
|
995
|
+
attributeExtractor: ln,
|
|
996
|
+
entityBuilder: cn,
|
|
801
997
|
fileExtensions: ["ifc"],
|
|
802
|
-
highlight:
|
|
998
|
+
highlight: an,
|
|
803
999
|
icon: "bi-building",
|
|
804
|
-
loader:
|
|
1000
|
+
loader: rn,
|
|
805
1001
|
name: "IFC",
|
|
806
|
-
propertyView:
|
|
807
|
-
}),
|
|
808
|
-
console.warn("Could not load web-ifc.wasm",
|
|
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
|
|
813
|
-
|
|
814
|
-
|
|
815
|
-
|
|
816
|
-
}
|
|
817
|
-
|
|
818
|
-
const
|
|
819
|
-
|
|
820
|
-
|
|
821
|
-
|
|
822
|
-
|
|
823
|
-
|
|
824
|
-
|
|
825
|
-
|
|
826
|
-
|
|
827
|
-
|
|
828
|
-
|
|
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
|
-
|
|
929
|
-
|
|
930
|
-
|
|
931
|
-
|
|
932
|
-
|
|
933
|
-
|
|
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
|
-
|
|
952
|
-
|
|
953
|
-
|
|
954
|
-
|
|
955
|
-
|
|
956
|
-
|
|
957
|
-
|
|
958
|
-
|
|
959
|
-
|
|
960
|
-
|
|
961
|
-
|
|
962
|
-
|
|
963
|
-
|
|
964
|
-
|
|
965
|
-
|
|
966
|
-
|
|
967
|
-
|
|
968
|
-
|
|
969
|
-
|
|
970
|
-
|
|
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
|
-
|
|
1097
|
-
|
|
1074
|
+
initialize(t) {
|
|
1075
|
+
t.widgets.addWidget({
|
|
1076
|
+
component: dn,
|
|
1077
|
+
id: "minimap-ol"
|
|
1078
|
+
});
|
|
1098
1079
|
}
|
|
1099
1080
|
}
|
|
1100
|
-
const
|
|
1081
|
+
const j = class j extends K {
|
|
1101
1082
|
constructor() {
|
|
1102
1083
|
super(...arguments);
|
|
1103
|
-
|
|
1104
|
-
|
|
1105
|
-
}
|
|
1106
|
-
pickFeaturesFrom(
|
|
1107
|
-
if (this.geometry.hasAttribute("color") &&
|
|
1108
|
-
const
|
|
1109
|
-
s
|
|
1110
|
-
s
|
|
1111
|
-
s
|
|
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
|
|
1094
|
+
return e.features = i, i;
|
|
1114
1095
|
}
|
|
1115
1096
|
return [];
|
|
1116
1097
|
}
|
|
1117
1098
|
};
|
|
1118
|
-
|
|
1119
|
-
let
|
|
1120
|
-
class
|
|
1121
|
-
constructor(
|
|
1122
|
-
super(new
|
|
1123
|
-
|
|
1124
|
-
|
|
1125
|
-
this.source =
|
|
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
|
|
1129
|
-
side:
|
|
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
|
-
|
|
1132
|
-
const
|
|
1133
|
-
|
|
1134
|
-
const
|
|
1135
|
-
|
|
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
|
|
1139
|
-
const { dataset:
|
|
1140
|
-
...
|
|
1141
|
-
at:
|
|
1142
|
-
featureProjection:
|
|
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(
|
|
1145
|
-
},
|
|
1146
|
-
var
|
|
1147
|
-
if (!
|
|
1125
|
+
return Promise.resolve(o);
|
|
1126
|
+
}, mn = (a, t) => {
|
|
1127
|
+
var s;
|
|
1128
|
+
if (!U.isPlyPickResult(a))
|
|
1148
1129
|
return;
|
|
1149
|
-
const
|
|
1150
|
-
if (!
|
|
1130
|
+
const e = (s = a.features) == null ? void 0 : s.at(0);
|
|
1131
|
+
if (!e)
|
|
1151
1132
|
return;
|
|
1152
|
-
|
|
1133
|
+
t.has("PLY") || t.set("PLY", []), t.get("PLY").push({ key: "Color", value: e.color });
|
|
1153
1134
|
};
|
|
1154
|
-
class
|
|
1135
|
+
class Hn {
|
|
1155
1136
|
constructor() {
|
|
1156
|
-
|
|
1157
|
-
|
|
1137
|
+
c(this, "id", "builtin-ply-loader");
|
|
1138
|
+
c(this, "name", "PLY");
|
|
1158
1139
|
}
|
|
1159
|
-
initialize(
|
|
1160
|
-
|
|
1161
|
-
attributeExtractor:
|
|
1162
|
-
entityBuilder:
|
|
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
|
|
1169
|
-
|
|
1170
|
-
|
|
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
|
|
1157
|
+
class Rn {
|
|
1177
1158
|
constructor() {
|
|
1178
|
-
|
|
1179
|
-
|
|
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
|
-
|
|
1182
|
-
e
|
|
1183
|
-
|
|
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
|
|
1201
|
+
class Un {
|
|
1190
1202
|
constructor() {
|
|
1191
|
-
|
|
1192
|
-
|
|
1193
|
-
|
|
1194
|
-
|
|
1195
|
-
|
|
1196
|
-
|
|
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(
|
|
1199
|
-
this._context =
|
|
1210
|
+
initialize(t) {
|
|
1211
|
+
this._context = t, t.events.addEventListener("ready", this.start.bind(this));
|
|
1200
1212
|
}
|
|
1201
1213
|
buildTours() {
|
|
1202
|
-
const
|
|
1214
|
+
const t = this._camera, e = new w.Tour({
|
|
1203
1215
|
tourName: "main",
|
|
1204
1216
|
useModalOverlay: !0
|
|
1205
|
-
}),
|
|
1217
|
+
}), n = new w.Tour({
|
|
1206
1218
|
tourName: "navigating",
|
|
1207
1219
|
useModalOverlay: !0
|
|
1208
|
-
}),
|
|
1220
|
+
}), s = new w.Tour({
|
|
1209
1221
|
tourName: "analyzing",
|
|
1210
1222
|
useModalOverlay: !0
|
|
1211
|
-
}),
|
|
1223
|
+
}), o = [
|
|
1212
1224
|
{ action: () => {
|
|
1213
|
-
var
|
|
1214
|
-
return (
|
|
1225
|
+
var r;
|
|
1226
|
+
return (r = w.activeTour) == null ? void 0 : r.next();
|
|
1215
1227
|
}, text: "Next" },
|
|
1216
1228
|
{ action: () => {
|
|
1217
|
-
var
|
|
1218
|
-
return (
|
|
1229
|
+
var r;
|
|
1230
|
+
return (r = w.activeTour) == null ? void 0 : r.cancel();
|
|
1219
1231
|
}, secondary: !0, text: "Exit" }
|
|
1220
|
-
],
|
|
1221
|
-
var
|
|
1222
|
-
const
|
|
1223
|
-
if (
|
|
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
|
|
1226
|
-
|
|
1227
|
-
const
|
|
1228
|
-
|
|
1229
|
-
},
|
|
1230
|
-
const
|
|
1231
|
-
if (
|
|
1232
|
-
return
|
|
1233
|
-
const
|
|
1234
|
-
document.querySelector(
|
|
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
|
-
|
|
1248
|
+
g.observe(document.body, {
|
|
1237
1249
|
childList: !0,
|
|
1238
1250
|
subtree: !0
|
|
1239
1251
|
});
|
|
1240
1252
|
});
|
|
1241
|
-
|
|
1253
|
+
e.addStep({
|
|
1242
1254
|
buttons: [
|
|
1243
1255
|
{
|
|
1244
1256
|
action: () => {
|
|
1245
|
-
var
|
|
1246
|
-
(
|
|
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
|
|
1253
|
-
(
|
|
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
|
|
1260
|
-
return (
|
|
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:
|
|
1283
|
+
show: i
|
|
1272
1284
|
}
|
|
1273
|
-
}),
|
|
1285
|
+
}), n.addStep({
|
|
1274
1286
|
attachTo: {
|
|
1275
1287
|
element: "#main-view",
|
|
1276
1288
|
on: "bottom"
|
|
1277
1289
|
},
|
|
1278
|
-
buttons:
|
|
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:
|
|
1294
|
+
show: i
|
|
1283
1295
|
}
|
|
1284
|
-
}),
|
|
1296
|
+
}), n.addStep({
|
|
1285
1297
|
attachTo: {
|
|
1286
1298
|
element: "#main-view",
|
|
1287
1299
|
on: "bottom"
|
|
1288
1300
|
},
|
|
1289
|
-
buttons:
|
|
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 &&
|
|
1306
|
+
this._cameraCallback && t.removeEventListener("interaction-end", this._cameraCallback), this._cameraCallback = null;
|
|
1295
1307
|
},
|
|
1296
1308
|
show: () => {
|
|
1297
|
-
let
|
|
1309
|
+
let r = 0;
|
|
1298
1310
|
this._cameraCallback = () => {
|
|
1299
|
-
var
|
|
1300
|
-
|
|
1301
|
-
},
|
|
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
|
-
}),
|
|
1316
|
+
}), n.addStep({
|
|
1305
1317
|
attachTo: {
|
|
1306
1318
|
element: "#toolbar",
|
|
1307
1319
|
on: "right"
|
|
1308
1320
|
},
|
|
1309
|
-
beforeShowPromise: () =>
|
|
1310
|
-
buttons:
|
|
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:
|
|
1326
|
+
show: i
|
|
1315
1327
|
}
|
|
1316
|
-
}),
|
|
1328
|
+
}), n.addStep({
|
|
1317
1329
|
attachTo: {
|
|
1318
1330
|
element: "#basemap-list",
|
|
1319
1331
|
on: "right"
|
|
1320
1332
|
},
|
|
1321
|
-
beforeShowPromise: () =>
|
|
1322
|
-
buttons:
|
|
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:
|
|
1338
|
+
show: i
|
|
1327
1339
|
}
|
|
1328
|
-
}),
|
|
1340
|
+
}), n.addStep({
|
|
1329
1341
|
attachTo: {
|
|
1330
1342
|
element: "#overlay-list",
|
|
1331
1343
|
on: "right"
|
|
1332
1344
|
},
|
|
1333
|
-
beforeShowPromise: () =>
|
|
1334
|
-
buttons:
|
|
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:
|
|
1350
|
+
show: i
|
|
1339
1351
|
}
|
|
1340
|
-
}),
|
|
1352
|
+
}), n.addStep({
|
|
1341
1353
|
attachTo: {
|
|
1342
1354
|
element: "#dataset-list",
|
|
1343
1355
|
on: "right"
|
|
1344
1356
|
},
|
|
1345
|
-
beforeShowPromise: () =>
|
|
1346
|
-
buttons:
|
|
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:
|
|
1362
|
+
show: i
|
|
1351
1363
|
}
|
|
1352
|
-
}),
|
|
1364
|
+
}), n.addStep({
|
|
1353
1365
|
attachTo: {
|
|
1354
1366
|
element: "#datasets-drop-zone",
|
|
1355
1367
|
on: "right"
|
|
1356
1368
|
},
|
|
1357
|
-
beforeShowPromise: () =>
|
|
1358
|
-
buttons:
|
|
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:
|
|
1374
|
+
show: i
|
|
1363
1375
|
}
|
|
1364
|
-
}),
|
|
1376
|
+
}), n.addStep({
|
|
1365
1377
|
attachTo: {
|
|
1366
1378
|
element: "#main-view",
|
|
1367
1379
|
on: "bottom"
|
|
1368
1380
|
},
|
|
1369
|
-
buttons:
|
|
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:
|
|
1385
|
+
show: i
|
|
1374
1386
|
}
|
|
1375
|
-
}),
|
|
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
|
|
1384
|
-
(
|
|
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
|
|
1391
|
-
return (
|
|
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:
|
|
1412
|
+
show: i
|
|
1401
1413
|
}
|
|
1402
|
-
}),
|
|
1414
|
+
}), s.addStep({
|
|
1403
1415
|
attachTo: {
|
|
1404
1416
|
element: "#annotations-fieldset",
|
|
1405
1417
|
on: "right"
|
|
1406
1418
|
},
|
|
1407
|
-
beforeShowPromise: () =>
|
|
1408
|
-
buttons:
|
|
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:
|
|
1424
|
+
show: i
|
|
1413
1425
|
}
|
|
1414
|
-
}),
|
|
1426
|
+
}), s.addStep({
|
|
1415
1427
|
attachTo: {
|
|
1416
1428
|
element: "#annotations-fieldset",
|
|
1417
1429
|
on: "right"
|
|
1418
1430
|
},
|
|
1419
|
-
beforeShowPromise: () =>
|
|
1420
|
-
buttons:
|
|
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:
|
|
1436
|
+
show: i
|
|
1425
1437
|
}
|
|
1426
|
-
}),
|
|
1438
|
+
}), $e("measurements") && s.addStep({
|
|
1427
1439
|
attachTo: {
|
|
1428
1440
|
element: "#panel-container",
|
|
1429
1441
|
on: "right"
|
|
1430
1442
|
},
|
|
1431
|
-
beforeShowPromise: () =>
|
|
1432
|
-
buttons:
|
|
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:
|
|
1448
|
+
show: i
|
|
1437
1449
|
}
|
|
1438
|
-
}),
|
|
1450
|
+
}), s.addStep({
|
|
1439
1451
|
attachTo: {
|
|
1440
1452
|
element: "#panel-container",
|
|
1441
1453
|
on: "right"
|
|
1442
1454
|
},
|
|
1443
|
-
beforeShowPromise: () =>
|
|
1455
|
+
beforeShowPromise: () => l("toolbar-analysis", "#panel-container .card"),
|
|
1444
1456
|
buttons: [{ action: () => {
|
|
1445
|
-
var
|
|
1446
|
-
return (
|
|
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:
|
|
1463
|
+
show: i
|
|
1452
1464
|
}
|
|
1453
1465
|
});
|
|
1454
|
-
const
|
|
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
|
-
|
|
1457
|
-
|
|
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
|
|
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:
|
|
1469
|
-
|
|
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:
|
|
1486
|
+
const { analyzingTour: t, mainTour: e, navigatingTour: n } = this.getTours();
|
|
1475
1487
|
this._camera = this._context.view.getCameraController();
|
|
1476
|
-
const
|
|
1477
|
-
if (
|
|
1478
|
-
const
|
|
1479
|
-
|
|
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
|
-
|
|
1485
|
-
|
|
1486
|
-
|
|
1487
|
-
|
|
1488
|
-
|
|
1489
|
-
|
|
1490
|
-
|
|
1491
|
-
|
|
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
|