(window.webpackJsonpNVIV = window.webpackJsonpNVIV || []).push([[19], { 1671: function(e, t, o) { "use strict"; var n = this && this.__awaiter || function(e, t, o, n) { return new (o || (o = Promise))((function(i, r) { function a(e) { try { c(n.next(e)) } catch (e) { r(e) } } function s(e) { try { c(n.throw(e)) } catch (e) { r(e) } } function c(e) { var t; e.done ? i(e.value) : (t = e.value, t instanceof o ? t : new o((function(e) { e(t) } ))).then(a, s) } c((n = n.apply(e, t || [])).next()) } )) } , i = this && this.__generator || function(e, t) { var o, n, i, r, a = { label: 0, sent: function() { if (1 & i[0]) throw i[1]; return i[1] }, trys: [], ops: [] }; return r = { next: s(0), throw: s(1), return: s(2) }, "function" == typeof Symbol && (r[Symbol.iterator] = function() { return this } ), r; function s(r) { return function(s) { return function(r) { if (o) throw new TypeError("Generator is already executing."); for (; a; ) try { if (o = 1, n && (i = 2 & r[0] ? n.return : r[0] ? n.throw || ((i = n.return) && i.call(n), 0) : n.next) && !(i = i.call(n, r[1])).done) return i; switch (n = 0, i && (r = [2 & r[0], i.value]), r[0]) { case 0: case 1: i = r; break; case 4: return a.label++, { value: r[1], done: !1 }; case 5: a.label++, n = r[1], r = [0]; continue; case 7: r = a.ops.pop(), a.trys.pop(); continue; default: if (!(i = a.trys, (i = i.length > 0 && i[i.length - 1]) || 6 !== r[0] && 2 !== r[0])) { a = 0; continue } if (3 === r[0] && (!i || r[1] > i[0] && r[1] < i[3])) { a.label = r[1]; break } if (6 === r[0] && a.label < i[1]) { a.label = i[1], i = r; break } if (i && a.label < i[2]) { a.label = i[2], a.ops.push(r); break } i[2] && a.ops.pop(), a.trys.pop(); continue } r = t.call(e, a) } catch (e) { r = [6, e], n = 0 } finally { o = i = 0 } if (5 & r[0]) throw r[1]; return { value: r[0] ? r[1] : void 0, done: !0 } }([r, s]) } } } ; Object.defineProperty(t, "__esModule", { value: !0 }); o(1934); var r = o(0) , a = (o(6), o(2)) , s = o(0) , c = o(1934) , u = o(6) , l = o(2041).LegacyPointCloudLayerFactory; a.module("PointCloudModule", ["IVWebApp"]), a.module("PointCloudModule").service("LegacyPointCloudLayerFactory", l); var d = function() { function e(e, t) { this.PointCloudLayerFactory = e; var o = t.$injector; this.legacyPointCloudLayerFactory = o.get("$ocLazyLoad").inject("PointCloudModule").then((function() { return o.get("LegacyPointCloudLayerFactory") } )) } return e.prototype.createLayer = function(e, t) { return this.PointCloudLayerFactory.create(e, t, void 0) } , e.prototype.createLegacyLayer = function(e, t) { return n(this, void 0, void 0, (function() { return i(this, (function(o) { switch (o.label) { case 0: return [4, this.legacyPointCloudLayerFactory]; case 1: return [2, o.sent().create(e, t, void 0)] } } )) } )) } , e.ɵfac = function(t) { return new (t || e)(s.ɵɵinject(c.PointCloudLayerFactory),s.ɵɵinject(u.UpgradeModule)) } , e.ɵprov = s.ɵɵdefineInjectable({ token: e, factory: e.ɵfac, providedIn: "root" }), e }(); t.PointCloudModuleService = d, s.ɵsetClassMetadata(d, [{ type: r.Injectable, args: [{ providedIn: "root" }] }], (function() { return [{ type: c.PointCloudLayerFactory }, { type: u.UpgradeModule }] } ), null); var p = function() { function e() { this.entry = d } return e.ɵmod = s.ɵɵdefineNgModule({ type: e }), e.ɵinj = s.ɵɵdefineInjector({ factory: function(t) { return new (t || e) } }), e }(); t.PointCloudModule = p, s.ɵsetClassMetadata(p, [{ type: r.NgModule }], null, null) }, 1934: function(e, t, o) { "use strict"; var n, i = this && this.__extends || (n = function(e, t) { return (n = Object.setPrototypeOf || { __proto__: [] }instanceof Array && function(e, t) { e.__proto__ = t } || function(e, t) { for (var o in t) t.hasOwnProperty(o) && (e[o] = t[o]) } )(e, t) } , function(e, t) { function o() { this.constructor = e } n(e, t), e.prototype = null === t ? Object.create(t) : (o.prototype = t.prototype, new o) } ); Object.defineProperty(t, "__esModule", { value: !0 }); var r = o(80) , a = (o(24), o(2031)) , s = (o(155), o(15), o(41), o(72), o(106), o(31), o(2)) , c = (o(154), o(6)) , u = o(0) , l = (o(121), o(17), o(629), o(28), o(0)) , d = o(155) , p = o(15) , f = o(24) , h = o(41) , v = o(72) , g = o(106) , y = o(31) , m = o(154) , C = o(121) , S = o(17) , b = o(629) , P = o(28) , _ = function(e) { function t(t, o, n, i, r, a, s, c, u, l, d, p, f, h) { var v = e.call(this) || this; return v.PointCloudMenuService = t, v.DatasetAlignmentService = o, v.ConfigService = n, v.ModeService = i, v.ErrorService = r, v.JWTTokenService = a, v.ProgressReportService = s, v.DatasetRepository = c, v.AlignmentService = u, v.MagnificationService = l, v.ViewService = d, v.SiteModelToDatasetsService = p, v.FloorChangerService = f, v.gettextCatalog = h, v } return i(t, e), t.prototype.create = function(e, t, o) { return new a.PointCloudLayer(e,t,this.PointCloudMenuService,this.AlignmentService,this.gettextCatalog,this.DatasetAlignmentService,this.ModeService,this.ErrorService,this.JWTTokenService,this.DatasetRepository,this.ProgressReportService,this.MagnificationService,this.ViewService,this.SiteModelToDatasetsService,this.FloorChangerService) } , t.ɵfac = function(e) { return new (e || t)(l.ɵɵinject("PointCloudMenuService"),l.ɵɵinject(d.DatasetAlignmentService),l.ɵɵinject(p.ConfigService),l.ɵɵinject(f.ModeService),l.ɵɵinject(h.ErrorService),l.ɵɵinject(v.JWTTokenService),l.ɵɵinject(g.ProgressReportService),l.ɵɵinject(y.DatasetRepository),l.ɵɵinject(m.AlignmentService),l.ɵɵinject(C.MagnificationService),l.ɵɵinject(S.ViewService),l.ɵɵinject(b.SiteModelToDatasetsService),l.ɵɵinject(P.FloorChangerService),l.ɵɵinject("gettextCatalog")) } , t.ɵprov = l.ɵɵdefineInjectable({ token: t, factory: t.ɵfac, providedIn: "root" }), t }(r.SceneLayerFactory); t.PointCloudLayerFactory = _, l.ɵsetClassMetadata(_, [{ type: u.Injectable, args: [{ providedIn: "root" }] }], (function() { return [{ type: void 0, decorators: [{ type: u.Inject, args: ["PointCloudMenuService"] }] }, { type: d.DatasetAlignmentService }, { type: p.ConfigService }, { type: f.ModeService }, { type: h.ErrorService }, { type: v.JWTTokenService }, { type: g.ProgressReportService }, { type: y.DatasetRepository }, { type: m.AlignmentService }, { type: C.MagnificationService }, { type: S.ViewService }, { type: b.SiteModelToDatasetsService }, { type: P.FloorChangerService }, { type: void 0, decorators: [{ type: u.Inject, args: ["gettextCatalog"] }] }] } ), null), s.module("IVWebApp").service("PointCloudLayerFactory", c.downgradeInjectable(_)) }, 2031: function(e, t, o) { "use strict"; var n, i = this && this.__extends || (n = function(e, t) { return (n = Object.setPrototypeOf || { __proto__: [] }instanceof Array && function(e, t) { e.__proto__ = t } || function(e, t) { for (var o in t) t.hasOwnProperty(o) && (e[o] = t[o]) } )(e, t) } , function(e, t) { function o() { this.constructor = e } n(e, t), e.prototype = null === t ? Object.create(t) : (o.prototype = t.prototype, new o) } ); Object.defineProperty(t, "__esModule", { value: !0 }); var r = o(80) , a = o(4) , s = o(2032) , c = o(254) , u = o(7) , l = o(8) , d = o(344) , p = o(2033) , f = o(152) , h = o(2034) , v = o(2035) , g = o(20) , y = o(2036) , m = o(107) , C = o(2037) , S = o(1906) , b = o(16) , P = function(e) { function t(t, o, n, i, r, a, s, c, u, l, d, p, f, h, g) { var m = e.call(this, t, o) || this; return m.pointCloudMenuService = n, m.alignmentService = i, m.gettextCatalog = r, m.datasetAlignmentService = a, m.modeService = s, m.errorService = c, m.jwtTokenService = u, m.datasetRepository = l, m.progressReportService = d, m.magnificationService = p, m.viewService = f, m.siteModelToDatasetsService = h, m.FloorChangerService = g, m.clipMode = S.ClipMode.CLIP_OUTSIDE, m.loadComplete = new b.Signal, m.errorDetector = new y.PointCloudDetector(m.gettextCatalog), m.loadErrorWrapper = m.errorService.newOnceWrapper().report().detector(m.errorDetector).build(), m.updateErrorWrapper = m.errorService.newOnceWrapper().report().detector(m.errorDetector).build(), m.exceededMaxLoadsToGPU = !1, m.numCloudsLoading = 0, m.numNodesLoading = 0, m.atLeastOneFloorHasMaps = !1, m.loadFailed = !1, m.potree = new v.IVPotree, m.sceneGroup.name = "PointCloudLayer", m.edlRenderer = new C.EdlRenderer(m.view.renderer), m.checkIfThereAreMapsOnCurrentFloors(), m.registerEventCallbacks(), m.checkDepthTextureSupport(), m } return i(t, e), t.prototype.onBeforeRender = function() { this.pointCloudMenuService.config.showPointCloud !== this.visible && (this.visible = this.pointCloudMenuService.config.showPointCloud), this.loadErrorWrapper.wrap(this.loadPointClouds()).catch(l.handleWarning), this.progressCurrent = this.progressTotal = 0 } , t.prototype.onBeforeRenderViewport = function(e) { this.visible && (this.managePointCloudVisibilityForViewport(e), this.pointCloudMenuService.config.showPointCloud && this.updatePointClouds(e), this.useEyeDomeLighting(e)) } , t.prototype.checkIfThereAreMapsOnCurrentFloors = function() { var e = this; this.viewService.mainView.atLeastOneFloorHasMaps().then((function(t) { e.atLeastOneFloorHasMaps = t } )).catch(l.handleWarning) } , t.prototype.managePointCloudVisibilityForViewport = function(e) { this.pointCloudMenuService.config.showPanosInPerspective && (this.modeService.isDatasetAlignmentMode() || this.modeService.isSiteModelEditorMode()) ? this.sceneGroup.visible = !(e.getCamera()instanceof a.PerspectiveCamera) : this.modeService.isMeasurementsMode() ? e.getCamera()instanceof a.PerspectiveCamera ? this.showAllPointClouds() : this.showPointCloudsForCurrentFloor() : this.showAllPointClouds() } , t.prototype.showPointCloudsForCurrentFloor = function() { this.atLeastOneFloorHasMaps ? this.sceneGroup.visible = !1 : (t.safeSetPointCloudVisibility(this.getPotreeDatasets(), !1), this.siteModelToDatasetsService.getDatasetsFromCurrentFloors().forEach((function(e) { return t.safeSetPointCloudVisibility([e], !0) } ))) } , t.safeSetPointCloudVisibility = function(e, t) { for (var o, n = 0, i = e; n < i.length; n++) { var r = i[n]; (null === (o = r.pointCloudSceneNode) || void 0 === o ? void 0 : o.pointCloudObject) && (r.pointCloudSceneNode.pointCloudObject.visible = t) } } , t.prototype.showAllPointClouds = function() { this.sceneGroup.visible = !0, t.safeSetPointCloudVisibility(this.getPotreeDatasets(), !0) } , t.prototype.onAfterRender = function(e) { this.exceededMaxLoadsToGPU && (this.view.invalidateScene(), this.exceededMaxLoadsToGPU = !1), this.loadingTask.percentage = this.progressTotal > 0 ? this.progressCurrent / this.progressTotal * 100 : 0, this.visible && 0 === this.numCloudsLoading && 0 === this.numNodesLoading && !this.exceededMaxLoadsToGPU && this.loadComplete.emit(!this.loadFailed), g.invalidateAngular() } , t.prototype.onMouseWheel = function(o, n) { if (!this.pointCloudMenuService.config.showPointCloud && !this.magnificationService.isEnabled || !o.event.altKey) return e.prototype.onMouseWheel.call(this, o, n); var i = this.view.getViewport(o.x, o.y).camera instanceof a.PerspectiveCamera ? this.pointCloudMenuService.config.perspectiveMaterial : this.pointCloudMenuService.config.orthoMaterial , r = i.pointSizeSelectedOption , s = r.maxSize - r.minSize; return i.pointSize -= n * s / t.POINT_SIZE_WHEEL_SCALE, i.pointSize = u.clamp(i.pointSize, r.minSize, r.maxSize), this.pointCloudMenuService.pointCloudChanged.emit(), !0 } , t.prototype.setClipBoxes = function(e) { this.clipBoxes = e, this.updateMaterials(this.getPotreeDatasets(), !0) } , t.prototype.registerEventCallbacks = function() { var e = this; this.trackSignal(this.modeService.modeChanged).connect((function() { e.releaseViewportsCache(), e.updateRaycasting() } )), this.trackSignal(this.pointCloudMenuService.pointCloudChanged).connect((function() { e.updateMaterials(e.getPotreeDatasets()) } )), this.trackSignal(this.datasetRepository.entityChanged).connect((function() { e.updateDatasetsVisibility() } )), this.trackSignal(this.datasetRepository.entityRemoved).connect((function(t) { e.removePointCloud(t) } )), this.trackSignal(this.pointCloudMenuService.configShowPointCloudChanged).connect((function() { e.visible = e.pointCloudMenuService.config.showPointCloud, e.pointCloudMenuService.config.showPointCloud || (e.potree.pointBudget = 0, e.loadingTask.percentage = 0, e.getPotreeDatasets().forEach((function(t) { return e.removePointCloud(t) } ))) } )), this.trackSignal(this.magnificationService.updatePointCloudsForMagnification).connect((function() { e.updatePointClouds(e.magnificationService.magnificationViewport, !0), e.useEyeDomeLighting(e.magnificationService.magnificationViewport) } )), this.trackSignal(this.pointCloudMenuService.pointCloudsClearEvent).connect((function() { e.getPotreeDatasets().filter((function(e) { return e.pointCloudVisible } )).forEach((function(t) { return e.removePointCloud(t) } )), e.view.invalidateScene() } )), this.trackSignal(this.FloorChangerService.onFloorChange).connect((function() { e.checkIfThereAreMapsOnCurrentFloors() } )) } , t.prototype.parseRequestHeaders = function(e) { return e.headers = e.headers || {}, this.jwtTokenService.setJwtHeaderOnConfig(e.headers), e } , t.prototype.updatePointClouds = function(e, t) { var o = this; void 0 === t && (t = !1); var n = e.getCamera() , i = this.getPotreeDatasets().filter((function(e) { return !u.isEmpty(e.pointCloudSceneNode) && e.pointCloudVisible } )) , r = i.map((function(e) { return e.pointCloudSceneNode.pointCloudObject } )).filter((function(e) { return !u.isEmpty(e) } )); t || this.setFarClipping(n), this.setCloudOptions(n, r), this.potree.viewportCount = this.view.viewports.filter((function(e) { return e.active } )).length; var a = this.potree.updatePointClouds(r, n, this.view.renderer); this.exceededMaxLoadsToGPU = this.exceededMaxLoadsToGPU || a.exceededMaxLoadsToGPU, i.forEach((function(t) { return t.pointCloudSceneNode.updateVisibleNodes(e) } )), a.nodeLoadPromises.forEach((function(e) { return m.promiseFinally(e, (function() { o.view.invalidateScene(), o.numNodesLoading-- } )) } )), this.numNodesLoading += a.nodeLoadPromises.length, a.nodeLoadFailed ? (this.updateErrorWrapper.handle(), this.loadFailed = !0) : (this.updateErrorWrapper.reset(), this.loadFailed = !1), this.updateProgress() } , t.prototype.createInteractiveBBContainer = function(e, t) { var o = this , n = new a.Object3D; return n.name = "INTERACTIVE_BOUNDING_BOX_CONTAINER", n.position.copy(e.position), e.root.traverse((function(e) { e.isLeafNode && n.add(o.createInteractiveBB(e.boundingBox, t)) } )), n } , t.prototype.parsePointCloud = function(e, o) { var n = this; if (o.pointCloudSceneNode) { var i = new p.PointCloudObject(e); return i.frustumCulled = !1, i.userData.raycastable = !1, i.maxLevel = this.pointCloudMenuService.config.maxDepth, i.minNodePixelSize = this.pointCloudMenuService.config.minNodePixelSize, i.perspectiveMaterial = new S.PointCloudMaterial, i.orthographicMaterial = new S.PointCloudMaterial, o.pointCloudSceneNode.initialize(i, this.createInteractiveBBContainer(i, o)), this.updatePerspectiveMaterial(i.perspectiveMaterial, o), this.updateOrthographicMaterial(i.orthographicMaterial, o), o.pointCloudSceneNode.updateMatrixWorld(!0), o.pointCloudSceneNode.userData.raycastable = this.modeService.isDatasetAlignmentMode(), i.pcoGeometry.addNodeLoadedCallback((function(e) { var i = e.geometry.attributes.normal; t.isAnyNormalValid(i) ? o.hasNormals = !0 : (o.hasNormals = o.hasNormals || !1, t.makeNormalsInvalid(i)), n.view.invalidateScene() } )), this.sceneGroup.add(o.pointCloudSceneNode), i } } , t.prototype.getPotreeDatasets = function() { return this.datasetRepository.data.filter((function(e) { return e.getPointCloudType() === c.PointCloudType.POTREE } )) } , t.prototype.loadPointClouds = function() { var e = this , o = this.getPotreeDatasets().filter((function(e) { return e.pointCloudVisible && !e.pointCloudSceneNode } )).map((function(o) { var n = o.getPotreeConfigFilename() //, i = ossPrefix+sceneNum+'/' + f.getBaseUrl() + n; , i = ossPrefix + sceneNum + '/' + n o.pointCloudSceneNode = t.createPointCloudSceneNode(o), e.numCloudsLoading++; var r = e.potree.loadPointCloud(i, (function(e) { return e.includes("cloud.js") ? e : i + "/../" + e } ), (function(t, o) { return fetch(t, e.parseRequestHeaders(o)) } )).then((function(t) { return e.parsePointCloud(t, o) } )); return m.promiseFinally(r, (function() { return e.numCloudsLoading-- } )) } )); return Promise.all(o) } , t.prototype.updateDatasetsVisibility = function() { var e = this; this.getPotreeDatasets().filter((function(e) { return !e.pointCloudVisible } )).forEach((function(t) { return e.removePointCloud(t) } )), this.updateMaterials(this.getPotreeDatasets()), this.view.invalidateScene() } , t.prototype.removePointCloud = function(e) { e.pointCloudSceneNode && (e.pointCloudSceneNode.pointCloudObject && this.potree.lru.disposeSubtree(e.pointCloudSceneNode.pointCloudObject.root), this.sceneGroup.remove(e.pointCloudSceneNode), e.pointCloudSceneNode.dispose(), e.pointCloudSceneNode = void 0, this.view.invalidateScene()) } , t.prototype.createInteractiveBB = function(e, t) { return new s.BoundingBoxMesh(e,t,this.view,this.modeService,this.gettextCatalog,this.datasetAlignmentService,this.alignmentService) } , t.prototype.updateProgress = function() { for (var e = 0, t = this.getPotreeDatasets().filter((function(e) { return e.pointCloudVisible && e.pointCloudSceneNode && e.pointCloudSceneNode.pointCloudObject } )).map((function(e) { return e.pointCloudSceneNode.pointCloudObject } )); e < t.length; e++) { var o = t[e]; this.progressCurrent += o.visibleNodes.length, this.progressTotal += o.visibleGeometry.length } } , t.prototype.updateRaycasting = function() { var e = this; this.getPotreeDatasets().filter((function(e) { return !u.isEmpty(e.pointCloudSceneNode) } )).forEach((function(t) { t.pointCloudSceneNode.userData.raycastable = e.modeService.isDatasetAlignmentMode() } )) } , t.prototype.setFarClipping = function(e) { var t = this.pointCloudMenuService.config; e instanceof a.PerspectiveCamera && (e.far = t.maxDist < 300 ? t.maxDist : 1e3, e.updateProjectionMatrix()) } , t.prototype.setCloudOptions = function(e, t) { var o = this.pointCloudMenuService.config; this.potree.pointBudget = o.pointCountTarget * Math.pow(1e3, 2), t.forEach((function(t) { t.material = e instanceof a.PerspectiveCamera ? t.perspectiveMaterial : t.orthographicMaterial, t.minNodePixelSize = o.minNodeSize, t.maxLevel = o.maxDepth } )) } , t.prototype.updateMaterials = function(e, t) { void 0 === t && (t = !1); for (var o = 0, n = e.filter((function(e) { return e.pointCloudSceneNode && e.pointCloudSceneNode.pointCloudObject } )); o < n.length; o++) { var i = n[o] , r = i.pointCloudSceneNode.pointCloudObject; this.updatePerspectiveMaterial(r.perspectiveMaterial, i), this.updateOrthographicMaterial(r.orthographicMaterial, i) } t || this.view.invalidateScene() } , t.prototype.updatePerspectiveMaterial = function(e, o) { var n = this.pointCloudMenuService.config.perspectiveMaterial; e.gradient = S.RAINBOW, e.name = t.PERSPECTIVE_MATERIAL_ID, e.shape = Number(n.pointShapeSelectedOption.id), e.pointColorType = Number(n.colorStyleSelectedOption.id), e.heightMin = Number(n.z[0]), e.heightMax = Number(n.z[1]), e.color = d.ColorUtilities.getColor(o.color), e.pointOpacityType = S.PointOpacityType.ATTENUATED, e.useFilterByNormal = !1, e.opacity = Math.pow(Number(n.opacity), 2), e.useEDL = n.useEDL && this.pointCloudMenuService.config.showPointCloud, e.pointSizeType = n.pointSizeSelectedOption.id, e.opacityAttenuation = t.computeAttenuation(n.brightness); var i = o.pointCloudSceneNode.pointCloudObject.pcoGeometry.spacing , r = Number(n.pointSize) , a = r / i / 23; e.size = e.pointSizeType === S.PointSizeType.ATTENUATED ? a : r, this.edlRenderer.setEdlStrength(Number(n.EDLStrength)), this.assignClipBoxesToPointCloud(e) } , t.prototype.updateOrthographicMaterial = function(e, o) { var n = this.pointCloudMenuService.config.orthoMaterial; e.gradient = S.RAINBOW, e.name = t.ORTHOGRAPHIC_MATERIAL_ID, e.size = Number(n.pointSize), e.pointSizeType = S.PointSizeType.FIXED, e.shape = Number(n.pointShapeSelectedOption.id), e.heightMin = Number(n.z[0]), e.heightMax = Number(n.z[1]), e.transparent = !0, e.color = d.ColorUtilities.getColor(o.color), e.pointColorType = Number(n.colorStyleSelectedOption.id), e.useFilterByNormal = n.normalsFiltering, e.filterByNormalThreshold = .3, e.pointOpacityType = S.PointOpacityType.ATTENUATED, e.opacityAttenuation = t.computeAttenuation(1e3), e.opacity = Math.pow(Number(n.opacity), 2), this.assignClipBoxesToPointCloud(e) } , t.prototype.assignClipBoxesToPointCloud = function(e) { this.clipBoxes && this.clipBoxes.length > 0 ? (e.setClipBoxes(this.clipBoxes), e.clipMode = this.clipMode) : e.setClipBoxes([]) } , Object.defineProperty(t.prototype, "loadingTask", { get: function() { return void 0 === this._loadingTask && (this._loadingTask = this.progressReportService.addTask(this.gettextCatalog.getString("Loading point cloud..."), 1, !1, !1, !0)), this._loadingTask }, enumerable: !0, configurable: !0 }), t.prototype.useEyeDomeLighting = function(e) { var t = this.pointCloudMenuService.config.showPointCloud && this.pointCloudMenuService.config.perspectiveMaterial.useEDL && !(e.getCamera()instanceof a.OrthographicCamera); this.view.twoPassRenderer = t ? this.edlRenderer : void 0 } , t.prototype.releaseViewportsCache = function() { this.getPotreeDatasets().filter((function(e) { return !u.isEmpty(e.pointCloudSceneNode) } )).forEach((function(e) { return e.pointCloudSceneNode.releaseVisibleNodes() } )) } , t.createPointCloudSceneNode = function(e) { var t = new h.PointCloudSceneNode; return t.name = "SCENE_NODE_" + e.name, t.userData.raycastable = !1, t.matrix = e.m2w_, t.matrixAutoUpdate = !1, t.matrixWorldNeedsUpdate = !0, t } , t.computeAttenuation = function(e) { var t = e / 1e3 * 6 - 5; return Math.exp(t) / Math.exp(1) * 1e3 } , t.prototype.checkDepthTextureSupport = function() { this.view.renderer.extensions.get("WEBGL_depth_texture") || this.pointCloudMenuService.settingsPanes.forEach((function(e) { return e.visibleSettings.edlSupport = !1 } )) } , t.isAnyNormalValid = function(e) { if (!e) return !1; for (var t = 0; t < e.count; ++t) if (0 !== e.getX(t) || 0 !== e.getY(t) || -1 !== e.getZ(t) && 0 !== e.getZ(t)) return !0; return !1 } , t.makeNormalsInvalid = function(e) { if (e) for (var t = 0; t < e.count; ++t) e.setXYZ(t, 0, 0, 0) } , t.PERSPECTIVE_MATERIAL_ID = "PERSPECTIVE_MATERIAL", t.ORTHOGRAPHIC_MATERIAL_ID = "ORTHOGRAPHIC_MATERIAL", t.POINT_SIZE_WHEEL_SCALE = 10, t }(r.SceneLayer); t.PointCloudLayer = P }, 2032: function(e, t, o) { "use strict"; var n, i = this && this.__extends || (n = function(e, t) { return (n = Object.setPrototypeOf || { __proto__: [] }instanceof Array && function(e, t) { e.__proto__ = t } || function(e, t) { for (var o in t) t.hasOwnProperty(o) && (e[o] = t[o]) } )(e, t) } , function(e, t) { function o() { this.constructor = e } n(e, t), e.prototype = null === t ? Object.create(t) : (o.prototype = t.prototype, new o) } ); Object.defineProperty(t, "__esModule", { value: !0 }); var r = o(4) , a = o(212) , s = o(20) , c = o(52) , u = o(344) , l = function(e) { function t(t, o, n, i, a, s, c) { var l = e.call(this, new r.BoxGeometry(1,1,1), new r.MeshBasicMaterial({ side: r.DoubleSide, color: u.ColorUtilities.getColor("blue"), wireframe: !0 })) || this; return l.boundingBox = t, l.dataset = o, l.view = n, l.modeService = i, l.getTextCatalog = a, l.datasetAlignmentService = s, l.alignmentService = c, l.visible = !1, l.scale.subVectors(l.boundingBox.max, l.boundingBox.min), l.position.addVectors(l.boundingBox.max, l.boundingBox.min).divideScalar(2), l } return i(t, e), t.prototype.onMouseOver = function(e, t) { ("default" === document.body.style.cursor || "" === document.body.style.cursor) && this.modeService.isDatasetAlignmentMode() && t.getCamera()instanceof r.OrthographicCamera && (document.body.style.cursor = "move") } , t.prototype.onMouseOut = function() { "move" === document.body.style.cursor && (document.body.style.cursor = "default") } , t.prototype.onDragStart = function(e, t) { return this.lastDragPos = t.unprojectScreenCoordinates(e.x, e.y, 1), !!(this.modeService.isDatasetAlignmentMode() && t.getCamera()instanceof r.OrthographicCamera) && (document.body.style.cursor = "move", this.datasetAlignmentService.cacheCurrentState(), !0) } , t.prototype.onDrag = function(e, t) { var o = t.unprojectScreenCoordinates(e.x, e.y, 1) , n = (new r.Vector3).subVectors(o, this.lastDragPos); t.name !== c.SplitViewportName.EAST_WEST_VIEW && t.name !== c.SplitViewportName.NORTH_SOUTH_VIEW || (this.view.inputHandler.isKeyPressed(a.KeyEvent.DOM_VK_SHIFT) ? n.x = n.y = 0 : this.view.inputHandler.isKeyPressed(a.KeyEvent.DOM_VK_A) && (n.z = 0)), this.datasetAlignmentService.translate(n), this.lastDragPos = o, this.view.invalidateScene() } , t.prototype.onDragCancel = function() { this.datasetAlignmentService.undoTranslation(), this.view.invalidateScene() } , t.prototype.onContextMenu = function(e) { var t = this; if (this.modeService.isDatasetAlignmentMode()) return this.dataset.pointCloudVisible ? { name: this.getTextCatalog.getString("Hide {{title}}'s point cloud", { title: this.dataset.title }), icon: "delete", key: "dataset" + this.dataset.id.toString() + "Pointcloud", callback: function() { return t.deselectDataset() } } : void 0 } , t.prototype.deselectDataset = function() { this.alignmentService.deselect(this.dataset), s.invalidateAngular() } , t }(r.Mesh); t.BoundingBoxMesh = l }, 2033: function(e, t, o) { "use strict"; var n, i = this && this.__extends || (n = function(e, t) { return (n = Object.setPrototypeOf || { __proto__: [] }instanceof Array && function(e, t) { e.__proto__ = t } || function(e, t) { for (var o in t) t.hasOwnProperty(o) && (e[o] = t[o]) } )(e, t) } , function(e, t) { function o() { this.constructor = e } n(e, t), e.prototype = null === t ? Object.create(t) : (o.prototype = t.prototype, new o) } ); Object.defineProperty(t, "__esModule", { value: !0 }); var r = o(1906) , a = function(e) { function t(t) { var o = e.call(this, t.potree, t.pcoGeometry, t.material) || this; return o.Potree = r.Potree, o } return i(t, e), t }(r.PointCloudOctree); t.PointCloudObject = a }, 2034: function(e, t, o) { "use strict"; var n, i = this && this.__extends || (n = function(e, t) { return (n = Object.setPrototypeOf || { __proto__: [] }instanceof Array && function(e, t) { e.__proto__ = t } || function(e, t) { for (var o in t) t.hasOwnProperty(o) && (e[o] = t[o]) } )(e, t) } , function(e, t) { function o() { this.constructor = e } n(e, t), e.prototype = null === t ? Object.create(t) : (o.prototype = t.prototype, new o) } ), r = this && this.__spreadArrays || function() { for (var e = 0, t = 0, o = arguments.length; t < o; t++) e += arguments[t].length; var n = Array(e) , i = 0; for (t = 0; t < o; t++) for (var r = arguments[t], a = 0, s = r.length; a < s; a++, i++) n[i] = r[a]; return n } ; Object.defineProperty(t, "__esModule", { value: !0 }); var a = function(e) { function t() { var t = null !== e && e.apply(this, arguments) || this; return t.visibleNodesForViewport = {}, t } return i(t, e), Object.defineProperty(t.prototype, "pointCloudObject", { get: function() { return this.children.length > 0 ? this.children[0] : void 0 }, enumerable: !0, configurable: !0 }), t.prototype.initialize = function(e, t) { this.add(e, t) } , t.prototype.dispose = function() { this.pointCloudObject && (this.releaseVisibleNodes(), this.pointCloudObject.dispose(), this.children = []) } , t.prototype.getVisibleNodes = function(e) { return this.visibleNodesForViewport[e.name] } , t.prototype.updateVisibleNodes = function(e) { var t = this.pointCloudObject && this.pointCloudObject.visibleNodes || []; this.visibleNodesForViewport[e.name] = r(t) } , t.prototype.releaseVisibleNodes = function() { this.visibleNodesForViewport = {} } , t }(o(4).Object3D); t.PointCloudSceneNode = a }, 2035: function(e, t, o) { "use strict"; var n, i = this && this.__extends || (n = function(e, t) { return (n = Object.setPrototypeOf || { __proto__: [] }instanceof Array && function(e, t) { e.__proto__ = t } || function(e, t) { for (var o in t) t.hasOwnProperty(o) && (e[o] = t[o]) } )(e, t) } , function(e, t) { function o() { this.constructor = e } n(e, t), e.prototype = null === t ? Object.create(t) : (o.prototype = t.prototype, new o) } ); Object.defineProperty(t, "__esModule", { value: !0 }); var r = function(e) { function t() { var t = null !== e && e.apply(this, arguments) || this; return t.viewportCount = 1, t._budget = 1e6, t } return i(t, e), Object.defineProperty(t.prototype, "pointBudget", { get: function() { return this._budget / this.viewportCount }, set: function(e) { e !== this._budget && (this._budget = e, this.lru.pointBudget = e, this.lru.freeMemory()) }, enumerable: !0, configurable: !0 }), t }(o(1906).Potree); t.IVPotree = r }, 2036: function(e, t, o) { "use strict"; Object.defineProperty(t, "__esModule", { value: !0 }); var n = function() { function e(e) { this.gettextCatalog = e } return e.prototype.applies = function(e) { return !0 } , e.prototype.report = function() { return this.gettextCatalog.getString("Cannot load point cloud data.") } , e }(); t.PointCloudDetector = n }, 2037: function(e, t, o) { "use strict"; var n, i = this && this.__extends || (n = function(e, t) { return (n = Object.setPrototypeOf || { __proto__: [] }instanceof Array && function(e, t) { e.__proto__ = t } || function(e, t) { for (var o in t) t.hasOwnProperty(o) && (e[o] = t[o]) } )(e, t) } , function(e, t) { function o() { this.constructor = e } n(e, t), e.prototype = null === t ? Object.create(t) : (o.prototype = t.prototype, new o) } ); Object.defineProperty(t, "__esModule", { value: !0 }); var r = o(2038) , a = o(4) , s = function(e) { function t(t) { var o = e.call(this, t) || this; return o.setup(), o } return i(t, e), t.prototype.render = function(e, t) { this.update(t); var o = this.renderer.getRenderTarget(); this.renderer.setRenderTarget(this.target), this.renderer.clear(), this.renderer.render(e, t), this.renderer.setRenderTarget(o), this.renderer.render(this.postScene, this.postCamera) } , t.prototype.setEdlStrength = function(e) { this.postMaterial.uniforms.edlStrength.value = e } , t.prototype.update = function(e) { var t = this.renderer.getPixelRatio() , o = new a.Vector2 , n = this.renderer.getRenderTarget(); n && n instanceof a.WebGLRenderTarget ? (o.x = n.width, o.y = n.height) : this.renderer.getSize(o), this.target.setSize(o.x, o.y), this.postMaterial.uniforms.tWidth.value = o.x * t, e instanceof a.PerspectiveCamera && (this.postMaterial.uniforms.cameraNear.value = e.near, this.postMaterial.uniforms.cameraFar.value = e.far) } , t.prototype.setup = function() { var e = new a.Vector2; this.renderer.getSize(e), this.target.texture.type = a.FloatType, this.target.texture.format = a.RGBAFormat, this.target.texture.minFilter = a.LinearFilter, this.target.texture.magFilter = a.NearestFilter, this.target.texture.generateMipmaps = !1, this.target.stencilBuffer = !1, this.target.depthBuffer = !0, this.target.depthTexture = new a.DepthTexture(e.x,e.y), this.target.depthTexture.type = a.UnsignedIntType; var t = this.renderer.getPixelRatio(); this.postMaterial = new a.ShaderMaterial({ vertexShader: o(2039), fragmentShader: o(2040), uniforms: { tDiffuse: { value: this.target.texture }, tDepth: { value: this.target.depthTexture }, tWidth: { value: e.x * t }, edlStrength: { value: 300 }, cameraNear: { value: .01 }, cameraFar: { value: 100 } } }), this.postScene.add(new a.Mesh(new a.PlaneBufferGeometry(2,2,0),this.postMaterial)) } , t }(r.TwoPassRenderer); t.EdlRenderer = s }, 2038: function(e, t, o) { "use strict"; Object.defineProperty(t, "__esModule", { value: !0 }); var n = o(4) , i = function(e) { var t = new n.Vector2; e.getSize(t), this.renderer = e, this.target = new n.WebGLRenderTarget(t.x,t.y), this.postCamera = new n.OrthographicCamera(-1,1,1,-1,0,1), this.postScene = new n.Scene }; t.TwoPassRenderer = i }, 2039: function(e, t) { e.exports = "varying vec2 vUv;\n\nvoid main() {\n\tvUv = uv;\n\tgl_Position = projectionMatrix * modelViewMatrix * vec4(position, 1.0);\n}" }, 2040: function(e, t) { e.exports = "uniform sampler2D tDiffuse;\nuniform sampler2D tDepth;\n\nuniform float tWidth;\nuniform float edlStrength;\nuniform float cameraNear;\nuniform float cameraFar;\n\nvarying vec2 vUv;\n\n// The projection matrix is used to render the depth map.\n// Return non-linear depth values for a given coordinates.\nfloat readDepth(vec2 coord) {\n\treturn texture2D(tDepth, coord).x;\n}\n\n// Calculate a depth change value of neighbouring pixels.\nfloat sampleShading(int i, float depth) {\n\n\t// A single pixel width in the texture coordinate system\n\tfloat h = 1.0 / tWidth;\n\tfloat response = 0.0;\n\n\t// Gradient in X direction\n\tfloat d_X = depth - readDepth(vec2(vUv.x + float(i) * h, vUv.y));\n\tresponse += depth == 0.0 ? 100.0 : max(0.0, d_X);\n\n\t// Gradient in Y direction\n\tfloat d_Y = depth - readDepth(vec2(vUv.x, vUv.y + float(i) * h));\n\tresponse += depth == 0.0 ? 100.0 : max(0.0, d_Y);\n\n\treturn response;\n}\n\nvoid main() {\n\n\tvec4 color = texture2D(tDiffuse, vUv);\n\tfloat depth = readDepth(vUv);\n\n\tfloat response = 0.0;\n\n\tresponse += sampleShading(-1, depth);\n\tresponse += sampleShading(1, depth);\n\tresponse /= 2.0;\n\n\tfloat shading = exp(-response * 300.0 * edlStrength);\n\n\t// Texture format is RGBAFormat. Ignore alpha channel.\n\t// In the future, opacity can be passed as a uniform.\n\tfloat opacity = 1.0;\n\n\t// Discard pixels for empty areas in the texture to show\n\t// elements which are under it. E.g. panoramas in the point\n\t// cloud mode with EDL enabled.\n\tif (depth >= 1.0){\n\t\tdiscard;\n\t} else {\n\t\tgl_FragColor = vec4(shading * color.rgb, opacity);\n\t}\n}\n" }, 2041: function(e, t, o) { "use strict"; o.r(t), function(e) { o.d(t, "LegacyPointCloudLayerFactory", (function() { return h } )); var n = o(4) , i = o(646) , r = o(7) , a = o(254) , s = o(212) , c = o(639) , u = o(157) , l = o(344) , d = o(52); function p(e, t) { var o; if ("undefined" == typeof Symbol || null == e[Symbol.iterator]) { if (Array.isArray(e) || (o = function(e, t) { if (!e) return; if ("string" == typeof e) return f(e, t); var o = Object.prototype.toString.call(e).slice(8, -1); "Object" === o && e.constructor && (o = e.constructor.name); if ("Map" === o || "Set" === o) return Array.from(e); if ("Arguments" === o || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(o)) return f(e, t) }(e)) || t && e && "number" == typeof e.length) { o && (e = o); var n = 0 , i = function() {}; return { s: i, n: function() { return n >= e.length ? { done: !0 } : { done: !1, value: e[n++] } }, e: function(e) { throw e }, f: i } } throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.") } var r, a = !0, s = !1; return { s: function() { o = e[Symbol.iterator]() }, n: function() { var e = o.next(); return a = e.done, e }, e: function(e) { s = !0, r = e }, f: function() { try { a || null == o.return || o.return() } finally { if (s) throw r } } } } function f(e, t) { (null == t || t > e.length) && (t = e.length); for (var o = 0, n = new Array(t); o < t; o++) n[o] = e[o]; return n } function h(t, f, h, v, g, y, m, C, S, b) { function P(P, _) { var M, w, O, x, D, T = this, N = 1, j = [], E = 0, A = new Worker(e,{ name: "PointCloud", type: void 0 }), L = l.ColorUtilities.COLOR_DEFS[Object.keys(l.ColorUtilities.COLOR_DEFS)[0]].rgb_color, R = function(e) { var t = e / 1e3 * 6 - 5; return Math.exp(t) / Math.exp(1) * 1e3 }; this.onTransitionStart = function() {} ; var V, F, I, B = function(e) { _.traverse((function(t) { "pointCloud" === t.name && e() } )), P.invalidateScene() }; this.changePCFixedSize = function(e) { .1 < N + e && N + e < 10 && (N += e, P.invalidateScene()) } , this.onAfterRender = function() { h.config.showPointCloud && Y(10) } , this.onBeforeRenderViewport = function(e) { h.config.showPointCloud && _.traverse((function(t) { if ("pointCloud" === t.name) { if (e.cameraController instanceof c.FirstPersonCameraController) { var o = 180 * e.getWidth() / Math.PI / e.cameraController.horizontalFOV; t.material.uniforms.angle2pixels.value = o, t.material.uniforms.fixedSize.value = 0 } else t.material.uniforms.fixedSize.value = N; t.userData.dataset.pcColorDefinition_ ? (t.material.uniforms.useRGB.value = !0, t.material.uniforms.RGBColor.value = t.userData.dataset.pcColorDefinition_) : (t.material.uniforms.useRGB.value = !1, t.material.uniforms.RGBColor.value = L) } } )), h.config.showPanosInPerspective && _.traverse((function(t) { "pointCloud" === t.name && (t.visible = !(e.getCamera()instanceof n.PerspectiveCamera)) } )) } , this.onCameraMoveEnd = function() { G() } ; var k, G = function() { var e = Object(r.filter)(y.data, (function(e) { return e.getPointCloudType() === a.PointCloudType.OCTREE } )); I = 0, F = 0, V = Object(r.sumBy)(e, (function(e) { return e.pointCloudVisible ? 1 : 0 } )); var t, o = p(e); try { for (o.s(); !(t = o.n()).done; ) { var n = t.value; z(n) } } catch (e) { o.e(e) } finally { o.f() } }, z = function(e) { var t = e.getPointCloudObject(); if (h.config.showPointCloud) { U(t, e.m2w_); var o = P.getCamera().position; W(o, e), t.pointCloudParticleSystemGroup && t.pointCloudParticleSystemGroup.traverse((function(e) { e.visible = !0 } )), P.invalidateScene() } else q(t) }, W = function e(o, r) { var a = h.config.maxDepth; if (r.pointCloudVisible) { void 0 === k && (k = f.addTask(t.getString("Loading point cloud..."), 1, !1, !1, !0)); var s = r.getPointCloudObject(); if (U(s, r.m2w_), !s.octreeLoaded) return void (s.octreeLoading || (s.octreeLoading = !0, K(r, (function(t) { s.octreeLoading = !1, s.octreeLoaded = !0, e(o, r) } )))); var c = []; for (var u in s.subOctrees) { var l = s.subOctrees[u] , d = new n.Vector3(l.center[0],l.center[1],l.center[2]); d.applyMatrix4(r.m2w_); var p, v = d.sub(o).length(); for (var g in h.config.distance_to_depth) if (v < h.config.distance_to_depth[g][0] || h.config.same_res) { p = h.config.distance_to_depth[g][1]; break } var y = Math.min(p, Math.min(Object(i.getDepth)(l), a)); if ((!l.loading || l.loadingDepth != y) && v < h.config.maxDist) if (s.octreeParticleSystems && s.subOctrees[l.key] && s.octreeParticleSystems[l.key]) { var m = s.octreeParticleSystems[l.key]; m && (m.octreeDepth < y || m.octreeDepth > y && (v > 25 || m.octreeDepth > a)) && c.push({ dataset: r, subOctree: l, loadDepth: y, dist: v }) } else c.push({ dataset: r, subOctree: l, loadDepth: y, dist: v }) } for (var C in c.sort((function(e, t) { return e.dist - t.dist } )), c) { var S = c[C]; S.dist < h.config.maxDist && (J(S.dataset, S.subOctree, S.loadDepth), S.subOctree.loading, S.subOctree.loading = !0, S.subOctree.loadingDepth = S.loadDepth) } 0 == c.length && (I++, V == I && (k.setPercentage(100), k = void 0)) } else q(r.getPointCloudObject()) }, H = function(e, t, i, r) { var a = { size: { type: "f", value: i }, fixedSize: { type: "f", value: 0 }, angle2pixels: { type: "f", value: 10 }, hueOffset: { type: "f", value: h.config.hueOffset }, hueScale: { type: "f", value: h.config.hueScale }, alpha: { type: "f", value: h.config.opacity }, alphaAttenuation: { type: "f", value: R(h.config.brightness) }, useRGB: { type: "i", value: !1 }, RGBColor: { type: "c", value: L } } , s = new n.ShaderMaterial({ uniforms: a, vertexShader: o(2043), fragmentShader: o(2044), transparent: !0, depthWrite: h.config.zBuffering, depthTest: h.config.zBuffering }) , c = new n.Points(t,s); return c.name = "pointCloud", c.frustumCulled = !0, c.userData.raycastable = !1, c.userData.dataset = r, c }, U = function(e, t) { if (!e.pointCloudParticleSystemGroup) { var o = new n.Object3D; o.name = "pointCloudGroup", o.matrix = t, o.matrixAutoUpdate = !1, o.matrixWorldNeedsUpdate = !0, _.add(o), e.pointCloudParticleSystemGroup = o } }, K = function(e, o) { S.authorizedHttpRequest({ url: m.base_url + e.getOctreeConfigFilename() }, !1).then((function(n) { var r; (r = new XMLHttpRequest).open("GET", m.base_url + e.getOctreeDirectory() + n.mergedSubData, !0), C.setJwtHeaderOnXHR(r), r.responseType = "arraybuffer", r.onload = function() { 200 != this.status && console.error("Loading merged subtree data failed: " + this.status + " (" + this.statusText + ")") } , r.send(), (r = new XMLHttpRequest).open("GET", m.base_url + e.getOctreeDataFilename(), !0), C.setJwtHeaderOnXHR(r), r.responseType = "arraybuffer", r.onload = function() { if (200 == this.status) { if (e.getPointCloudObject().pointCloudParticleSystemGroup) { F++, void 0 === k && (k = f.addTask(t.getString("Loading point cloud..."), 1, !1, !1, !0)), k.setPercentage(50 * F / V); var a = m.base_url; a.startsWith("//") && (a = window.location.protocol + a), n.prefix = a + e.getOctreeDirectory(); var s = e.getPointCloudObject(); s.octreeConfigStruct = n; var c = new Uint8Array(r.response) , u = new i.Octree(c,n.imoDepth,n.oct_imo_res,(function(t, o, i, r, a) { o = n.subTrees.shift(), o.center = [.5 * (o.bbX[0] + o.bbX[1]), .5 * (o.bbY[0] + o.bbY[1]), .5 * (o.bbZ[0] + o.bbZ[1])], o.keys = new Int32Array(4), o.keys[0] = i, o.keys[1] = r, o.keys[2] = a, o.keys[3] = Math.log(t.res / o.res) / Math.log(2), s.subOctrees || (s.subOctrees = []), s.subOctrees[o.key] = o, X(e, i, r, a) } )); o && o(u) } } else console.error("Loading octree data failed: " + this.status + " (" + this.statusText + ")") } , r.send() } )).catch((function(e, o, n) { console.log(t.getString("Cannot load Octree point cloud: {{y}} {{z}}", { y: o, z: n })) } )) }, X = function(e, o, i, r) { var a = e.getPointCloudObject().octreeConfigStruct , c = (o + .5) * a.oct_imo_res + a.bbX[0] , u = (i + .5) * a.oct_imo_res + a.bbY[0] , l = (r + .5) * a.oct_imo_res + a.bbZ[0] , p = new n.Mesh(w,O); p.position.set(c, u, l), p.scale.set(a.oct_imo_res, a.oct_imo_res, a.oct_imo_res), p.onMouseOver = function(e, t) { ("default" === document.body.style.cursor || "" === document.body.style.cursor) && g.isDatasetAlignmentMode() && t.getCamera()instanceof n.OrthographicCamera && (document.body.style.cursor = "move") } , p.onMouseOut = function() { "move" === document.body.style.cursor && (document.body.style.cursor = "default") } , p.onDragStart = function(e, t) { if (M = t.unprojectScreenCoordinates(e.x, e.y, 1), g.isDatasetAlignmentMode() && t.getCamera()instanceof n.OrthographicCamera) return v.cacheCurrentState(), !0 } , p.onDrag = function(e, t) { var o = t.unprojectScreenCoordinates(e.x, e.y, 1) , i = (new n.Vector3).subVectors(o, M); t.name !== d.SplitViewportName.EAST_WEST_VIEW && t.name !== d.SplitViewportName.NORTH_SOUTH_VIEW || (P.inputHandler.isKeyPressed(s.KeyEvent.DOM_VK_SHIFT) ? i.x = i.y = 0 : P.inputHandler.isKeyPressed(s.KeyEvent.DOM_VK_A) && (i.z = 0)), v.translate(i), M = o, P.invalidateScene() } , p.onDragCancel = function() { v.undoTranslation(), P.invalidateScene() } , p.onDragEnd = function() {} , p.onContextMenu = function(o) { if (g.isDatasetAlignmentMode()) return { name: t.getString("Hide {{title}}'s point cloud", { title: e.title }), icon: "delete", key: "dataset" + e.id.toString() + "Pointcloud", callback: function(t, o) { b.deselect(e) } } } ; var f = e.getPointCloudObject(); f.pointCloudParticleSystemGroup.add(p) }, J = function(e, t, o) { var n = {}; C.setJwtHeaderOnConfig(n), A.postMessage({ cmd: "load", datasetId: e.id, octreeConfigStruct: e.getPointCloudObject().octreeConfigStruct, sub_octree: t, load_depth: o, headers: n }) }, Z = function(e) { if ("pointcloud" == e.data.cmd) j.push(e.data), P.invalidateScene(); else if ("status" == e.data.cmd) { void 0 !== k && (k.setPercentage(50 + e.data.percent / 2), 100 == e.data.percent && (k = void 0)); var t = Math.round(e.data.percent); if (t > E + 10 || 100 === t) { E = t } } }, Y = function(e) { for (var t = (new Date).getTime(), o = 0; o < j.length && (new Date).getTime() - t < e; o++) { var r = j[o] , a = y.dataMap[r.datasetId] , s = y.dataMap[r.datasetId].getPointCloudObject() , c = null; if (s.subOctrees) if (s.subOctrees[r.sub_octree.key].loading = !1, s.subOctrees[r.sub_octree.key].loadingDepth == r.sub_octree.load_depth) { s.octreeParticleSystems || (s.octreeParticleSystems = []); var u = s.octreeParticleSystems[r.sub_octree.key]; if (u && ($(u), s.pointCloudParticleSystemGroup && s.pointCloudParticleSystemGroup.remove(u)), r.error) console.log("Discarding erroneous point cloud download"); else if (h.config.showPointCloud) { for (var l = new n.Geometry, d = l.vertices, p = r.vertices, f = 3 * r.sub_octree.leaves, v = n.Vector3, g = 0; g < f; ) d.push(new v(p[g],p[g + 1],p[g + 2])), g += 3; (c = H(0, l, r.sub_octree.res * r.sub_octree.res_scale, a)).octreeDepth = r.sub_octree.load_depth, c.octreeMaxDepth = Object(i.getDepth)(r.sub_octree), c.position.set(r.sub_octree.center[0], r.sub_octree.center[1], r.sub_octree.center[2]), s.octreeParticleSystems[r.sub_octree.key] = c, s.pointCloudParticleSystemGroup && s.pointCloudParticleSystemGroup.add(c) } else delete s.octreeParticleSystems[r.sub_octree.key] } else console.log("Discarding worker response " + r.sub_octree.key + " for wrong resolution " + r.sub_octree.load_depth + " (want " + s.subOctrees[r.sub_octree.key].loadingDepth + ")") } j = j.slice(o), o > 0 && P.invalidateScene() }, q = function(e) { if (e) { if (e.pointCloudParticleSystemGroup && (_.remove(e.pointCloudParticleSystemGroup), $(e.pointCloudParticleSystemGroup), delete e.pointCloudParticleSystemGroup), e.octreeParticleSystems) { for (var t in e.octreeParticleSystems) $(e.octreeParticleSystems[t]); delete e.octreeParticleSystems } e.subOctrees = void 0, e.octreeLoaded = !1, e.octreeLoading = !1, e.octreeConfigStruct = void 0, P.invalidateScene() } }, $ = function(e) { e.traverse((function(e) { void 0 !== e.geometry && e.geometry !== w && e.geometry !== x && e.geometry.dispose(), void 0 !== e.material && e.material !== O && e.material !== D && Object(u.disposeMeshMaterial)(e) } )) }; this.onMouseWheel = function(e, t) { if (P.inputHandler.isKeyPressed(s.KeyEvent.DOM_VK_A)) { var o = -t; return T.changePCFixedSize(o), !0 } } , A.addEventListener("message", (function(e) { Z(e) } ), !1), w = new n.CubeGeometry(1,1,1), O = new n.MeshBasicMaterial({ transparent: !0, depthWrite: !1, depthTest: !0, wireframe: !0, visible: !1, side: n.DoubleSide }), x = new n.PlaneGeometry(2 / 3,2 / 3), D = new n.MeshBasicMaterial({ transparent: !0, depthWrite: !1, depthTest: !0, opacity: .5, color: 8388608, visible: !1, side: n.DoubleSide }), y.entityRemoved.connect((function(e) { var t = e.getPointCloudObject(); t && q(t) } )), y.entityCreated.connect((function() { return G() } )), y.entityChanged.connect((function() { return G() } )), v.datasetAlignmentChanged.connect((function() { return P.invalidateScene() } )), h.configShowPointCloudChanged.connect((function() { G(), P.invalidateScene() } )), h.configOpacityChanged.connect((function(e) { B((function(t) { return t.material.uniforms.alpha.value = e } )) } )), h.configZBufferingChanged.connect((function(e) { B((function(t) { return t.material.depthWrite = t.material.depthTest = e } )) } )), h.configBrightnessChanged.connect((function(e) { B((function(t) { return t.material.uniforms.alphaAttenuation.value = R(e) } )) } )), h.configDepthCullingChanged.connect((function(e) { P.getCamera().far = e < 300 ? e : 1e3, G(), P.invalidateScene() } )), h.configPcResolutionChanged.connect((function() { G(), P.invalidateScene() } )), h.configColorHueOffsetChanged.connect((function(e) { B((function(t) { return t.material.uniforms.hueOffset.value = e } )) } )), h.configColorHueScaleChanged.connect((function(e) { B((function(t) { return t.material.uniforms.hueScale.value = e } )) } )), G() } return { create: function(e, t, o) { return new P(e,t,o) } } } h.$inject = ["gettextCatalog", "ProgressReportService", "PointCloudMenuService", "DatasetAlignmentService", "ModeService", "DatasetRepository", "IV", "JWTTokenService", "RestService", "AlignmentService"] } .call(this, o(2042)) }, 2042: function(e, t, o) { e.exports = o.p + "PointCloud.6891a103d9b18f6f5ac7.worker.js" }, 2043: function(e, t) { e.exports = "uniform float size;\nuniform float fixedSize;\nuniform float scale;\nuniform float angle2pixels;\nuniform float alpha;\nuniform float hueOffset, hueScale, alphaAttenuation;\nuniform int useRGB;\nuniform vec3 RGBColor;\n\nvarying vec4 vColor;\n\nvec3 hue2rgb(float hue)\n{\n\tfloat r = abs(hue * 6. - 3.) - 1.;\n\tfloat g = 2. - abs(hue * 6. - 2.);\n\tfloat b = 2. - abs(hue * 6. - 4.);\n\treturn clamp(vec3(r,g,b), 0., 1.);\n}\n\nvoid main()\n{\n\tvec4 position4 = vec4( position, 1.0 );\n\n\t// Compute view coordinates\n\tvec4 mvPosition = modelViewMatrix * position4;\n\n\t// Compute color\n\tfloat o = alpha * exp(- length(mvPosition.xyz) / alphaAttenuation);\n\tif (useRGB == 0)\n\t{\n\t\tvec4 mwPosition = modelMatrix * position4;\n\t\tfloat t = mwPosition.z * hueScale - hueOffset;\n\t\tfloat hue = mod(t, 1.);\n\t\tvColor = vec4(hue2rgb(hue), o);\n\t}\n\telse\n\t{\n\t\tvColor = vec4(RGBColor, o);\n\t}\n\n\t// Compute point size\n\tif (fixedSize <= 0.0)\n\t{\n\t\tgl_PointSize = asin(size / length(mvPosition.xyz)) * angle2pixels;\n\t}\n\telse\n\t{\n\t\tgl_PointSize = fixedSize;\n\t}\n\tgl_Position = projectionMatrix * mvPosition;\n}\n" }, 2044: function(e, t) { e.exports = "varying vec4 vColor;\n\nvoid main()\n{\n\tgl_FragColor = vColor;\n}\n" } }]);