@giro3d/piero 1.0.0-beta.0 → 1.0.0-beta.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/Components.cjs.js +5 -1
- package/dist/Components.cjs.js.map +1 -1
- package/dist/Components.es.js +6286 -432
- package/dist/Components.es.js.map +1 -1
- package/dist/assets/piero.css +2 -2
- package/dist/index.cjs.js +11 -3
- package/dist/index.cjs.js.map +1 -1
- package/dist/index.es.js +8206 -4441
- package/dist/index.es.js.map +1 -1
- package/dist/modules.cjs.js +2 -1
- package/dist/modules.cjs.js.map +1 -1
- package/dist/modules.es.js +1051 -414
- package/dist/modules.es.js.map +1 -1
- package/dist/src/api/AnalysisApi.d.ts +15 -0
- package/dist/src/api/DatasetApi.d.ts +28 -0
- package/dist/src/api/NotificationApi.d.ts +10 -0
- package/dist/src/api/ViewApi.d.ts +4 -0
- package/dist/src/api/index.d.ts +2 -2
- package/dist/src/components/panels/AnalysisPanel.vue.d.ts +1 -1
- package/dist/src/components/panels/DatasetOrGroupItem.vue.d.ts +0 -2
- package/dist/src/components/panels/analysis/ToolWrapper.vue.d.ts +1 -6
- package/dist/src/context.d.ts +7 -0
- package/dist/src/index.d.ts +2 -1
- package/dist/src/module.d.ts +4 -0
- package/dist/src/modules/ClippingBoxAnalysis.d.ts +18 -0
- package/dist/src/modules/CrossSectionAnalysis.d.ts +11 -0
- package/dist/src/modules/DownloadDataset.d.ts +12 -0
- package/dist/src/modules/FloodingPlaneAnalysis.d.ts +11 -0
- package/dist/src/modules/IFCLoader.d.ts +1 -0
- package/dist/src/modules/PLYLoader.d.ts +1 -0
- package/dist/src/modules/PotreeLoader.d.ts +1 -0
- package/dist/src/modules/Tour.d.ts +1 -0
- package/dist/src/{services/analysis → modules/clippingBoxAnalysis}/ClippingBoxManager.d.ts +9 -3
- package/dist/src/modules/clippingBoxAnalysis/store.d.ts +2268 -0
- package/dist/src/modules/crossSectionAnalysis/CrossSectionManager.d.ts +8 -0
- package/dist/src/modules/crossSectionAnalysis/store.d.ts +522 -0
- package/dist/src/modules/floodingPlaneAnalysis/FloodingPlaneManager.d.ts +9 -0
- package/dist/src/{types/FloodingPlane.d.ts → modules/floodingPlaneAnalysis/FloodingPlaneObject.d.ts} +2 -2
- package/dist/src/modules/floodingPlaneAnalysis/store.d.ts +16 -0
- package/dist/src/modules/index.d.ts +5 -1
- package/dist/src/services/Giro3DManager.d.ts +0 -2
- package/dist/src/services/Picker.d.ts +1 -1
- package/dist/src/stores/analysis.d.ts +19 -1569
- package/dist/src/stores/datasets.d.ts +23 -1
- package/dist/src/stores/modules.d.ts +5 -1
- package/dist/src/stores/modules.test.d.ts +1 -0
- package/dist/src/stores/notifications.d.ts +1 -0
- package/package.json +1 -5
- package/dist/src/components/charts/BarChart.vue.d.ts +0 -4
- package/dist/src/components/charts/DoughnutChart.vue.d.ts +0 -4
- package/dist/src/components/panels/LoadingIndicator.vue.d.ts +0 -6
- package/dist/src/components/panels/analysis/FloodingPlane.vue.d.ts +0 -2
- package/dist/src/services/AnalysisManager.d.ts +0 -10
- package/dist/src/services/analysis/CrossSectionManager.d.ts +0 -9
- package/dist/src/services/analysis/FloodingPlaneManager.d.ts +0 -11
- package/dist/src/stores/statistics.d.ts +0 -8
- /package/dist/src/{components/panels/analysis → modules/clippingBoxAnalysis}/ClippingBox.vue.d.ts +0 -0
- /package/dist/src/{components/panels/analysis → modules/crossSectionAnalysis}/CrossSection.vue.d.ts +0 -0
- /package/dist/src/{components/panels/analysis/Statistics.vue.d.ts → modules/floodingPlaneAnalysis/FloodingPlane.vue.d.ts} +0 -0
package/dist/modules.es.js
CHANGED
|
@@ -1,82 +1,418 @@
|
|
|
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
|
-
|
|
16
|
-
|
|
1
|
+
var xt = Object.defineProperty;
|
|
2
|
+
var Ct = (l, e, t) => e in l ? xt(l, e, { enumerable: !0, configurable: !0, writable: !0, value: t }) : l[e] = t;
|
|
3
|
+
var m = (l, e, t) => Ct(l, typeof e != "symbol" ? e + "" : e, t);
|
|
4
|
+
import { V as Y, N as rt, i as lt, a2 as et, F as R, s as It, P as Pt, o as Z, n as ct, j as $, G as ut, f as K, M as St, u as Tt, q as Et, r as Ft, U as nt, X, Y as Bt, _ as dt, w as Mt, Z as kt, a3 as pt, a4 as Dt, a5 as Nt, z as At, b as L, C as ht, a6 as st, a7 as Lt, a8 as zt, h as Ot } from "./Components.es.js";
|
|
5
|
+
import { a9 as xn } from "./Components.es.js";
|
|
6
|
+
import { ref as O, defineComponent as q, createElementBlock as N, openBlock as D, createElementVNode as v, createVNode as A, unref as M, Fragment as tt, resolveComponent as Rt, createCommentVNode as H, createBlock as ot, normalizeClass as it, toDisplayString as jt, withCtx as at, renderList as ft } from "vue";
|
|
7
|
+
import { defineStore as mt } from "pinia";
|
|
8
|
+
import Ut from "@giro3d/giro3d/core/geographic/Coordinates";
|
|
9
|
+
import gt, { isEntity3D as Vt } from "@giro3d/giro3d/entities/Entity3D";
|
|
10
|
+
import Yt from "@giro3d/giro3d/gui/EntityPanel";
|
|
11
|
+
import { Components as $t, SimpleScene as Gt, SimpleRenderer as Ht, SimpleCamera as Wt, SimpleRaycaster as qt, IfcPropertiesUtils as z, FragmentBoundingBox as Xt, FragmentManager as Zt, FragmentClassifier as Qt, FragmentIfcLoader as Jt, toCompositeID as Kt, IfcCategoryMap as te } from "openbim-components";
|
|
12
|
+
import ee from "@giro3d/giro3d/gui/EntityInspector";
|
|
13
|
+
import ne from "@giro3d/giro3d/entities/PointCloud";
|
|
14
|
+
import se from "@giro3d/giro3d/sources/PotreeSource";
|
|
15
|
+
import F from "shepherd.js";
|
|
16
|
+
const yt = mt("crossSection", () => {
|
|
17
|
+
const l = O(0), e = O(new Y(0, 0, 0)), t = O(!1);
|
|
18
|
+
function s(n) {
|
|
19
|
+
t.value = n;
|
|
20
|
+
}
|
|
21
|
+
function o(n) {
|
|
22
|
+
l.value = n;
|
|
23
|
+
}
|
|
24
|
+
function i(n) {
|
|
25
|
+
e.value = n;
|
|
26
|
+
}
|
|
27
|
+
return {
|
|
28
|
+
center: e,
|
|
29
|
+
enable: t,
|
|
30
|
+
orientation: l,
|
|
31
|
+
setCenter: i,
|
|
32
|
+
setEnabled: s,
|
|
33
|
+
setOrientation: o
|
|
34
|
+
};
|
|
35
|
+
}), oe = { class: "input-group mb-3" }, ie = { class: "input-group mb-3" }, ae = ["value"], re = { class: "input-group mb-3" }, le = ["value"], ce = { class: "input-group" }, ue = { class: "input-group" }, de = ["value"], pe = ["value"], he = /* @__PURE__ */ q({
|
|
36
|
+
__name: "CrossSection",
|
|
37
|
+
setup(l) {
|
|
38
|
+
const e = yt();
|
|
39
|
+
function t(i) {
|
|
40
|
+
e.setOrientation(i);
|
|
41
|
+
}
|
|
42
|
+
function s(i) {
|
|
43
|
+
const n = e.center.clone();
|
|
44
|
+
n.setX(i), e.setCenter(n);
|
|
45
|
+
}
|
|
46
|
+
function o(i) {
|
|
47
|
+
const n = e.center.clone();
|
|
48
|
+
n.setY(i), e.setCenter(n);
|
|
49
|
+
}
|
|
50
|
+
return (i, n) => (D(), N("div", null, [
|
|
51
|
+
v("div", oe, [
|
|
52
|
+
A(rt, {
|
|
53
|
+
"model-value": M(e).enable,
|
|
54
|
+
"onUpdate:modelValue": n[0] || (n[0] = (r) => M(e).setEnabled(r)),
|
|
55
|
+
id: "cross-section-enable",
|
|
56
|
+
title: "foo"
|
|
57
|
+
}, null, 8, ["model-value"]),
|
|
58
|
+
n[5] || (n[5] = v("label", {
|
|
59
|
+
for: "cross-section-enable",
|
|
60
|
+
class: "form-label"
|
|
61
|
+
}, "Enable cross section", -1))
|
|
62
|
+
]),
|
|
63
|
+
v("div", ie, [
|
|
64
|
+
n[6] || (n[6] = v("label", {
|
|
65
|
+
for: "plane-orientation-range",
|
|
66
|
+
class: "form-label"
|
|
67
|
+
}, "Plane orientation (0-360°)", -1)),
|
|
68
|
+
v("input", {
|
|
69
|
+
id: "plane-orientation-range",
|
|
70
|
+
title: "Altitude",
|
|
71
|
+
type: "range",
|
|
72
|
+
class: "form-range",
|
|
73
|
+
min: "0",
|
|
74
|
+
step: "0.1",
|
|
75
|
+
max: "360",
|
|
76
|
+
value: M(e).orientation,
|
|
77
|
+
onInput: n[1] || (n[1] = (r) => t(Number.parseFloat(r.target.value)))
|
|
78
|
+
}, null, 40, ae)
|
|
79
|
+
]),
|
|
80
|
+
v("div", re, [
|
|
81
|
+
v("input", {
|
|
82
|
+
type: "number",
|
|
83
|
+
class: "form-control",
|
|
84
|
+
id: "plane-orientation-number",
|
|
85
|
+
step: "0.1",
|
|
86
|
+
value: M(e).orientation,
|
|
87
|
+
onInput: n[2] || (n[2] = (r) => t(Number.parseFloat(r.target.value)))
|
|
88
|
+
}, null, 40, le)
|
|
89
|
+
]),
|
|
90
|
+
n[8] || (n[8] = v("hr", null, null, -1)),
|
|
91
|
+
v("div", ce, [
|
|
92
|
+
n[7] || (n[7] = v("label", { class: "form-label" }, "Center (x, y)", -1)),
|
|
93
|
+
v("div", ue, [
|
|
94
|
+
v("input", {
|
|
95
|
+
type: "number",
|
|
96
|
+
class: "form-control",
|
|
97
|
+
id: "plane-center-x",
|
|
98
|
+
value: M(e).center.x,
|
|
99
|
+
onInput: n[3] || (n[3] = (r) => s(Number.parseFloat(r.target.value)))
|
|
100
|
+
}, null, 40, de),
|
|
101
|
+
v("input", {
|
|
102
|
+
type: "number",
|
|
103
|
+
class: "form-control",
|
|
104
|
+
id: "plane-center-y",
|
|
105
|
+
value: M(e).center.y,
|
|
106
|
+
onInput: n[4] || (n[4] = (r) => o(Number.parseFloat(r.target.value)))
|
|
107
|
+
}, null, 40, pe)
|
|
108
|
+
])
|
|
109
|
+
])
|
|
110
|
+
]));
|
|
111
|
+
}
|
|
112
|
+
});
|
|
113
|
+
class fe {
|
|
114
|
+
constructor(e) {
|
|
115
|
+
m(this, "_store", yt());
|
|
116
|
+
this.context = e, e.events.addEventListener("ready", () => {
|
|
117
|
+
const t = e.configuration.default_crs, s = e.configuration.analysis.cross_section;
|
|
118
|
+
this._store.setOrientation(s.orientation);
|
|
119
|
+
const o = s.pivot, i = new Ut(o.crs ?? t, o.x, o.y, 0).as(
|
|
120
|
+
t
|
|
121
|
+
);
|
|
122
|
+
this._store.setCenter(i.toVector3()), this._store.$onAction(({ after: n, name: r }) => {
|
|
123
|
+
n(() => {
|
|
124
|
+
switch (r) {
|
|
125
|
+
case "setCenter":
|
|
126
|
+
case "setEnabled":
|
|
127
|
+
case "setOrientation":
|
|
128
|
+
this.updateCrossSection();
|
|
129
|
+
break;
|
|
130
|
+
}
|
|
131
|
+
});
|
|
132
|
+
}), this.updateCrossSection();
|
|
133
|
+
});
|
|
134
|
+
}
|
|
135
|
+
dispose() {
|
|
136
|
+
}
|
|
137
|
+
updateCrossSection() {
|
|
138
|
+
const e = [];
|
|
139
|
+
if (this._store.enable) {
|
|
140
|
+
const s = lt.DEG2RAD * this._store.orientation, o = Math.cos(s), i = Math.sin(s), n = new Y(o, i, 0), r = new et(n, 0).distanceToPoint(this._store.center), g = new et(n, -r);
|
|
141
|
+
e.push(g);
|
|
142
|
+
}
|
|
143
|
+
const t = this.context.view.getInstance();
|
|
144
|
+
t.renderer.clippingPlanes = e;
|
|
145
|
+
for (const s of this.context.view.getInstance().getEntities())
|
|
146
|
+
Vt(s) && s.dispatchEvent({
|
|
147
|
+
clippingPlanes: e,
|
|
148
|
+
type: "clippingPlanes-property-changed"
|
|
149
|
+
});
|
|
150
|
+
t.notifyChange();
|
|
151
|
+
}
|
|
152
|
+
}
|
|
153
|
+
class pn {
|
|
154
|
+
constructor() {
|
|
155
|
+
m(this, "id", "builtin-cross-section-analysis");
|
|
156
|
+
m(this, "name", "Cross section");
|
|
157
|
+
m(this, "_manager", null);
|
|
158
|
+
}
|
|
159
|
+
initialize(e) {
|
|
160
|
+
e.analysis.registerTool({
|
|
161
|
+
component: he,
|
|
162
|
+
icon: "bi-circle-half",
|
|
163
|
+
name: "Cross section"
|
|
164
|
+
}), this._manager = new fe(e);
|
|
165
|
+
}
|
|
166
|
+
}
|
|
167
|
+
function Q(l) {
|
|
168
|
+
if ("url" in l.config && typeof l.config.url == "string")
|
|
169
|
+
return l.config.url;
|
|
170
|
+
if ("source" in l.config && typeof l.config.source == "object" && "url" in l.config.source && typeof l.config.source.url == "string")
|
|
171
|
+
return l.config.source.url;
|
|
172
|
+
}
|
|
173
|
+
function me(l) {
|
|
174
|
+
return Q(l) != null;
|
|
175
|
+
}
|
|
176
|
+
class hn {
|
|
177
|
+
constructor() {
|
|
178
|
+
m(this, "id", "builtin-download-dataset");
|
|
179
|
+
m(this, "name", "Download dataset");
|
|
180
|
+
m(this, "_context", null);
|
|
181
|
+
}
|
|
182
|
+
initialize(e) {
|
|
183
|
+
this._context = e, e.datasets.registerDatasetAction({
|
|
184
|
+
action: this.download.bind(this),
|
|
185
|
+
icon: "bi-download",
|
|
186
|
+
predicate: me,
|
|
187
|
+
title: "Download dataset"
|
|
188
|
+
});
|
|
189
|
+
}
|
|
190
|
+
download(e) {
|
|
191
|
+
const t = Q(e);
|
|
192
|
+
if (t == null) {
|
|
193
|
+
console.warn("invalid");
|
|
194
|
+
return;
|
|
195
|
+
}
|
|
196
|
+
const s = this._context, o = new URL(t).pathname.split("/"), i = o[o.length - 1];
|
|
197
|
+
console.info(`download ${Q(e)}`), R.fetch(t).then((n) => {
|
|
198
|
+
if (!n.ok)
|
|
199
|
+
throw new Error(`${n.status} ${n.statusText}`);
|
|
200
|
+
return n.blob();
|
|
201
|
+
}).then((n) => {
|
|
202
|
+
It.downloadBlob(n, i), s.notifications.pushNotification({
|
|
203
|
+
level: "success",
|
|
204
|
+
text: i,
|
|
205
|
+
title: "Download successful"
|
|
206
|
+
});
|
|
207
|
+
}).catch((n) => {
|
|
208
|
+
console.error(n);
|
|
209
|
+
const r = n instanceof Error ? n.message : "Download failed";
|
|
210
|
+
s.notifications.pushNotification({
|
|
211
|
+
level: "error",
|
|
212
|
+
text: r,
|
|
213
|
+
title: e.name
|
|
214
|
+
});
|
|
215
|
+
});
|
|
216
|
+
}
|
|
217
|
+
}
|
|
218
|
+
const bt = mt("floodingPlane", () => {
|
|
219
|
+
const l = O(0), e = O(!1);
|
|
220
|
+
function t() {
|
|
221
|
+
return l.value;
|
|
222
|
+
}
|
|
223
|
+
function s(i) {
|
|
224
|
+
l.value = i;
|
|
225
|
+
}
|
|
226
|
+
function o(i) {
|
|
227
|
+
e.value = i;
|
|
228
|
+
}
|
|
229
|
+
return { enable: e, getHeight: t, setEnabled: o, setHeight: s };
|
|
230
|
+
}), ge = { class: "input-group mb-3" }, ye = { class: "input-group mb-3" }, be = ["value"], _e = { class: "input-group mb-3" }, we = ["value"], ve = /* @__PURE__ */ q({
|
|
231
|
+
__name: "FloodingPlane",
|
|
232
|
+
setup(l) {
|
|
233
|
+
const e = bt();
|
|
234
|
+
function t(s) {
|
|
235
|
+
e.setHeight(s);
|
|
236
|
+
}
|
|
237
|
+
return (s, o) => (D(), N(tt, null, [
|
|
238
|
+
v("div", ge, [
|
|
239
|
+
A(rt, {
|
|
240
|
+
"model-value": M(e).enable,
|
|
241
|
+
"onUpdate:modelValue": o[0] || (o[0] = (i) => M(e).setEnabled(i)),
|
|
242
|
+
id: "flooding-plane-enable",
|
|
243
|
+
title: "foo"
|
|
244
|
+
}, null, 8, ["model-value"]),
|
|
245
|
+
o[3] || (o[3] = v("label", {
|
|
246
|
+
for: "flooding-plane-enable",
|
|
247
|
+
class: "form-label"
|
|
248
|
+
}, "Enable flooding plane", -1))
|
|
249
|
+
]),
|
|
250
|
+
v("div", ye, [
|
|
251
|
+
o[5] || (o[5] = v("label", {
|
|
252
|
+
for: "flooding-altitude-range",
|
|
253
|
+
class: "form-label"
|
|
254
|
+
}, "Altitude", -1)),
|
|
255
|
+
v("input", {
|
|
256
|
+
id: "flooding-altitude-range",
|
|
257
|
+
title: "Altitude",
|
|
258
|
+
type: "range",
|
|
259
|
+
class: "form-range",
|
|
260
|
+
min: "0",
|
|
261
|
+
step: "0.1",
|
|
262
|
+
max: "500",
|
|
263
|
+
value: M(e).getHeight(),
|
|
264
|
+
onInput: o[1] || (o[1] = (i) => t(Number.parseFloat(i.target.value)))
|
|
265
|
+
}, null, 40, be),
|
|
266
|
+
v("div", _e, [
|
|
267
|
+
v("input", {
|
|
268
|
+
type: "number",
|
|
269
|
+
class: "form-control",
|
|
270
|
+
id: "flooding-altitude-number",
|
|
271
|
+
step: "0.1",
|
|
272
|
+
value: M(e).getHeight(),
|
|
273
|
+
onInput: o[2] || (o[2] = (i) => t(Number.parseFloat(i.target.value)))
|
|
274
|
+
}, null, 40, we),
|
|
275
|
+
o[4] || (o[4] = v("span", { class: "input-group-text" }, "m", -1))
|
|
276
|
+
])
|
|
277
|
+
])
|
|
278
|
+
], 64));
|
|
279
|
+
}
|
|
280
|
+
});
|
|
281
|
+
class xe {
|
|
282
|
+
constructor() {
|
|
283
|
+
m(this, "geometry");
|
|
284
|
+
m(this, "material");
|
|
285
|
+
m(this, "object3D");
|
|
286
|
+
m(this, "_height");
|
|
287
|
+
this.geometry = new Pt(1, 1, 1, 1), this.material = new Z({ color: 43690, opacity: 0.5, transparent: !0 }), this.object3D = new ct(this.geometry, this.material), this.object3D.renderOrder = 2, this.visible = !1, this._height = 0;
|
|
288
|
+
}
|
|
289
|
+
set height(e) {
|
|
290
|
+
this._height = e;
|
|
291
|
+
}
|
|
292
|
+
get height() {
|
|
293
|
+
return this._height;
|
|
294
|
+
}
|
|
295
|
+
set visible(e) {
|
|
296
|
+
this.object3D.visible = e;
|
|
297
|
+
}
|
|
298
|
+
get visible() {
|
|
299
|
+
return this.object3D.visible;
|
|
300
|
+
}
|
|
301
|
+
dispose() {
|
|
302
|
+
this.object3D.removeFromParent(), this.geometry.dispose(), this.material.dispose();
|
|
303
|
+
}
|
|
304
|
+
setPosition(e, t, s, o, i) {
|
|
305
|
+
this.object3D.scale.set(o, i, 1), this.object3D.position.set(e, t, s), this.object3D.updateMatrixWorld();
|
|
306
|
+
}
|
|
307
|
+
}
|
|
308
|
+
class Ce {
|
|
309
|
+
constructor(e) {
|
|
310
|
+
m(this, "_context");
|
|
311
|
+
m(this, "_plane");
|
|
312
|
+
m(this, "_store", bt());
|
|
313
|
+
this._context = e, this._plane = null, e.events.addEventListener("ready", () => {
|
|
314
|
+
this._store.$onAction(({ after: t, name: s }) => {
|
|
315
|
+
t(() => {
|
|
316
|
+
switch (s) {
|
|
317
|
+
case "setEnabled":
|
|
318
|
+
this.updatePlane();
|
|
319
|
+
break;
|
|
320
|
+
case "setHeight":
|
|
321
|
+
this.updatePlane();
|
|
322
|
+
break;
|
|
323
|
+
}
|
|
324
|
+
});
|
|
325
|
+
});
|
|
326
|
+
});
|
|
327
|
+
}
|
|
328
|
+
dispose() {
|
|
329
|
+
this._plane && (this._context.view.getInstance().remove(this._plane.object3D), this._plane.dispose());
|
|
330
|
+
}
|
|
331
|
+
async updatePlane() {
|
|
332
|
+
this._plane || (this._plane = new xe(), await this._context.view.getInstance().add(this._plane.object3D));
|
|
333
|
+
const e = this._context.view.getBoundingBox(), t = e.getCenter(new Y()), s = e.getSize(new Y());
|
|
334
|
+
this._plane.visible = this._store.enable, this._plane.setPosition(t.x, t.y, this._store.getHeight(), s.x, s.y), this._context.view.getInstance().notifyChange();
|
|
335
|
+
}
|
|
336
|
+
}
|
|
337
|
+
class fn {
|
|
338
|
+
constructor() {
|
|
339
|
+
m(this, "id", "builtin-flooding-plane-analysis");
|
|
340
|
+
m(this, "name", "Flooding plane");
|
|
341
|
+
m(this, "_manager", null);
|
|
342
|
+
}
|
|
343
|
+
initialize(e) {
|
|
344
|
+
e.analysis.registerTool({
|
|
345
|
+
component: ve,
|
|
346
|
+
icon: "bi-layers-half",
|
|
347
|
+
name: "Flooding plane"
|
|
348
|
+
}), this._manager = new Ce(e);
|
|
349
|
+
}
|
|
350
|
+
}
|
|
351
|
+
const j = new St(), Ie = {
|
|
352
|
+
bbox: new Z({
|
|
17
353
|
color: "#FFFF00",
|
|
18
354
|
depthTest: !0,
|
|
19
355
|
opacity: 0.2,
|
|
20
356
|
transparent: !0
|
|
21
357
|
}),
|
|
22
|
-
selection: new
|
|
358
|
+
selection: new Z({
|
|
23
359
|
color: "#FF0000",
|
|
24
360
|
depthTest: !1,
|
|
25
361
|
opacity: 0.6,
|
|
26
362
|
transparent: !0
|
|
27
363
|
})
|
|
28
|
-
},
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
],
|
|
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 {
|
|
36
372
|
constructor(t) {
|
|
37
|
-
super(new
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
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");
|
|
47
383
|
// Currently selected fragments
|
|
48
|
-
|
|
384
|
+
m(this, "_indexMap");
|
|
49
385
|
// Properties relationships
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
this._source = t, this._components = new
|
|
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(
|
|
53
389
|
this._components,
|
|
54
390
|
document.createElement("div")
|
|
55
|
-
), this._components.camera = new
|
|
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;
|
|
56
392
|
}
|
|
57
393
|
clearHighlight(t = "selection") {
|
|
58
|
-
for (const
|
|
59
|
-
const
|
|
60
|
-
|
|
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();
|
|
61
397
|
}
|
|
62
398
|
this.notifyChange(this), this._ifcSelection[t] = {};
|
|
63
399
|
}
|
|
64
400
|
getBoundingBoxById(t) {
|
|
65
401
|
this.clearHighlight("bbox"), this.highlightById(t, "bbox");
|
|
66
|
-
const
|
|
67
|
-
if (
|
|
402
|
+
const s = this._fragmentBoundingBox;
|
|
403
|
+
if (s === null)
|
|
68
404
|
throw new Error("Must call initClassification before getBoundingBoxById");
|
|
69
|
-
const
|
|
70
|
-
|
|
71
|
-
const
|
|
72
|
-
if (!Object.keys(
|
|
405
|
+
const o = this._fragmentManager;
|
|
406
|
+
s.reset();
|
|
407
|
+
const i = this._ifcSelection.bbox;
|
|
408
|
+
if (!Object.keys(i).length)
|
|
73
409
|
return;
|
|
74
|
-
for (const
|
|
75
|
-
const
|
|
76
|
-
|
|
410
|
+
for (const f of Object.keys(i)) {
|
|
411
|
+
const P = o.list[f].fragments.bbox;
|
|
412
|
+
s.addMesh(P.mesh);
|
|
77
413
|
}
|
|
78
|
-
const n =
|
|
79
|
-
return n.min.y = -
|
|
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;
|
|
80
416
|
}
|
|
81
417
|
getClassification() {
|
|
82
418
|
if (this._classificationCache === null)
|
|
@@ -84,104 +420,104 @@ const x = new wt(), Lt = {
|
|
|
84
420
|
return this._classificationCache;
|
|
85
421
|
}
|
|
86
422
|
getProperties(t) {
|
|
87
|
-
const
|
|
88
|
-
if (!
|
|
423
|
+
const s = [], o = this._model.properties;
|
|
424
|
+
if (!o)
|
|
89
425
|
return [];
|
|
90
|
-
for (const
|
|
91
|
-
const n =
|
|
426
|
+
for (const i of this._indexMap[t]) {
|
|
427
|
+
const n = o[i];
|
|
92
428
|
if (n == null)
|
|
93
429
|
continue;
|
|
94
|
-
const { name: r } =
|
|
430
|
+
const { name: r } = z.getEntityName(o, i);
|
|
95
431
|
if (r !== null) {
|
|
96
|
-
if (n.type ===
|
|
97
|
-
const
|
|
98
|
-
if (
|
|
99
|
-
for (const
|
|
100
|
-
if (
|
|
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)
|
|
101
437
|
continue;
|
|
102
|
-
const
|
|
103
|
-
|
|
438
|
+
const f = this.getProperty(w);
|
|
439
|
+
f !== null && s.push({
|
|
104
440
|
parentName: r,
|
|
105
|
-
...
|
|
441
|
+
...f
|
|
106
442
|
});
|
|
107
443
|
}
|
|
108
|
-
} else if (n.type ===
|
|
109
|
-
const
|
|
110
|
-
|
|
111
|
-
|
|
444
|
+
} else if (n.type === wt) {
|
|
445
|
+
const g = z.getQsetQuantities(
|
|
446
|
+
o,
|
|
447
|
+
i
|
|
112
448
|
);
|
|
113
|
-
if (
|
|
114
|
-
for (const
|
|
115
|
-
const { key:
|
|
116
|
-
|
|
117
|
-
|
|
449
|
+
if (g !== null)
|
|
450
|
+
for (const w of g) {
|
|
451
|
+
const { key: u } = z.getQuantityValue(
|
|
452
|
+
o,
|
|
453
|
+
w
|
|
118
454
|
);
|
|
119
|
-
if (
|
|
455
|
+
if (u === null)
|
|
120
456
|
continue;
|
|
121
|
-
const
|
|
122
|
-
|
|
457
|
+
const f = this.getProperty(w);
|
|
458
|
+
f !== null && s.push({
|
|
123
459
|
parentName: r,
|
|
124
|
-
...
|
|
460
|
+
...f
|
|
125
461
|
});
|
|
126
462
|
}
|
|
127
463
|
}
|
|
128
464
|
}
|
|
129
465
|
}
|
|
130
|
-
return
|
|
466
|
+
return s;
|
|
131
467
|
}
|
|
132
468
|
getProperty(t) {
|
|
133
|
-
const
|
|
134
|
-
if (
|
|
469
|
+
const s = this._model.properties;
|
|
470
|
+
if (s === void 0)
|
|
135
471
|
return null;
|
|
136
|
-
const { name:
|
|
137
|
-
if (
|
|
472
|
+
const { name: o } = z.getEntityName(s, t);
|
|
473
|
+
if (o === null)
|
|
138
474
|
return null;
|
|
139
|
-
const { value:
|
|
140
|
-
return { name:
|
|
141
|
-
}
|
|
142
|
-
highlight(t,
|
|
143
|
-
this._ifcSelection[t][
|
|
144
|
-
const
|
|
145
|
-
this._ifcSelection[t][
|
|
146
|
-
const n =
|
|
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;
|
|
147
483
|
if (n) {
|
|
148
|
-
const r = n.data[
|
|
149
|
-
for (let
|
|
150
|
-
const
|
|
151
|
-
|
|
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);
|
|
152
488
|
}
|
|
153
489
|
}
|
|
154
490
|
this.notifyChange(this);
|
|
155
491
|
}
|
|
156
|
-
highlightById(t,
|
|
157
|
-
for (const
|
|
158
|
-
|
|
159
|
-
const
|
|
160
|
-
for (const r of t[
|
|
161
|
-
this._ifcSelection[
|
|
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));
|
|
162
498
|
for (const r of n)
|
|
163
|
-
this.addComposites(
|
|
164
|
-
this.regenerate(
|
|
499
|
+
this.addComposites(s, i.mesh, r);
|
|
500
|
+
this.regenerate(s, o);
|
|
165
501
|
}
|
|
166
502
|
this.notifyChange(this);
|
|
167
503
|
}
|
|
168
|
-
pick(t,
|
|
169
|
-
return super.pick(t,
|
|
170
|
-
...
|
|
504
|
+
pick(t, s) {
|
|
505
|
+
return super.pick(t, s).map((o) => ({
|
|
506
|
+
...o,
|
|
171
507
|
entity: this,
|
|
172
|
-
features:
|
|
508
|
+
features: o.features,
|
|
173
509
|
isIFCPickResult: !0,
|
|
174
|
-
object:
|
|
510
|
+
object: o.object
|
|
175
511
|
}));
|
|
176
512
|
}
|
|
177
513
|
pickFeaturesFrom(t) {
|
|
178
|
-
var
|
|
179
|
-
const
|
|
180
|
-
if (
|
|
181
|
-
const r =
|
|
182
|
-
if (
|
|
183
|
-
const
|
|
184
|
-
return t.features =
|
|
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;
|
|
185
521
|
}
|
|
186
522
|
}
|
|
187
523
|
return [];
|
|
@@ -194,413 +530,710 @@ const x = new wt(), Lt = {
|
|
|
194
530
|
]), this._classificationCache.length === 0 && (this._classificationCache = await this.regenerateClassification([
|
|
195
531
|
"entities"
|
|
196
532
|
/* ENTITY */
|
|
197
|
-
])), this._fragmentBoundingBox = await this._components.tools.get(
|
|
533
|
+
])), this._fragmentBoundingBox = await this._components.tools.get(Xt);
|
|
198
534
|
}
|
|
199
535
|
async preprocess() {
|
|
200
|
-
const t = await
|
|
201
|
-
this._fragmentManager = await this._components.tools.get(
|
|
202
|
-
const
|
|
203
|
-
|
|
204
|
-
const
|
|
205
|
-
this._model = await
|
|
206
|
-
const
|
|
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();
|
|
207
543
|
if (this._source.at)
|
|
208
|
-
this._source.at.toVector3(
|
|
544
|
+
this._source.at.toVector3(i), this._model.position.copy(i);
|
|
209
545
|
else {
|
|
210
546
|
const r = this._model.coordinationMatrix.clone().invert();
|
|
211
|
-
|
|
547
|
+
i.applyMatrix4(r), this._model.position.set(i.x, -i.z, i.y);
|
|
212
548
|
}
|
|
213
549
|
this._model.updateWorldMatrix(!0, !0), this._model.updateMatrix(), this._model.updateMatrixWorld(!0), this.initializeEntityIndexes(), this._fragmentClassifier.byStorey(this._model), this._fragmentClassifier.byEntity(this._model), await this.initClassification(), this.object3d.add(this._model), this.onObjectCreated(this._model);
|
|
214
|
-
const n =
|
|
215
|
-
|
|
550
|
+
const n = R.getContext(this._source.url);
|
|
551
|
+
K(this, { filename: n.filename }), this.notifyChange(this.object3d);
|
|
216
552
|
}
|
|
217
|
-
addComposites(t,
|
|
218
|
-
this.addHighlightToFragment(t,
|
|
219
|
-
const
|
|
220
|
-
if (
|
|
221
|
-
for (let n = 1; n <
|
|
222
|
-
const r =
|
|
223
|
-
this._ifcSelection[t][
|
|
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);
|
|
224
560
|
}
|
|
225
561
|
}
|
|
226
|
-
addHighlightToFragment(t,
|
|
227
|
-
if (!(t in
|
|
228
|
-
const
|
|
229
|
-
|
|
230
|
-
ids: Array.from(
|
|
231
|
-
transform:
|
|
232
|
-
}),
|
|
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);
|
|
233
569
|
}
|
|
234
570
|
}
|
|
235
571
|
initializeEntityIndexes() {
|
|
236
572
|
this._indexMap = {};
|
|
237
573
|
const t = this._model.properties;
|
|
238
574
|
if (t !== void 0)
|
|
239
|
-
for (const
|
|
240
|
-
|
|
241
|
-
const n = t[
|
|
242
|
-
|
|
243
|
-
for (const r of
|
|
244
|
-
this.setEntityIndex(r).add(
|
|
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);
|
|
245
581
|
});
|
|
246
582
|
}
|
|
247
|
-
regenerate(t,
|
|
248
|
-
this.updateFragmentFill(t,
|
|
583
|
+
regenerate(t, s) {
|
|
584
|
+
this.updateFragmentFill(t, s);
|
|
249
585
|
}
|
|
250
|
-
async regenerateClassification(t,
|
|
251
|
-
const
|
|
586
|
+
async regenerateClassification(t, s = {}) {
|
|
587
|
+
const o = this._fragmentClassifier.get(), i = [], n = t[0], r = o[n];
|
|
252
588
|
if (n == null || r == null)
|
|
253
|
-
return
|
|
254
|
-
for (const
|
|
255
|
-
const
|
|
256
|
-
if (Object.keys(
|
|
257
|
-
const
|
|
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(
|
|
258
594
|
t.slice(1),
|
|
259
|
-
|
|
595
|
+
w
|
|
260
596
|
);
|
|
261
|
-
|
|
597
|
+
i.push({ children: I, fragments: u, name: g, treeItemName: P });
|
|
262
598
|
}
|
|
263
599
|
}
|
|
264
|
-
return
|
|
600
|
+
return i;
|
|
265
601
|
}
|
|
266
602
|
setEntityIndex(t) {
|
|
267
603
|
return t in this._indexMap || (this._indexMap[t] = /* @__PURE__ */ new Set()), this._indexMap[t];
|
|
268
604
|
}
|
|
269
|
-
updateFragmentFill(t,
|
|
270
|
-
const
|
|
271
|
-
if (
|
|
605
|
+
updateFragmentFill(t, s) {
|
|
606
|
+
const o = this._ifcSelection[t][s], i = this._fragmentManager.list[s];
|
|
607
|
+
if (i == null)
|
|
272
608
|
return;
|
|
273
|
-
const n =
|
|
609
|
+
const n = i.fragments[t];
|
|
274
610
|
if (n == null)
|
|
275
611
|
return;
|
|
276
|
-
const r =
|
|
612
|
+
const r = i.mesh.parent;
|
|
277
613
|
if (r == null)
|
|
278
614
|
return;
|
|
279
615
|
if (r.add(n.mesh), n.blocks.count > 1)
|
|
280
|
-
|
|
281
|
-
ids: Array.from(
|
|
282
|
-
transform:
|
|
283
|
-
}), n.blocks.setVisibility(!0,
|
|
616
|
+
i.getInstance(0, j), n.setInstance(0, {
|
|
617
|
+
ids: Array.from(i.ids),
|
|
618
|
+
transform: j
|
|
619
|
+
}), n.blocks.setVisibility(!0, o, !0);
|
|
284
620
|
else {
|
|
285
|
-
let
|
|
286
|
-
for (const
|
|
287
|
-
n.mesh.count =
|
|
288
|
-
const { instanceID:
|
|
289
|
-
|
|
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++;
|
|
290
626
|
}
|
|
291
627
|
}
|
|
292
628
|
}
|
|
293
629
|
};
|
|
294
|
-
|
|
295
|
-
let
|
|
296
|
-
class
|
|
297
|
-
constructor(
|
|
298
|
-
super(
|
|
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 });
|
|
299
635
|
}
|
|
300
636
|
}
|
|
301
|
-
const
|
|
637
|
+
const Ne = { class: "d-flex" }, Ae = ["title"], Le = ["id"], ze = { class: "list-unstyled border-start" }, Oe = /* @__PURE__ */ q({
|
|
302
638
|
__name: "IfcSubtree",
|
|
303
639
|
props: {
|
|
304
640
|
classificationElement: {},
|
|
305
641
|
ifcEntity: {}
|
|
306
642
|
},
|
|
307
|
-
setup(
|
|
308
|
-
const
|
|
309
|
-
function
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
|
|
316
|
-
|
|
317
|
-
|
|
318
|
-
|
|
319
|
-
}
|
|
320
|
-
|
|
321
|
-
const
|
|
322
|
-
|
|
323
|
-
|
|
324
|
-
|
|
325
|
-
|
|
643
|
+
setup(l) {
|
|
644
|
+
const e = l, t = lt.generateUUID(), s = `#${t}`, o = O(!1), i = Tt(), r = Et().getModule(Ft);
|
|
645
|
+
function g() {
|
|
646
|
+
if (r == null) {
|
|
647
|
+
console.warn("Cannot clip IFC element, ClippingBoxAnalysis module is not present");
|
|
648
|
+
return;
|
|
649
|
+
}
|
|
650
|
+
const f = e.ifcEntity.getBoundingBoxById(e.classificationElement.fragments);
|
|
651
|
+
f && !f.isEmpty() && r.setClippingBox(f);
|
|
652
|
+
}
|
|
653
|
+
function w() {
|
|
654
|
+
o.value = !0, e.ifcEntity.clearHighlight(), e.ifcEntity.highlightById(e.classificationElement.fragments), setTimeout(() => o.value = !1, 2e3);
|
|
655
|
+
}
|
|
656
|
+
function u() {
|
|
657
|
+
const f = e.ifcEntity.getBoundingBoxById(e.classificationElement.fragments);
|
|
658
|
+
f && !f.isEmpty() && i.lookTopDownAt(f);
|
|
659
|
+
}
|
|
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([
|
|
326
666
|
"border rounded px-1 py-0 fw-normal",
|
|
327
|
-
|
|
667
|
+
o.value ? "text-danger border-danger" : "text-secondary border-secondary"
|
|
328
668
|
]),
|
|
329
|
-
title:
|
|
330
|
-
},
|
|
331
|
-
|
|
332
|
-
default:
|
|
333
|
-
|
|
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, {
|
|
334
674
|
title: "Expand group",
|
|
335
675
|
icon: "bi-chevron-down",
|
|
336
676
|
"data-bs-toggle": "collapse",
|
|
337
|
-
"data-bs-target":
|
|
338
|
-
"aria-controls":
|
|
677
|
+
"data-bs-target": s,
|
|
678
|
+
"aria-controls": M(t),
|
|
339
679
|
"aria-expanded": "true"
|
|
340
680
|
}, null, 8, ["aria-controls"])
|
|
341
681
|
]),
|
|
342
682
|
_: 1
|
|
343
|
-
})) :
|
|
344
|
-
|
|
345
|
-
class:
|
|
346
|
-
text:
|
|
347
|
-
title: `Zoom to ${
|
|
348
|
-
onClick:
|
|
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
|
|
349
689
|
}, null, 8, ["class", "text", "title"]),
|
|
350
|
-
|
|
351
|
-
default:
|
|
352
|
-
|
|
690
|
+
A(nt, { class: "ms-1" }, {
|
|
691
|
+
default: at(() => [
|
|
692
|
+
A(X, {
|
|
353
693
|
title: "Highlight",
|
|
354
694
|
icon: "bi-highlighter",
|
|
355
|
-
onClick:
|
|
695
|
+
onClick: w
|
|
356
696
|
}),
|
|
357
|
-
|
|
697
|
+
M(r) != null ? (D(), ot(X, {
|
|
698
|
+
key: 0,
|
|
358
699
|
title: "Clip to",
|
|
359
700
|
icon: "bi-bounding-box",
|
|
360
|
-
onClick:
|
|
361
|
-
})
|
|
701
|
+
onClick: g
|
|
702
|
+
})) : H("", !0)
|
|
362
703
|
]),
|
|
363
704
|
_: 1
|
|
364
705
|
})
|
|
365
706
|
]),
|
|
366
|
-
|
|
707
|
+
f.classificationElement.children.length > 0 ? (D(), N("div", {
|
|
367
708
|
key: 0,
|
|
368
|
-
id:
|
|
709
|
+
id: M(t),
|
|
369
710
|
class: "collapse show"
|
|
370
711
|
}, [
|
|
371
|
-
|
|
372
|
-
(
|
|
373
|
-
|
|
374
|
-
"ifc-entity":
|
|
375
|
-
"classification-element":
|
|
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
|
|
376
717
|
}, null, 8, ["ifc-entity", "classification-element"])
|
|
377
718
|
]))), 128))
|
|
378
719
|
])
|
|
379
|
-
], 8,
|
|
720
|
+
], 8, Le)) : H("", !0)
|
|
380
721
|
]);
|
|
381
722
|
};
|
|
382
723
|
}
|
|
383
|
-
}),
|
|
724
|
+
}), Re = /* @__PURE__ */ dt(Oe, [["__scopeId", "data-v-804ca598"]]), je = { key: 0 }, Ue = /* @__PURE__ */ q({
|
|
384
725
|
__name: "IfcPropertyView",
|
|
385
726
|
props: {
|
|
386
727
|
dataset: {}
|
|
387
728
|
},
|
|
388
|
-
setup(
|
|
389
|
-
const
|
|
390
|
-
function
|
|
391
|
-
const n =
|
|
729
|
+
setup(l) {
|
|
730
|
+
const e = Mt(), t = l, s = kt(t.dataset, "isPreloaded");
|
|
731
|
+
function o() {
|
|
732
|
+
const n = i();
|
|
392
733
|
return n == null ? null : n.getClassification();
|
|
393
734
|
}
|
|
394
|
-
function
|
|
395
|
-
const n =
|
|
735
|
+
function i() {
|
|
736
|
+
const n = e.getEntity(t.dataset);
|
|
396
737
|
return n ?? null;
|
|
397
738
|
}
|
|
398
|
-
return (n, r) =>
|
|
399
|
-
|
|
400
|
-
(
|
|
401
|
-
|
|
402
|
-
"ifc-entity":
|
|
403
|
-
"classification-element":
|
|
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
|
|
404
745
|
}, null, 8, ["ifc-entity", "classification-element"])
|
|
405
746
|
]))), 128))
|
|
406
747
|
])
|
|
407
|
-
])) :
|
|
748
|
+
])) : H("", !0);
|
|
408
749
|
}
|
|
409
|
-
}),
|
|
410
|
-
if (
|
|
411
|
-
const
|
|
412
|
-
if (
|
|
413
|
-
const t =
|
|
414
|
-
return
|
|
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();
|
|
415
756
|
}
|
|
416
757
|
}
|
|
417
758
|
return null;
|
|
418
|
-
},
|
|
419
|
-
name:
|
|
759
|
+
}, $e = (l) => ({
|
|
760
|
+
name: l.filename,
|
|
420
761
|
source: {
|
|
421
|
-
url:
|
|
762
|
+
url: l.file
|
|
422
763
|
},
|
|
423
764
|
type: "ifc",
|
|
424
765
|
visible: !0
|
|
425
|
-
}),
|
|
426
|
-
var
|
|
427
|
-
if (!
|
|
766
|
+
}), Ge = (l, e) => {
|
|
767
|
+
var g, w, u, f, C, P, I, T, a;
|
|
768
|
+
if (!vt(l))
|
|
428
769
|
return;
|
|
429
|
-
const t = (
|
|
770
|
+
const t = (g = l.features) == null ? void 0 : g.at(0);
|
|
430
771
|
if (!t)
|
|
431
772
|
return;
|
|
432
|
-
|
|
433
|
-
const
|
|
434
|
-
|
|
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({
|
|
435
776
|
key: "Site",
|
|
436
|
-
value: ((
|
|
437
|
-
}),
|
|
777
|
+
value: ((f = (u = l.entity.object3d.userData) == null ? void 0 : u.dataset) == null ? void 0 : f.name) ?? n
|
|
778
|
+
}), s.push({
|
|
438
779
|
key: "IFCType",
|
|
439
|
-
value:
|
|
440
|
-
}),
|
|
441
|
-
for (const { name:
|
|
442
|
-
|
|
443
|
-
},
|
|
444
|
-
const
|
|
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({
|
|
445
786
|
...t.source,
|
|
446
|
-
at:
|
|
447
|
-
name:
|
|
787
|
+
at: s,
|
|
788
|
+
name: e.name
|
|
448
789
|
});
|
|
449
|
-
return Promise.resolve(
|
|
790
|
+
return Promise.resolve(o);
|
|
450
791
|
};
|
|
451
|
-
class
|
|
792
|
+
class mn {
|
|
452
793
|
constructor() {
|
|
453
|
-
|
|
794
|
+
m(this, "id", "builtin-ifc-loader");
|
|
795
|
+
m(this, "name", "IFC");
|
|
454
796
|
}
|
|
455
|
-
async initialize(
|
|
456
|
-
|
|
457
|
-
attributeExtractor:
|
|
458
|
-
entityBuilder:
|
|
797
|
+
async initialize(e) {
|
|
798
|
+
e.datasets.registerDatasetType("ifc", {
|
|
799
|
+
attributeExtractor: Ge,
|
|
800
|
+
entityBuilder: He,
|
|
459
801
|
fileExtensions: ["ifc"],
|
|
460
|
-
highlight:
|
|
802
|
+
highlight: Ye,
|
|
461
803
|
icon: "bi-building",
|
|
462
|
-
loader:
|
|
804
|
+
loader: $e,
|
|
463
805
|
name: "IFC",
|
|
464
|
-
propertyView:
|
|
465
|
-
}),
|
|
806
|
+
propertyView: Ve
|
|
807
|
+
}), Yt.registerInspector("IfcEntity", De), await R.fetch("web-ifc.wasm").catch((t) => {
|
|
466
808
|
console.warn("Could not load web-ifc.wasm", t);
|
|
467
809
|
});
|
|
468
810
|
}
|
|
469
811
|
}
|
|
470
|
-
const
|
|
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;
|
|
927
|
+
}
|
|
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 _;
|
|
934
|
+
}
|
|
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
|
+
};
|
|
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;
|
|
1095
|
+
}
|
|
1096
|
+
next() {
|
|
1097
|
+
return this.arr[this.i++];
|
|
1098
|
+
}
|
|
1099
|
+
}
|
|
1100
|
+
const V = class V extends ct {
|
|
471
1101
|
constructor() {
|
|
472
1102
|
super(...arguments);
|
|
473
|
-
|
|
474
|
-
|
|
1103
|
+
m(this, "isPickableFeatures", !0);
|
|
1104
|
+
m(this, "isPlyMesh", !0);
|
|
475
1105
|
}
|
|
476
1106
|
pickFeaturesFrom(t) {
|
|
477
1107
|
if (this.geometry.hasAttribute("color") && t.face) {
|
|
478
|
-
const
|
|
479
|
-
|
|
480
|
-
|
|
481
|
-
|
|
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]
|
|
482
1112
|
) }];
|
|
483
1113
|
return t.features = n, n;
|
|
484
1114
|
}
|
|
485
1115
|
return [];
|
|
486
1116
|
}
|
|
487
1117
|
};
|
|
488
|
-
|
|
489
|
-
let
|
|
490
|
-
class
|
|
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 {
|
|
491
1121
|
constructor(t) {
|
|
492
|
-
super(new
|
|
493
|
-
|
|
494
|
-
|
|
1122
|
+
super(new ut());
|
|
1123
|
+
m(this, "isPlyEntity", !0);
|
|
1124
|
+
m(this, "source");
|
|
495
1125
|
this.source = t;
|
|
496
1126
|
}
|
|
497
1127
|
async preprocess() {
|
|
498
|
-
const t = await
|
|
499
|
-
side:
|
|
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
|
|
500
1130
|
});
|
|
501
|
-
|
|
502
|
-
const r = new
|
|
503
|
-
r.name = "plyModel",
|
|
504
|
-
const
|
|
505
|
-
|
|
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);
|
|
506
1136
|
}
|
|
507
1137
|
}
|
|
508
|
-
const
|
|
509
|
-
const { dataset:
|
|
510
|
-
...
|
|
511
|
-
at:
|
|
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,
|
|
512
1142
|
featureProjection: t.referenceCrs
|
|
513
1143
|
});
|
|
514
|
-
return Promise.resolve(
|
|
515
|
-
},
|
|
516
|
-
var
|
|
517
|
-
if (!
|
|
1144
|
+
return Promise.resolve(i);
|
|
1145
|
+
}, Qe = (l, e) => {
|
|
1146
|
+
var o;
|
|
1147
|
+
if (!W.isPlyPickResult(l))
|
|
518
1148
|
return;
|
|
519
|
-
const t = (
|
|
1149
|
+
const t = (o = l.features) == null ? void 0 : o.at(0);
|
|
520
1150
|
if (!t)
|
|
521
1151
|
return;
|
|
522
|
-
|
|
1152
|
+
e.has("PLY") || e.set("PLY", []), e.get("PLY").push({ key: "Color", value: t.color });
|
|
523
1153
|
};
|
|
524
|
-
class
|
|
1154
|
+
class yn {
|
|
525
1155
|
constructor() {
|
|
526
|
-
|
|
1156
|
+
m(this, "id", "builtin-ply-loader");
|
|
1157
|
+
m(this, "name", "PLY");
|
|
527
1158
|
}
|
|
528
|
-
initialize(
|
|
529
|
-
|
|
530
|
-
attributeExtractor:
|
|
531
|
-
entityBuilder:
|
|
1159
|
+
initialize(e) {
|
|
1160
|
+
e.datasets.registerDatasetType("ply", {
|
|
1161
|
+
attributeExtractor: Qe,
|
|
1162
|
+
entityBuilder: Ze,
|
|
532
1163
|
icon: "bi-file-earmark-binary",
|
|
533
1164
|
name: "PLY"
|
|
534
1165
|
});
|
|
535
1166
|
}
|
|
536
1167
|
}
|
|
537
|
-
const
|
|
538
|
-
const
|
|
539
|
-
source: new
|
|
1168
|
+
const Je = (l) => {
|
|
1169
|
+
const e = l.dataset.config, t = new ne({
|
|
1170
|
+
source: new se({ url: `${e.source.url}/${e.source.filename}` })
|
|
540
1171
|
});
|
|
541
|
-
return
|
|
542
|
-
filename:
|
|
1172
|
+
return K(t, {
|
|
1173
|
+
filename: e.source.url
|
|
543
1174
|
}), Promise.resolve(t);
|
|
544
1175
|
};
|
|
545
|
-
class
|
|
1176
|
+
class bn {
|
|
546
1177
|
constructor() {
|
|
547
|
-
|
|
1178
|
+
m(this, "id", "builtin-potree-loader");
|
|
1179
|
+
m(this, "name", "Potree");
|
|
548
1180
|
}
|
|
549
|
-
initialize(
|
|
550
|
-
|
|
551
|
-
entityBuilder:
|
|
1181
|
+
initialize(e) {
|
|
1182
|
+
e.datasets.registerDatasetType("potree", {
|
|
1183
|
+
entityBuilder: Je,
|
|
552
1184
|
icon: "fg-multipoint",
|
|
553
1185
|
name: "Potree Point Cloud"
|
|
554
1186
|
});
|
|
555
1187
|
}
|
|
556
1188
|
}
|
|
557
|
-
class
|
|
1189
|
+
class _n {
|
|
558
1190
|
constructor() {
|
|
559
|
-
|
|
560
|
-
|
|
561
|
-
|
|
562
|
-
|
|
563
|
-
|
|
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);
|
|
564
1197
|
}
|
|
565
|
-
initialize(
|
|
566
|
-
this._context =
|
|
1198
|
+
initialize(e) {
|
|
1199
|
+
this._context = e, e.events.addEventListener("ready", this.start.bind(this));
|
|
567
1200
|
}
|
|
568
1201
|
buildTours() {
|
|
569
|
-
const
|
|
1202
|
+
const e = this._camera, t = new F.Tour({
|
|
570
1203
|
tourName: "main",
|
|
571
1204
|
useModalOverlay: !0
|
|
572
|
-
}),
|
|
1205
|
+
}), s = new F.Tour({
|
|
573
1206
|
tourName: "navigating",
|
|
574
1207
|
useModalOverlay: !0
|
|
575
|
-
}),
|
|
1208
|
+
}), o = new F.Tour({
|
|
576
1209
|
tourName: "analyzing",
|
|
577
1210
|
useModalOverlay: !0
|
|
578
|
-
}),
|
|
1211
|
+
}), i = [
|
|
579
1212
|
{ action: () => {
|
|
580
|
-
var
|
|
581
|
-
return (
|
|
1213
|
+
var u;
|
|
1214
|
+
return (u = F.activeTour) == null ? void 0 : u.next();
|
|
582
1215
|
}, text: "Next" },
|
|
583
1216
|
{ action: () => {
|
|
584
|
-
var
|
|
585
|
-
return (
|
|
1217
|
+
var u;
|
|
1218
|
+
return (u = F.activeTour) == null ? void 0 : u.cancel();
|
|
586
1219
|
}, secondary: !0, text: "Exit" }
|
|
587
1220
|
], n = () => {
|
|
588
|
-
var
|
|
589
|
-
const
|
|
590
|
-
if (
|
|
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)
|
|
591
1224
|
return;
|
|
592
|
-
const p = document.createElement("div");
|
|
593
|
-
p.className = "progress mt-3", p.setAttribute("role", "progressbar"), p.style.height = "2px";
|
|
594
1225
|
const I = document.createElement("div");
|
|
595
|
-
I.className = "progress
|
|
596
|
-
|
|
597
|
-
|
|
598
|
-
|
|
599
|
-
|
|
600
|
-
|
|
601
|
-
|
|
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)));
|
|
602
1235
|
});
|
|
603
|
-
|
|
1236
|
+
I.observe(document.body, {
|
|
604
1237
|
childList: !0,
|
|
605
1238
|
subtree: !0
|
|
606
1239
|
});
|
|
@@ -609,22 +1242,22 @@ class Ie {
|
|
|
609
1242
|
buttons: [
|
|
610
1243
|
{
|
|
611
1244
|
action: () => {
|
|
612
|
-
var
|
|
613
|
-
(
|
|
1245
|
+
var u;
|
|
1246
|
+
(u = F.activeTour) == null || u.complete(), s.show(0);
|
|
614
1247
|
},
|
|
615
1248
|
text: "Navigating"
|
|
616
1249
|
},
|
|
617
1250
|
{
|
|
618
1251
|
action: () => {
|
|
619
|
-
var
|
|
620
|
-
(
|
|
1252
|
+
var u;
|
|
1253
|
+
(u = F.activeTour) == null || u.complete(), o.show(0);
|
|
621
1254
|
},
|
|
622
1255
|
text: "Analyzing data"
|
|
623
1256
|
},
|
|
624
1257
|
{
|
|
625
1258
|
action: () => {
|
|
626
|
-
var
|
|
627
|
-
return (
|
|
1259
|
+
var u;
|
|
1260
|
+
return (u = F.activeTour) == null ? void 0 : u.cancel();
|
|
628
1261
|
},
|
|
629
1262
|
secondary: !0,
|
|
630
1263
|
text: "Exit"
|
|
@@ -637,109 +1270,109 @@ class Ie {
|
|
|
637
1270
|
when: {
|
|
638
1271
|
show: n
|
|
639
1272
|
}
|
|
640
|
-
}),
|
|
1273
|
+
}), s.addStep({
|
|
641
1274
|
attachTo: {
|
|
642
1275
|
element: "#main-view",
|
|
643
1276
|
on: "bottom"
|
|
644
1277
|
},
|
|
645
|
-
buttons:
|
|
1278
|
+
buttons: i,
|
|
646
1279
|
id: "view",
|
|
647
1280
|
text: "<p>This is the <b>main view</b>.</p><p>Giro3D natively supports a broad range of data sources, from 2D raster and vector data, to 3D point clouds and tilesets.</p><p>Piero adds support for CityJSON and IFC files.</p>",
|
|
648
1281
|
when: {
|
|
649
1282
|
show: n
|
|
650
1283
|
}
|
|
651
|
-
}),
|
|
1284
|
+
}), s.addStep({
|
|
652
1285
|
attachTo: {
|
|
653
1286
|
element: "#main-view",
|
|
654
1287
|
on: "bottom"
|
|
655
1288
|
},
|
|
656
|
-
buttons:
|
|
1289
|
+
buttons: i,
|
|
657
1290
|
id: "navigate",
|
|
658
1291
|
text: '<p>This application integrates <a href="https://github.com/yomotsu/camera-controls">camera-controls</a>, a camera control for three.js.</p><p><b>Click</b> to move the camera. <b>Right-click</b> to rotate around a point. <b>Scroll</b> to zoom in or out.</p>',
|
|
659
1292
|
when: {
|
|
660
1293
|
hide: () => {
|
|
661
|
-
this._cameraCallback &&
|
|
1294
|
+
this._cameraCallback && e.removeEventListener("interaction-end", this._cameraCallback), this._cameraCallback = null;
|
|
662
1295
|
},
|
|
663
1296
|
show: () => {
|
|
664
|
-
let
|
|
1297
|
+
let u = 0;
|
|
665
1298
|
this._cameraCallback = () => {
|
|
666
|
-
var
|
|
667
|
-
|
|
668
|
-
},
|
|
1299
|
+
var f;
|
|
1300
|
+
u += 1, u > 2 && ((f = F.activeTour) == null || f.next());
|
|
1301
|
+
}, e.addEventListener("interaction-end", this._cameraCallback), n();
|
|
669
1302
|
}
|
|
670
1303
|
}
|
|
671
|
-
}),
|
|
1304
|
+
}), s.addStep({
|
|
672
1305
|
attachTo: {
|
|
673
1306
|
element: "#toolbar",
|
|
674
1307
|
on: "right"
|
|
675
1308
|
},
|
|
676
1309
|
beforeShowPromise: () => r("toolbar-datasets", "#datasets-drop-zone"),
|
|
677
|
-
buttons:
|
|
1310
|
+
buttons: i,
|
|
678
1311
|
id: "toolbar-layers",
|
|
679
1312
|
text: "<p>Giro3D supports multiple datasets.</p><p>You can toggle datasets as you wish with the <b>Datasets</b> panel.</p>",
|
|
680
1313
|
when: {
|
|
681
1314
|
show: n
|
|
682
1315
|
}
|
|
683
|
-
}),
|
|
1316
|
+
}), s.addStep({
|
|
684
1317
|
attachTo: {
|
|
685
1318
|
element: "#basemap-list",
|
|
686
1319
|
on: "right"
|
|
687
1320
|
},
|
|
688
1321
|
beforeShowPromise: () => r("toolbar-datasets", "#datasets-drop-zone"),
|
|
689
|
-
buttons:
|
|
1322
|
+
buttons: i,
|
|
690
1323
|
id: "basemaps",
|
|
691
1324
|
text: "<p><b>Basemaps</b> are color and elevation layers that make the basic shape and aspect of the <b>Map</b>.</p>",
|
|
692
1325
|
when: {
|
|
693
1326
|
show: n
|
|
694
1327
|
}
|
|
695
|
-
}),
|
|
1328
|
+
}), s.addStep({
|
|
696
1329
|
attachTo: {
|
|
697
1330
|
element: "#overlay-list",
|
|
698
1331
|
on: "right"
|
|
699
1332
|
},
|
|
700
1333
|
beforeShowPromise: () => r("toolbar-datasets", "#datasets-drop-zone"),
|
|
701
|
-
buttons:
|
|
1334
|
+
buttons: i,
|
|
702
1335
|
id: "overlays",
|
|
703
1336
|
text: "<p><b>Overlays</b> are vector layers in various formats (WFS, GML, GeoJSON...).</p>",
|
|
704
1337
|
when: {
|
|
705
1338
|
show: n
|
|
706
1339
|
}
|
|
707
|
-
}),
|
|
1340
|
+
}), s.addStep({
|
|
708
1341
|
attachTo: {
|
|
709
1342
|
element: "#dataset-list",
|
|
710
1343
|
on: "right"
|
|
711
1344
|
},
|
|
712
1345
|
beforeShowPromise: () => r("toolbar-datasets", "#datasets-drop-zone"),
|
|
713
|
-
buttons:
|
|
1346
|
+
buttons: i,
|
|
714
1347
|
id: "layers",
|
|
715
1348
|
text: "<p>The <b>Datasets</b> panel contains all 3D objects in the scene.</><p>You can toggle their visibility and delete them.<p><p>Most objects leverage Giro3D's adaptive resolution to optimize their display.</p>",
|
|
716
1349
|
when: {
|
|
717
1350
|
show: n
|
|
718
1351
|
}
|
|
719
|
-
}),
|
|
1352
|
+
}), s.addStep({
|
|
720
1353
|
attachTo: {
|
|
721
1354
|
element: "#datasets-drop-zone",
|
|
722
1355
|
on: "right"
|
|
723
1356
|
},
|
|
724
1357
|
beforeShowPromise: () => r("toolbar-datasets", "#datasets-drop-zone"),
|
|
725
|
-
buttons:
|
|
1358
|
+
buttons: i,
|
|
726
1359
|
id: "adddata",
|
|
727
1360
|
text: "<p>You can add your own data from your computer by <b>dragging the file</b> into this page.</p><p>While you won't benefit from Giro3D's tiling mechanism, this can be a great way to quickly visualize datasets up to 100MB.</p><p>This application supports CityJSONs, IFCs, LAS/LAZs, CSV pointclouds, and simple GeoJSON features.</p>",
|
|
728
1361
|
when: {
|
|
729
1362
|
show: n
|
|
730
1363
|
}
|
|
731
|
-
}),
|
|
1364
|
+
}), s.addStep({
|
|
732
1365
|
attachTo: {
|
|
733
1366
|
element: "#main-view",
|
|
734
1367
|
on: "bottom"
|
|
735
1368
|
},
|
|
736
|
-
buttons:
|
|
1369
|
+
buttons: i,
|
|
737
1370
|
id: "attributes",
|
|
738
1371
|
text: "<p>By clicking on any feature on the map, you can see its <strong>Attribute table</strong>. Clickable features display a cursor when hovered.</p>",
|
|
739
1372
|
when: {
|
|
740
1373
|
show: n
|
|
741
1374
|
}
|
|
742
|
-
}),
|
|
1375
|
+
}), s.addStep({
|
|
743
1376
|
attachTo: {
|
|
744
1377
|
element: "#search-place-autocomplete",
|
|
745
1378
|
on: "bottom"
|
|
@@ -747,15 +1380,15 @@ class Ie {
|
|
|
747
1380
|
buttons: [
|
|
748
1381
|
{
|
|
749
1382
|
action: () => {
|
|
750
|
-
var
|
|
751
|
-
(
|
|
1383
|
+
var u;
|
|
1384
|
+
(u = F.activeTour) == null || u.complete(), o.show(0);
|
|
752
1385
|
},
|
|
753
1386
|
text: "Analyzing data"
|
|
754
1387
|
},
|
|
755
1388
|
{
|
|
756
1389
|
action: () => {
|
|
757
|
-
var
|
|
758
|
-
return (
|
|
1390
|
+
var u;
|
|
1391
|
+
return (u = F.activeTour) == null ? void 0 : u.complete();
|
|
759
1392
|
},
|
|
760
1393
|
secondary: !0,
|
|
761
1394
|
text: "Exit"
|
|
@@ -766,51 +1399,51 @@ class Ie {
|
|
|
766
1399
|
when: {
|
|
767
1400
|
show: n
|
|
768
1401
|
}
|
|
769
|
-
}),
|
|
1402
|
+
}), o.addStep({
|
|
770
1403
|
attachTo: {
|
|
771
1404
|
element: "#annotations-fieldset",
|
|
772
1405
|
on: "right"
|
|
773
1406
|
},
|
|
774
1407
|
beforeShowPromise: () => r("toolbar-annotations", "#annotations-fieldset"),
|
|
775
|
-
buttons:
|
|
1408
|
+
buttons: i,
|
|
776
1409
|
id: "annotation",
|
|
777
1410
|
text: "<p>You can <strong>annotate</strong> any data displayed using Giro3D native tools.<br>Select the <strong>geometry</strong> of your annotation, and <strong>click</strong> on the scene to add points. <strong>Right-click</strong> to end the shape.</p>",
|
|
778
1411
|
when: {
|
|
779
1412
|
show: n
|
|
780
1413
|
}
|
|
781
|
-
}),
|
|
1414
|
+
}), o.addStep({
|
|
782
1415
|
attachTo: {
|
|
783
1416
|
element: "#annotations-fieldset",
|
|
784
1417
|
on: "right"
|
|
785
1418
|
},
|
|
786
1419
|
beforeShowPromise: () => r("toolbar-annotations", "#annotations-fieldset"),
|
|
787
|
-
buttons:
|
|
1420
|
+
buttons: i,
|
|
788
1421
|
id: "annotations",
|
|
789
1422
|
text: "You can download your annotations as GeoJSON files. You can also upload your own by dragging them into this panel.",
|
|
790
1423
|
when: {
|
|
791
1424
|
show: n
|
|
792
1425
|
}
|
|
793
|
-
}),
|
|
1426
|
+
}), Ot("measurements") && o.addStep({
|
|
794
1427
|
attachTo: {
|
|
795
1428
|
element: "#panel-container",
|
|
796
1429
|
on: "right"
|
|
797
1430
|
},
|
|
798
1431
|
beforeShowPromise: () => r("toolbar-measures", "#measures-fieldset"),
|
|
799
|
-
buttons:
|
|
1432
|
+
buttons: i,
|
|
800
1433
|
id: "measurements",
|
|
801
1434
|
text: "You can add <strong>measurements</strong> to easily get distances betwween objects.<br>Once started, moving the mouse will display the measure. <strong>Click</strong> to save the measurement. <strong>Right-click</strong> to end.",
|
|
802
1435
|
when: {
|
|
803
1436
|
show: n
|
|
804
1437
|
}
|
|
805
|
-
}),
|
|
1438
|
+
}), o.addStep({
|
|
806
1439
|
attachTo: {
|
|
807
1440
|
element: "#panel-container",
|
|
808
1441
|
on: "right"
|
|
809
1442
|
},
|
|
810
1443
|
beforeShowPromise: () => r("toolbar-analysis", "#panel-container .card"),
|
|
811
1444
|
buttons: [{ action: () => {
|
|
812
|
-
var
|
|
813
|
-
return (
|
|
1445
|
+
var u;
|
|
1446
|
+
return (u = F.activeTour) == null ? void 0 : u.complete();
|
|
814
1447
|
}, text: "Done!" }],
|
|
815
1448
|
id: "analysis",
|
|
816
1449
|
text: "In the <strong>Analysis</strong> panel you'll find some advanced analysis tools.",
|
|
@@ -818,39 +1451,43 @@ class Ie {
|
|
|
818
1451
|
show: n
|
|
819
1452
|
}
|
|
820
1453
|
});
|
|
821
|
-
const
|
|
822
|
-
const i = new URL(document.URL);
|
|
823
|
-
i.searchParams.delete("tourStep"), i.searchParams.set("tour", "none"), window.history.replaceState({}, "", i.toString());
|
|
824
|
-
}, h = (i) => {
|
|
1454
|
+
const g = () => {
|
|
825
1455
|
const u = new URL(document.URL);
|
|
826
|
-
|
|
827
|
-
|
|
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());
|
|
828
1461
|
};
|
|
829
|
-
return t.on("cancel",
|
|
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 };
|
|
830
1463
|
}
|
|
831
1464
|
getTours() {
|
|
832
1465
|
return this._tours || (this._tours = this.buildTours()), this._tours;
|
|
833
1466
|
}
|
|
834
1467
|
restart() {
|
|
835
|
-
const { mainTour:
|
|
836
|
-
|
|
1468
|
+
const { mainTour: e } = this.getTours();
|
|
1469
|
+
e.show(0);
|
|
837
1470
|
}
|
|
838
1471
|
start() {
|
|
839
1472
|
if (!this._context)
|
|
840
1473
|
throw new Error("module is not initialized");
|
|
841
|
-
const { analyzingTour:
|
|
1474
|
+
const { analyzingTour: e, mainTour: t, navigatingTour: s } = this.getTours();
|
|
842
1475
|
this._camera = this._context.view.getCameraController();
|
|
843
|
-
const
|
|
844
|
-
if (
|
|
845
|
-
const n =
|
|
846
|
-
|
|
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);
|
|
847
1480
|
}
|
|
848
1481
|
}
|
|
849
1482
|
}
|
|
850
1483
|
export {
|
|
851
|
-
|
|
852
|
-
|
|
853
|
-
|
|
854
|
-
|
|
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
|
|
855
1492
|
};
|
|
856
1493
|
//# sourceMappingURL=modules.es.js.map
|