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