19.77825ef0e44aed4d6923.js 83 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430143114321433143414351436143714381439144014411442144314441445144614471448144914501451145214531454145514561457145814591460146114621463146414651466146714681469147014711472147314741475147614771478147914801481148214831484148514861487148814891490149114921493149414951496149714981499150015011502150315041505150615071508150915101511151215131514151515161517151815191520152115221523152415251526152715281529153015311532153315341535153615371538153915401541154215431544154515461547154815491550155115521553155415551556155715581559156015611562156315641565156615671568156915701571157215731574157515761577157815791580158115821583158415851586158715881589159015911592159315941595159615971598159916001601160216031604160516061607160816091610161116121613161416151616161716181619162016211622162316241625162616271628162916301631163216331634163516361637163816391640164116421643164416451646164716481649165016511652165316541655165616571658165916601661166216631664166516661667166816691670167116721673167416751676167716781679168016811682168316841685168616871688168916901691169216931694169516961697169816991700170117021703170417051706170717081709171017111712171317141715171617171718171917201721172217231724172517261727172817291730173117321733173417351736173717381739174017411742174317441745174617471748174917501751175217531754175517561757175817591760176117621763176417651766176717681769177017711772177317741775177617771778177917801781178217831784178517861787178817891790179117921793179417951796179717981799180018011802180318041805180618071808180918101811181218131814181518161817181818191820182118221823182418251826182718281829183018311832183318341835183618371838183918401841184218431844184518461847184818491850185118521853185418551856185718581859186018611862186318641865186618671868186918701871187218731874187518761877187818791880188118821883188418851886188718881889189018911892189318941895
  1. (window.webpackJsonpNVIV = window.webpackJsonpNVIV || []).push([[19], {
  2. 1671: function(e, t, o) {
  3. "use strict";
  4. var n = this && this.__awaiter || function(e, t, o, n) {
  5. return new (o || (o = Promise))((function(i, r) {
  6. function a(e) {
  7. try {
  8. c(n.next(e))
  9. } catch (e) {
  10. r(e)
  11. }
  12. }
  13. function s(e) {
  14. try {
  15. c(n.throw(e))
  16. } catch (e) {
  17. r(e)
  18. }
  19. }
  20. function c(e) {
  21. var t;
  22. e.done ? i(e.value) : (t = e.value,
  23. t instanceof o ? t : new o((function(e) {
  24. e(t)
  25. }
  26. ))).then(a, s)
  27. }
  28. c((n = n.apply(e, t || [])).next())
  29. }
  30. ))
  31. }
  32. , i = this && this.__generator || function(e, t) {
  33. var o, n, i, r, a = {
  34. label: 0,
  35. sent: function() {
  36. if (1 & i[0])
  37. throw i[1];
  38. return i[1]
  39. },
  40. trys: [],
  41. ops: []
  42. };
  43. return r = {
  44. next: s(0),
  45. throw: s(1),
  46. return: s(2)
  47. },
  48. "function" == typeof Symbol && (r[Symbol.iterator] = function() {
  49. return this
  50. }
  51. ),
  52. r;
  53. function s(r) {
  54. return function(s) {
  55. return function(r) {
  56. if (o)
  57. throw new TypeError("Generator is already executing.");
  58. for (; a; )
  59. try {
  60. if (o = 1,
  61. n && (i = 2 & r[0] ? n.return : r[0] ? n.throw || ((i = n.return) && i.call(n),
  62. 0) : n.next) && !(i = i.call(n, r[1])).done)
  63. return i;
  64. switch (n = 0,
  65. i && (r = [2 & r[0], i.value]),
  66. r[0]) {
  67. case 0:
  68. case 1:
  69. i = r;
  70. break;
  71. case 4:
  72. return a.label++,
  73. {
  74. value: r[1],
  75. done: !1
  76. };
  77. case 5:
  78. a.label++,
  79. n = r[1],
  80. r = [0];
  81. continue;
  82. case 7:
  83. r = a.ops.pop(),
  84. a.trys.pop();
  85. continue;
  86. default:
  87. if (!(i = a.trys,
  88. (i = i.length > 0 && i[i.length - 1]) || 6 !== r[0] && 2 !== r[0])) {
  89. a = 0;
  90. continue
  91. }
  92. if (3 === r[0] && (!i || r[1] > i[0] && r[1] < i[3])) {
  93. a.label = r[1];
  94. break
  95. }
  96. if (6 === r[0] && a.label < i[1]) {
  97. a.label = i[1],
  98. i = r;
  99. break
  100. }
  101. if (i && a.label < i[2]) {
  102. a.label = i[2],
  103. a.ops.push(r);
  104. break
  105. }
  106. i[2] && a.ops.pop(),
  107. a.trys.pop();
  108. continue
  109. }
  110. r = t.call(e, a)
  111. } catch (e) {
  112. r = [6, e],
  113. n = 0
  114. } finally {
  115. o = i = 0
  116. }
  117. if (5 & r[0])
  118. throw r[1];
  119. return {
  120. value: r[0] ? r[1] : void 0,
  121. done: !0
  122. }
  123. }([r, s])
  124. }
  125. }
  126. }
  127. ;
  128. Object.defineProperty(t, "__esModule", {
  129. value: !0
  130. });
  131. o(1934);
  132. var r = o(0)
  133. , a = (o(6),
  134. o(2))
  135. , s = o(0)
  136. , c = o(1934)
  137. , u = o(6)
  138. , l = o(2041).LegacyPointCloudLayerFactory;
  139. a.module("PointCloudModule", ["IVWebApp"]),
  140. a.module("PointCloudModule").service("LegacyPointCloudLayerFactory", l);
  141. var d = function() {
  142. function e(e, t) {
  143. this.PointCloudLayerFactory = e;
  144. var o = t.$injector;
  145. this.legacyPointCloudLayerFactory = o.get("$ocLazyLoad").inject("PointCloudModule").then((function() {
  146. return o.get("LegacyPointCloudLayerFactory")
  147. }
  148. ))
  149. }
  150. return e.prototype.createLayer = function(e, t) {
  151. return this.PointCloudLayerFactory.create(e, t, void 0)
  152. }
  153. ,
  154. e.prototype.createLegacyLayer = function(e, t) {
  155. return n(this, void 0, void 0, (function() {
  156. return i(this, (function(o) {
  157. switch (o.label) {
  158. case 0:
  159. return [4, this.legacyPointCloudLayerFactory];
  160. case 1:
  161. return [2, o.sent().create(e, t, void 0)]
  162. }
  163. }
  164. ))
  165. }
  166. ))
  167. }
  168. ,
  169. e.ɵfac = function(t) {
  170. return new (t || e)(s.ɵɵinject(c.PointCloudLayerFactory),s.ɵɵinject(u.UpgradeModule))
  171. }
  172. ,
  173. e.ɵprov = s.ɵɵdefineInjectable({
  174. token: e,
  175. factory: e.ɵfac,
  176. providedIn: "root"
  177. }),
  178. e
  179. }();
  180. t.PointCloudModuleService = d,
  181. s.ɵsetClassMetadata(d, [{
  182. type: r.Injectable,
  183. args: [{
  184. providedIn: "root"
  185. }]
  186. }], (function() {
  187. return [{
  188. type: c.PointCloudLayerFactory
  189. }, {
  190. type: u.UpgradeModule
  191. }]
  192. }
  193. ), null);
  194. var p = function() {
  195. function e() {
  196. this.entry = d
  197. }
  198. return e.ɵmod = s.ɵɵdefineNgModule({
  199. type: e
  200. }),
  201. e.ɵinj = s.ɵɵdefineInjector({
  202. factory: function(t) {
  203. return new (t || e)
  204. }
  205. }),
  206. e
  207. }();
  208. t.PointCloudModule = p,
  209. s.ɵsetClassMetadata(p, [{
  210. type: r.NgModule
  211. }], null, null)
  212. },
  213. 1934: function(e, t, o) {
  214. "use strict";
  215. var n, i = this && this.__extends || (n = function(e, t) {
  216. return (n = Object.setPrototypeOf || {
  217. __proto__: []
  218. }instanceof Array && function(e, t) {
  219. e.__proto__ = t
  220. }
  221. || function(e, t) {
  222. for (var o in t)
  223. t.hasOwnProperty(o) && (e[o] = t[o])
  224. }
  225. )(e, t)
  226. }
  227. ,
  228. function(e, t) {
  229. function o() {
  230. this.constructor = e
  231. }
  232. n(e, t),
  233. e.prototype = null === t ? Object.create(t) : (o.prototype = t.prototype,
  234. new o)
  235. }
  236. );
  237. Object.defineProperty(t, "__esModule", {
  238. value: !0
  239. });
  240. var r = o(80)
  241. , a = (o(24),
  242. o(2031))
  243. , s = (o(155),
  244. o(15),
  245. o(41),
  246. o(72),
  247. o(106),
  248. o(31),
  249. o(2))
  250. , c = (o(154),
  251. o(6))
  252. , u = o(0)
  253. , l = (o(121),
  254. o(17),
  255. o(629),
  256. o(28),
  257. o(0))
  258. , d = o(155)
  259. , p = o(15)
  260. , f = o(24)
  261. , h = o(41)
  262. , v = o(72)
  263. , g = o(106)
  264. , y = o(31)
  265. , m = o(154)
  266. , C = o(121)
  267. , S = o(17)
  268. , b = o(629)
  269. , P = o(28)
  270. , _ = function(e) {
  271. function t(t, o, n, i, r, a, s, c, u, l, d, p, f, h) {
  272. var v = e.call(this) || this;
  273. return v.PointCloudMenuService = t,
  274. v.DatasetAlignmentService = o,
  275. v.ConfigService = n,
  276. v.ModeService = i,
  277. v.ErrorService = r,
  278. v.JWTTokenService = a,
  279. v.ProgressReportService = s,
  280. v.DatasetRepository = c,
  281. v.AlignmentService = u,
  282. v.MagnificationService = l,
  283. v.ViewService = d,
  284. v.SiteModelToDatasetsService = p,
  285. v.FloorChangerService = f,
  286. v.gettextCatalog = h,
  287. v
  288. }
  289. return i(t, e),
  290. t.prototype.create = function(e, t, o) {
  291. 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)
  292. }
  293. ,
  294. t.ɵfac = function(e) {
  295. 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"))
  296. }
  297. ,
  298. t.ɵprov = l.ɵɵdefineInjectable({
  299. token: t,
  300. factory: t.ɵfac,
  301. providedIn: "root"
  302. }),
  303. t
  304. }(r.SceneLayerFactory);
  305. t.PointCloudLayerFactory = _,
  306. l.ɵsetClassMetadata(_, [{
  307. type: u.Injectable,
  308. args: [{
  309. providedIn: "root"
  310. }]
  311. }], (function() {
  312. return [{
  313. type: void 0,
  314. decorators: [{
  315. type: u.Inject,
  316. args: ["PointCloudMenuService"]
  317. }]
  318. }, {
  319. type: d.DatasetAlignmentService
  320. }, {
  321. type: p.ConfigService
  322. }, {
  323. type: f.ModeService
  324. }, {
  325. type: h.ErrorService
  326. }, {
  327. type: v.JWTTokenService
  328. }, {
  329. type: g.ProgressReportService
  330. }, {
  331. type: y.DatasetRepository
  332. }, {
  333. type: m.AlignmentService
  334. }, {
  335. type: C.MagnificationService
  336. }, {
  337. type: S.ViewService
  338. }, {
  339. type: b.SiteModelToDatasetsService
  340. }, {
  341. type: P.FloorChangerService
  342. }, {
  343. type: void 0,
  344. decorators: [{
  345. type: u.Inject,
  346. args: ["gettextCatalog"]
  347. }]
  348. }]
  349. }
  350. ), null),
  351. s.module("IVWebApp").service("PointCloudLayerFactory", c.downgradeInjectable(_))
  352. },
  353. 2031: function(e, t, o) {
  354. "use strict";
  355. var n, i = this && this.__extends || (n = function(e, t) {
  356. return (n = Object.setPrototypeOf || {
  357. __proto__: []
  358. }instanceof Array && function(e, t) {
  359. e.__proto__ = t
  360. }
  361. || function(e, t) {
  362. for (var o in t)
  363. t.hasOwnProperty(o) && (e[o] = t[o])
  364. }
  365. )(e, t)
  366. }
  367. ,
  368. function(e, t) {
  369. function o() {
  370. this.constructor = e
  371. }
  372. n(e, t),
  373. e.prototype = null === t ? Object.create(t) : (o.prototype = t.prototype,
  374. new o)
  375. }
  376. );
  377. Object.defineProperty(t, "__esModule", {
  378. value: !0
  379. });
  380. var r = o(80)
  381. , a = o(4)
  382. , s = o(2032)
  383. , c = o(254)
  384. , u = o(7)
  385. , l = o(8)
  386. , d = o(344)
  387. , p = o(2033)
  388. , f = o(152)
  389. , h = o(2034)
  390. , v = o(2035)
  391. , g = o(20)
  392. , y = o(2036)
  393. , m = o(107)
  394. , C = o(2037)
  395. , S = o(1906)
  396. , b = o(16)
  397. , P = function(e) {
  398. function t(t, o, n, i, r, a, s, c, u, l, d, p, f, h, g) {
  399. var m = e.call(this, t, o) || this;
  400. return m.pointCloudMenuService = n,
  401. m.alignmentService = i,
  402. m.gettextCatalog = r,
  403. m.datasetAlignmentService = a,
  404. m.modeService = s,
  405. m.errorService = c,
  406. m.jwtTokenService = u,
  407. m.datasetRepository = l,
  408. m.progressReportService = d,
  409. m.magnificationService = p,
  410. m.viewService = f,
  411. m.siteModelToDatasetsService = h,
  412. m.FloorChangerService = g,
  413. m.clipMode = S.ClipMode.CLIP_OUTSIDE,
  414. m.loadComplete = new b.Signal,
  415. m.errorDetector = new y.PointCloudDetector(m.gettextCatalog),
  416. m.loadErrorWrapper = m.errorService.newOnceWrapper().report().detector(m.errorDetector).build(),
  417. m.updateErrorWrapper = m.errorService.newOnceWrapper().report().detector(m.errorDetector).build(),
  418. m.exceededMaxLoadsToGPU = !1,
  419. m.numCloudsLoading = 0,
  420. m.numNodesLoading = 0,
  421. m.atLeastOneFloorHasMaps = !1,
  422. m.loadFailed = !1,
  423. m.potree = new v.IVPotree,
  424. m.sceneGroup.name = "PointCloudLayer",
  425. m.edlRenderer = new C.EdlRenderer(m.view.renderer),
  426. m.checkIfThereAreMapsOnCurrentFloors(),
  427. m.registerEventCallbacks(),
  428. m.checkDepthTextureSupport(),
  429. m
  430. }
  431. return i(t, e),
  432. t.prototype.onBeforeRender = function() {
  433. this.pointCloudMenuService.config.showPointCloud !== this.visible && (this.visible = this.pointCloudMenuService.config.showPointCloud),
  434. this.loadErrorWrapper.wrap(this.loadPointClouds()).catch(l.handleWarning),
  435. this.progressCurrent = this.progressTotal = 0
  436. }
  437. ,
  438. t.prototype.onBeforeRenderViewport = function(e) {
  439. this.visible && (this.managePointCloudVisibilityForViewport(e),
  440. this.pointCloudMenuService.config.showPointCloud && this.updatePointClouds(e),
  441. this.useEyeDomeLighting(e))
  442. }
  443. ,
  444. t.prototype.checkIfThereAreMapsOnCurrentFloors = function() {
  445. var e = this;
  446. this.viewService.mainView.atLeastOneFloorHasMaps().then((function(t) {
  447. e.atLeastOneFloorHasMaps = t
  448. }
  449. )).catch(l.handleWarning)
  450. }
  451. ,
  452. t.prototype.managePointCloudVisibilityForViewport = function(e) {
  453. 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()
  454. }
  455. ,
  456. t.prototype.showPointCloudsForCurrentFloor = function() {
  457. this.atLeastOneFloorHasMaps ? this.sceneGroup.visible = !1 : (t.safeSetPointCloudVisibility(this.getPotreeDatasets(), !1),
  458. this.siteModelToDatasetsService.getDatasetsFromCurrentFloors().forEach((function(e) {
  459. return t.safeSetPointCloudVisibility([e], !0)
  460. }
  461. )))
  462. }
  463. ,
  464. t.safeSetPointCloudVisibility = function(e, t) {
  465. for (var o, n = 0, i = e; n < i.length; n++) {
  466. var r = i[n];
  467. (null === (o = r.pointCloudSceneNode) || void 0 === o ? void 0 : o.pointCloudObject) && (r.pointCloudSceneNode.pointCloudObject.visible = t)
  468. }
  469. }
  470. ,
  471. t.prototype.showAllPointClouds = function() {
  472. this.sceneGroup.visible = !0,
  473. t.safeSetPointCloudVisibility(this.getPotreeDatasets(), !0)
  474. }
  475. ,
  476. t.prototype.onAfterRender = function(e) {
  477. this.exceededMaxLoadsToGPU && (this.view.invalidateScene(),
  478. this.exceededMaxLoadsToGPU = !1),
  479. this.loadingTask.percentage = this.progressTotal > 0 ? this.progressCurrent / this.progressTotal * 100 : 0,
  480. this.visible && 0 === this.numCloudsLoading && 0 === this.numNodesLoading && !this.exceededMaxLoadsToGPU && this.loadComplete.emit(!this.loadFailed),
  481. g.invalidateAngular()
  482. }
  483. ,
  484. t.prototype.onMouseWheel = function(o, n) {
  485. if (!this.pointCloudMenuService.config.showPointCloud && !this.magnificationService.isEnabled || !o.event.altKey)
  486. return e.prototype.onMouseWheel.call(this, o, n);
  487. var i = this.view.getViewport(o.x, o.y).camera instanceof a.PerspectiveCamera ? this.pointCloudMenuService.config.perspectiveMaterial : this.pointCloudMenuService.config.orthoMaterial
  488. , r = i.pointSizeSelectedOption
  489. , s = r.maxSize - r.minSize;
  490. return i.pointSize -= n * s / t.POINT_SIZE_WHEEL_SCALE,
  491. i.pointSize = u.clamp(i.pointSize, r.minSize, r.maxSize),
  492. this.pointCloudMenuService.pointCloudChanged.emit(),
  493. !0
  494. }
  495. ,
  496. t.prototype.setClipBoxes = function(e) {
  497. this.clipBoxes = e,
  498. this.updateMaterials(this.getPotreeDatasets(), !0)
  499. }
  500. ,
  501. t.prototype.registerEventCallbacks = function() {
  502. var e = this;
  503. this.trackSignal(this.modeService.modeChanged).connect((function() {
  504. e.releaseViewportsCache(),
  505. e.updateRaycasting()
  506. }
  507. )),
  508. this.trackSignal(this.pointCloudMenuService.pointCloudChanged).connect((function() {
  509. e.updateMaterials(e.getPotreeDatasets())
  510. }
  511. )),
  512. this.trackSignal(this.datasetRepository.entityChanged).connect((function() {
  513. e.updateDatasetsVisibility()
  514. }
  515. )),
  516. this.trackSignal(this.datasetRepository.entityRemoved).connect((function(t) {
  517. e.removePointCloud(t)
  518. }
  519. )),
  520. this.trackSignal(this.pointCloudMenuService.configShowPointCloudChanged).connect((function() {
  521. e.visible = e.pointCloudMenuService.config.showPointCloud,
  522. e.pointCloudMenuService.config.showPointCloud || (e.potree.pointBudget = 0,
  523. e.loadingTask.percentage = 0,
  524. e.getPotreeDatasets().forEach((function(t) {
  525. return e.removePointCloud(t)
  526. }
  527. )))
  528. }
  529. )),
  530. this.trackSignal(this.magnificationService.updatePointCloudsForMagnification).connect((function() {
  531. e.updatePointClouds(e.magnificationService.magnificationViewport, !0),
  532. e.useEyeDomeLighting(e.magnificationService.magnificationViewport)
  533. }
  534. )),
  535. this.trackSignal(this.pointCloudMenuService.pointCloudsClearEvent).connect((function() {
  536. e.getPotreeDatasets().filter((function(e) {
  537. return e.pointCloudVisible
  538. }
  539. )).forEach((function(t) {
  540. return e.removePointCloud(t)
  541. }
  542. )),
  543. e.view.invalidateScene()
  544. }
  545. )),
  546. this.trackSignal(this.FloorChangerService.onFloorChange).connect((function() {
  547. e.checkIfThereAreMapsOnCurrentFloors()
  548. }
  549. ))
  550. }
  551. ,
  552. t.prototype.parseRequestHeaders = function(e) {
  553. return e.headers = e.headers || {},
  554. this.jwtTokenService.setJwtHeaderOnConfig(e.headers),
  555. e
  556. }
  557. ,
  558. t.prototype.updatePointClouds = function(e, t) {
  559. var o = this;
  560. void 0 === t && (t = !1);
  561. var n = e.getCamera()
  562. , i = this.getPotreeDatasets().filter((function(e) {
  563. return !u.isEmpty(e.pointCloudSceneNode) && e.pointCloudVisible
  564. }
  565. ))
  566. , r = i.map((function(e) {
  567. return e.pointCloudSceneNode.pointCloudObject
  568. }
  569. )).filter((function(e) {
  570. return !u.isEmpty(e)
  571. }
  572. ));
  573. t || this.setFarClipping(n),
  574. this.setCloudOptions(n, r),
  575. this.potree.viewportCount = this.view.viewports.filter((function(e) {
  576. return e.active
  577. }
  578. )).length;
  579. var a = this.potree.updatePointClouds(r, n, this.view.renderer);
  580. this.exceededMaxLoadsToGPU = this.exceededMaxLoadsToGPU || a.exceededMaxLoadsToGPU,
  581. i.forEach((function(t) {
  582. return t.pointCloudSceneNode.updateVisibleNodes(e)
  583. }
  584. )),
  585. a.nodeLoadPromises.forEach((function(e) {
  586. return m.promiseFinally(e, (function() {
  587. o.view.invalidateScene(),
  588. o.numNodesLoading--
  589. }
  590. ))
  591. }
  592. )),
  593. this.numNodesLoading += a.nodeLoadPromises.length,
  594. a.nodeLoadFailed ? (this.updateErrorWrapper.handle(),
  595. this.loadFailed = !0) : (this.updateErrorWrapper.reset(),
  596. this.loadFailed = !1),
  597. this.updateProgress()
  598. }
  599. ,
  600. t.prototype.createInteractiveBBContainer = function(e, t) {
  601. var o = this
  602. , n = new a.Object3D;
  603. return n.name = "INTERACTIVE_BOUNDING_BOX_CONTAINER",
  604. n.position.copy(e.position),
  605. e.root.traverse((function(e) {
  606. e.isLeafNode && n.add(o.createInteractiveBB(e.boundingBox, t))
  607. }
  608. )),
  609. n
  610. }
  611. ,
  612. t.prototype.parsePointCloud = function(e, o) {
  613. var n = this;
  614. if (o.pointCloudSceneNode) {
  615. var i = new p.PointCloudObject(e);
  616. return i.frustumCulled = !1,
  617. i.userData.raycastable = !1,
  618. i.maxLevel = this.pointCloudMenuService.config.maxDepth,
  619. i.minNodePixelSize = this.pointCloudMenuService.config.minNodePixelSize,
  620. i.perspectiveMaterial = new S.PointCloudMaterial,
  621. i.orthographicMaterial = new S.PointCloudMaterial,
  622. o.pointCloudSceneNode.initialize(i, this.createInteractiveBBContainer(i, o)),
  623. this.updatePerspectiveMaterial(i.perspectiveMaterial, o),
  624. this.updateOrthographicMaterial(i.orthographicMaterial, o),
  625. o.pointCloudSceneNode.updateMatrixWorld(!0),
  626. o.pointCloudSceneNode.userData.raycastable = this.modeService.isDatasetAlignmentMode(),
  627. i.pcoGeometry.addNodeLoadedCallback((function(e) {
  628. var i = e.geometry.attributes.normal;
  629. t.isAnyNormalValid(i) ? o.hasNormals = !0 : (o.hasNormals = o.hasNormals || !1,
  630. t.makeNormalsInvalid(i)),
  631. n.view.invalidateScene()
  632. }
  633. )),
  634. this.sceneGroup.add(o.pointCloudSceneNode),
  635. i
  636. }
  637. }
  638. ,
  639. t.prototype.getPotreeDatasets = function() {
  640. return this.datasetRepository.data.filter((function(e) {
  641. return e.getPointCloudType() === c.PointCloudType.POTREE
  642. }
  643. ))
  644. }
  645. ,
  646. t.prototype.loadPointClouds = function() {
  647. var e = this
  648. , o = this.getPotreeDatasets().filter((function(e) {
  649. return e.pointCloudVisible && !e.pointCloudSceneNode
  650. }
  651. )).map((function(o) {
  652. var n = o.getPotreeConfigFilename()
  653. //, i = ossPrefix+sceneNum+'/' + f.getBaseUrl() + n;
  654. , i = ossPrefix + sceneNum + '/' + n
  655. o.pointCloudSceneNode = t.createPointCloudSceneNode(o),
  656. e.numCloudsLoading++;
  657. var r = e.potree.loadPointCloud(i, (function(e) {
  658. return e.includes("cloud.js") ? e : i + "/../" + e
  659. }
  660. ), (function(t, o) {
  661. return fetch(t, e.parseRequestHeaders(o))
  662. }
  663. )).then((function(t) {
  664. return e.parsePointCloud(t, o)
  665. }
  666. ));
  667. return m.promiseFinally(r, (function() {
  668. return e.numCloudsLoading--
  669. }
  670. ))
  671. }
  672. ));
  673. return Promise.all(o)
  674. }
  675. ,
  676. t.prototype.updateDatasetsVisibility = function() {
  677. var e = this;
  678. this.getPotreeDatasets().filter((function(e) {
  679. return !e.pointCloudVisible
  680. }
  681. )).forEach((function(t) {
  682. return e.removePointCloud(t)
  683. }
  684. )),
  685. this.updateMaterials(this.getPotreeDatasets()),
  686. this.view.invalidateScene()
  687. }
  688. ,
  689. t.prototype.removePointCloud = function(e) {
  690. e.pointCloudSceneNode && (e.pointCloudSceneNode.pointCloudObject && this.potree.lru.disposeSubtree(e.pointCloudSceneNode.pointCloudObject.root),
  691. this.sceneGroup.remove(e.pointCloudSceneNode),
  692. e.pointCloudSceneNode.dispose(),
  693. e.pointCloudSceneNode = void 0,
  694. this.view.invalidateScene())
  695. }
  696. ,
  697. t.prototype.createInteractiveBB = function(e, t) {
  698. return new s.BoundingBoxMesh(e,t,this.view,this.modeService,this.gettextCatalog,this.datasetAlignmentService,this.alignmentService)
  699. }
  700. ,
  701. t.prototype.updateProgress = function() {
  702. for (var e = 0, t = this.getPotreeDatasets().filter((function(e) {
  703. return e.pointCloudVisible && e.pointCloudSceneNode && e.pointCloudSceneNode.pointCloudObject
  704. }
  705. )).map((function(e) {
  706. return e.pointCloudSceneNode.pointCloudObject
  707. }
  708. )); e < t.length; e++) {
  709. var o = t[e];
  710. this.progressCurrent += o.visibleNodes.length,
  711. this.progressTotal += o.visibleGeometry.length
  712. }
  713. }
  714. ,
  715. t.prototype.updateRaycasting = function() {
  716. var e = this;
  717. this.getPotreeDatasets().filter((function(e) {
  718. return !u.isEmpty(e.pointCloudSceneNode)
  719. }
  720. )).forEach((function(t) {
  721. t.pointCloudSceneNode.userData.raycastable = e.modeService.isDatasetAlignmentMode()
  722. }
  723. ))
  724. }
  725. ,
  726. t.prototype.setFarClipping = function(e) {
  727. var t = this.pointCloudMenuService.config;
  728. e instanceof a.PerspectiveCamera && (e.far = t.maxDist < 300 ? t.maxDist : 1e3,
  729. e.updateProjectionMatrix())
  730. }
  731. ,
  732. t.prototype.setCloudOptions = function(e, t) {
  733. var o = this.pointCloudMenuService.config;
  734. this.potree.pointBudget = o.pointCountTarget * Math.pow(1e3, 2),
  735. t.forEach((function(t) {
  736. t.material = e instanceof a.PerspectiveCamera ? t.perspectiveMaterial : t.orthographicMaterial,
  737. t.minNodePixelSize = o.minNodeSize,
  738. t.maxLevel = o.maxDepth
  739. }
  740. ))
  741. }
  742. ,
  743. t.prototype.updateMaterials = function(e, t) {
  744. void 0 === t && (t = !1);
  745. for (var o = 0, n = e.filter((function(e) {
  746. return e.pointCloudSceneNode && e.pointCloudSceneNode.pointCloudObject
  747. }
  748. )); o < n.length; o++) {
  749. var i = n[o]
  750. , r = i.pointCloudSceneNode.pointCloudObject;
  751. this.updatePerspectiveMaterial(r.perspectiveMaterial, i),
  752. this.updateOrthographicMaterial(r.orthographicMaterial, i)
  753. }
  754. t || this.view.invalidateScene()
  755. }
  756. ,
  757. t.prototype.updatePerspectiveMaterial = function(e, o) {
  758. var n = this.pointCloudMenuService.config.perspectiveMaterial;
  759. e.gradient = S.RAINBOW,
  760. e.name = t.PERSPECTIVE_MATERIAL_ID,
  761. e.shape = Number(n.pointShapeSelectedOption.id),
  762. e.pointColorType = Number(n.colorStyleSelectedOption.id),
  763. e.heightMin = Number(n.z[0]),
  764. e.heightMax = Number(n.z[1]),
  765. e.color = d.ColorUtilities.getColor(o.color),
  766. e.pointOpacityType = S.PointOpacityType.ATTENUATED,
  767. e.useFilterByNormal = !1,
  768. e.opacity = Math.pow(Number(n.opacity), 2),
  769. e.useEDL = n.useEDL && this.pointCloudMenuService.config.showPointCloud,
  770. e.pointSizeType = n.pointSizeSelectedOption.id,
  771. e.opacityAttenuation = t.computeAttenuation(n.brightness);
  772. var i = o.pointCloudSceneNode.pointCloudObject.pcoGeometry.spacing
  773. , r = Number(n.pointSize)
  774. , a = r / i / 23;
  775. e.size = e.pointSizeType === S.PointSizeType.ATTENUATED ? a : r,
  776. this.edlRenderer.setEdlStrength(Number(n.EDLStrength)),
  777. this.assignClipBoxesToPointCloud(e)
  778. }
  779. ,
  780. t.prototype.updateOrthographicMaterial = function(e, o) {
  781. var n = this.pointCloudMenuService.config.orthoMaterial;
  782. e.gradient = S.RAINBOW,
  783. e.name = t.ORTHOGRAPHIC_MATERIAL_ID,
  784. e.size = Number(n.pointSize),
  785. e.pointSizeType = S.PointSizeType.FIXED,
  786. e.shape = Number(n.pointShapeSelectedOption.id),
  787. e.heightMin = Number(n.z[0]),
  788. e.heightMax = Number(n.z[1]),
  789. e.transparent = !0,
  790. e.color = d.ColorUtilities.getColor(o.color),
  791. e.pointColorType = Number(n.colorStyleSelectedOption.id),
  792. e.useFilterByNormal = n.normalsFiltering,
  793. e.filterByNormalThreshold = .3,
  794. e.pointOpacityType = S.PointOpacityType.ATTENUATED,
  795. e.opacityAttenuation = t.computeAttenuation(1e3),
  796. e.opacity = Math.pow(Number(n.opacity), 2),
  797. this.assignClipBoxesToPointCloud(e)
  798. }
  799. ,
  800. t.prototype.assignClipBoxesToPointCloud = function(e) {
  801. this.clipBoxes && this.clipBoxes.length > 0 ? (e.setClipBoxes(this.clipBoxes),
  802. e.clipMode = this.clipMode) : e.setClipBoxes([])
  803. }
  804. ,
  805. Object.defineProperty(t.prototype, "loadingTask", {
  806. get: function() {
  807. return void 0 === this._loadingTask && (this._loadingTask = this.progressReportService.addTask(this.gettextCatalog.getString("Loading point cloud..."), 1, !1, !1, !0)),
  808. this._loadingTask
  809. },
  810. enumerable: !0,
  811. configurable: !0
  812. }),
  813. t.prototype.useEyeDomeLighting = function(e) {
  814. var t = this.pointCloudMenuService.config.showPointCloud && this.pointCloudMenuService.config.perspectiveMaterial.useEDL && !(e.getCamera()instanceof a.OrthographicCamera);
  815. this.view.twoPassRenderer = t ? this.edlRenderer : void 0
  816. }
  817. ,
  818. t.prototype.releaseViewportsCache = function() {
  819. this.getPotreeDatasets().filter((function(e) {
  820. return !u.isEmpty(e.pointCloudSceneNode)
  821. }
  822. )).forEach((function(e) {
  823. return e.pointCloudSceneNode.releaseVisibleNodes()
  824. }
  825. ))
  826. }
  827. ,
  828. t.createPointCloudSceneNode = function(e) {
  829. var t = new h.PointCloudSceneNode;
  830. return t.name = "SCENE_NODE_" + e.name,
  831. t.userData.raycastable = !1,
  832. t.matrix = e.m2w_,
  833. t.matrixAutoUpdate = !1,
  834. t.matrixWorldNeedsUpdate = !0,
  835. t
  836. }
  837. ,
  838. t.computeAttenuation = function(e) {
  839. var t = e / 1e3 * 6 - 5;
  840. return Math.exp(t) / Math.exp(1) * 1e3
  841. }
  842. ,
  843. t.prototype.checkDepthTextureSupport = function() {
  844. this.view.renderer.extensions.get("WEBGL_depth_texture") || this.pointCloudMenuService.settingsPanes.forEach((function(e) {
  845. return e.visibleSettings.edlSupport = !1
  846. }
  847. ))
  848. }
  849. ,
  850. t.isAnyNormalValid = function(e) {
  851. if (!e)
  852. return !1;
  853. for (var t = 0; t < e.count; ++t)
  854. if (0 !== e.getX(t) || 0 !== e.getY(t) || -1 !== e.getZ(t) && 0 !== e.getZ(t))
  855. return !0;
  856. return !1
  857. }
  858. ,
  859. t.makeNormalsInvalid = function(e) {
  860. if (e)
  861. for (var t = 0; t < e.count; ++t)
  862. e.setXYZ(t, 0, 0, 0)
  863. }
  864. ,
  865. t.PERSPECTIVE_MATERIAL_ID = "PERSPECTIVE_MATERIAL",
  866. t.ORTHOGRAPHIC_MATERIAL_ID = "ORTHOGRAPHIC_MATERIAL",
  867. t.POINT_SIZE_WHEEL_SCALE = 10,
  868. t
  869. }(r.SceneLayer);
  870. t.PointCloudLayer = P
  871. },
  872. 2032: function(e, t, o) {
  873. "use strict";
  874. var n, i = this && this.__extends || (n = function(e, t) {
  875. return (n = Object.setPrototypeOf || {
  876. __proto__: []
  877. }instanceof Array && function(e, t) {
  878. e.__proto__ = t
  879. }
  880. || function(e, t) {
  881. for (var o in t)
  882. t.hasOwnProperty(o) && (e[o] = t[o])
  883. }
  884. )(e, t)
  885. }
  886. ,
  887. function(e, t) {
  888. function o() {
  889. this.constructor = e
  890. }
  891. n(e, t),
  892. e.prototype = null === t ? Object.create(t) : (o.prototype = t.prototype,
  893. new o)
  894. }
  895. );
  896. Object.defineProperty(t, "__esModule", {
  897. value: !0
  898. });
  899. var r = o(4)
  900. , a = o(212)
  901. , s = o(20)
  902. , c = o(52)
  903. , u = o(344)
  904. , l = function(e) {
  905. function t(t, o, n, i, a, s, c) {
  906. var l = e.call(this, new r.BoxGeometry(1,1,1), new r.MeshBasicMaterial({
  907. side: r.DoubleSide,
  908. color: u.ColorUtilities.getColor("blue"),
  909. wireframe: !0
  910. })) || this;
  911. return l.boundingBox = t,
  912. l.dataset = o,
  913. l.view = n,
  914. l.modeService = i,
  915. l.getTextCatalog = a,
  916. l.datasetAlignmentService = s,
  917. l.alignmentService = c,
  918. l.visible = !1,
  919. l.scale.subVectors(l.boundingBox.max, l.boundingBox.min),
  920. l.position.addVectors(l.boundingBox.max, l.boundingBox.min).divideScalar(2),
  921. l
  922. }
  923. return i(t, e),
  924. t.prototype.onMouseOver = function(e, t) {
  925. ("default" === document.body.style.cursor || "" === document.body.style.cursor) && this.modeService.isDatasetAlignmentMode() && t.getCamera()instanceof r.OrthographicCamera && (document.body.style.cursor = "move")
  926. }
  927. ,
  928. t.prototype.onMouseOut = function() {
  929. "move" === document.body.style.cursor && (document.body.style.cursor = "default")
  930. }
  931. ,
  932. t.prototype.onDragStart = function(e, t) {
  933. return this.lastDragPos = t.unprojectScreenCoordinates(e.x, e.y, 1),
  934. !!(this.modeService.isDatasetAlignmentMode() && t.getCamera()instanceof r.OrthographicCamera) && (document.body.style.cursor = "move",
  935. this.datasetAlignmentService.cacheCurrentState(),
  936. !0)
  937. }
  938. ,
  939. t.prototype.onDrag = function(e, t) {
  940. var o = t.unprojectScreenCoordinates(e.x, e.y, 1)
  941. , n = (new r.Vector3).subVectors(o, this.lastDragPos);
  942. 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)),
  943. this.datasetAlignmentService.translate(n),
  944. this.lastDragPos = o,
  945. this.view.invalidateScene()
  946. }
  947. ,
  948. t.prototype.onDragCancel = function() {
  949. this.datasetAlignmentService.undoTranslation(),
  950. this.view.invalidateScene()
  951. }
  952. ,
  953. t.prototype.onContextMenu = function(e) {
  954. var t = this;
  955. if (this.modeService.isDatasetAlignmentMode())
  956. return this.dataset.pointCloudVisible ? {
  957. name: this.getTextCatalog.getString("Hide {{title}}'s point cloud", {
  958. title: this.dataset.title
  959. }),
  960. icon: "delete",
  961. key: "dataset" + this.dataset.id.toString() + "Pointcloud",
  962. callback: function() {
  963. return t.deselectDataset()
  964. }
  965. } : void 0
  966. }
  967. ,
  968. t.prototype.deselectDataset = function() {
  969. this.alignmentService.deselect(this.dataset),
  970. s.invalidateAngular()
  971. }
  972. ,
  973. t
  974. }(r.Mesh);
  975. t.BoundingBoxMesh = l
  976. },
  977. 2033: function(e, t, o) {
  978. "use strict";
  979. var n, i = this && this.__extends || (n = function(e, t) {
  980. return (n = Object.setPrototypeOf || {
  981. __proto__: []
  982. }instanceof Array && function(e, t) {
  983. e.__proto__ = t
  984. }
  985. || function(e, t) {
  986. for (var o in t)
  987. t.hasOwnProperty(o) && (e[o] = t[o])
  988. }
  989. )(e, t)
  990. }
  991. ,
  992. function(e, t) {
  993. function o() {
  994. this.constructor = e
  995. }
  996. n(e, t),
  997. e.prototype = null === t ? Object.create(t) : (o.prototype = t.prototype,
  998. new o)
  999. }
  1000. );
  1001. Object.defineProperty(t, "__esModule", {
  1002. value: !0
  1003. });
  1004. var r = o(1906)
  1005. , a = function(e) {
  1006. function t(t) {
  1007. var o = e.call(this, t.potree, t.pcoGeometry, t.material) || this;
  1008. return o.Potree = r.Potree,
  1009. o
  1010. }
  1011. return i(t, e),
  1012. t
  1013. }(r.PointCloudOctree);
  1014. t.PointCloudObject = a
  1015. },
  1016. 2034: function(e, t, o) {
  1017. "use strict";
  1018. var n, i = this && this.__extends || (n = function(e, t) {
  1019. return (n = Object.setPrototypeOf || {
  1020. __proto__: []
  1021. }instanceof Array && function(e, t) {
  1022. e.__proto__ = t
  1023. }
  1024. || function(e, t) {
  1025. for (var o in t)
  1026. t.hasOwnProperty(o) && (e[o] = t[o])
  1027. }
  1028. )(e, t)
  1029. }
  1030. ,
  1031. function(e, t) {
  1032. function o() {
  1033. this.constructor = e
  1034. }
  1035. n(e, t),
  1036. e.prototype = null === t ? Object.create(t) : (o.prototype = t.prototype,
  1037. new o)
  1038. }
  1039. ), r = this && this.__spreadArrays || function() {
  1040. for (var e = 0, t = 0, o = arguments.length; t < o; t++)
  1041. e += arguments[t].length;
  1042. var n = Array(e)
  1043. , i = 0;
  1044. for (t = 0; t < o; t++)
  1045. for (var r = arguments[t], a = 0, s = r.length; a < s; a++,
  1046. i++)
  1047. n[i] = r[a];
  1048. return n
  1049. }
  1050. ;
  1051. Object.defineProperty(t, "__esModule", {
  1052. value: !0
  1053. });
  1054. var a = function(e) {
  1055. function t() {
  1056. var t = null !== e && e.apply(this, arguments) || this;
  1057. return t.visibleNodesForViewport = {},
  1058. t
  1059. }
  1060. return i(t, e),
  1061. Object.defineProperty(t.prototype, "pointCloudObject", {
  1062. get: function() {
  1063. return this.children.length > 0 ? this.children[0] : void 0
  1064. },
  1065. enumerable: !0,
  1066. configurable: !0
  1067. }),
  1068. t.prototype.initialize = function(e, t) {
  1069. this.add(e, t)
  1070. }
  1071. ,
  1072. t.prototype.dispose = function() {
  1073. this.pointCloudObject && (this.releaseVisibleNodes(),
  1074. this.pointCloudObject.dispose(),
  1075. this.children = [])
  1076. }
  1077. ,
  1078. t.prototype.getVisibleNodes = function(e) {
  1079. return this.visibleNodesForViewport[e.name]
  1080. }
  1081. ,
  1082. t.prototype.updateVisibleNodes = function(e) {
  1083. var t = this.pointCloudObject && this.pointCloudObject.visibleNodes || [];
  1084. this.visibleNodesForViewport[e.name] = r(t)
  1085. }
  1086. ,
  1087. t.prototype.releaseVisibleNodes = function() {
  1088. this.visibleNodesForViewport = {}
  1089. }
  1090. ,
  1091. t
  1092. }(o(4).Object3D);
  1093. t.PointCloudSceneNode = a
  1094. },
  1095. 2035: function(e, t, o) {
  1096. "use strict";
  1097. var n, i = this && this.__extends || (n = function(e, t) {
  1098. return (n = Object.setPrototypeOf || {
  1099. __proto__: []
  1100. }instanceof Array && function(e, t) {
  1101. e.__proto__ = t
  1102. }
  1103. || function(e, t) {
  1104. for (var o in t)
  1105. t.hasOwnProperty(o) && (e[o] = t[o])
  1106. }
  1107. )(e, t)
  1108. }
  1109. ,
  1110. function(e, t) {
  1111. function o() {
  1112. this.constructor = e
  1113. }
  1114. n(e, t),
  1115. e.prototype = null === t ? Object.create(t) : (o.prototype = t.prototype,
  1116. new o)
  1117. }
  1118. );
  1119. Object.defineProperty(t, "__esModule", {
  1120. value: !0
  1121. });
  1122. var r = function(e) {
  1123. function t() {
  1124. var t = null !== e && e.apply(this, arguments) || this;
  1125. return t.viewportCount = 1,
  1126. t._budget = 1e6,
  1127. t
  1128. }
  1129. return i(t, e),
  1130. Object.defineProperty(t.prototype, "pointBudget", {
  1131. get: function() {
  1132. return this._budget / this.viewportCount
  1133. },
  1134. set: function(e) {
  1135. e !== this._budget && (this._budget = e,
  1136. this.lru.pointBudget = e,
  1137. this.lru.freeMemory())
  1138. },
  1139. enumerable: !0,
  1140. configurable: !0
  1141. }),
  1142. t
  1143. }(o(1906).Potree);
  1144. t.IVPotree = r
  1145. },
  1146. 2036: function(e, t, o) {
  1147. "use strict";
  1148. Object.defineProperty(t, "__esModule", {
  1149. value: !0
  1150. });
  1151. var n = function() {
  1152. function e(e) {
  1153. this.gettextCatalog = e
  1154. }
  1155. return e.prototype.applies = function(e) {
  1156. return !0
  1157. }
  1158. ,
  1159. e.prototype.report = function() {
  1160. return this.gettextCatalog.getString("Cannot load point cloud data.")
  1161. }
  1162. ,
  1163. e
  1164. }();
  1165. t.PointCloudDetector = n
  1166. },
  1167. 2037: function(e, t, o) {
  1168. "use strict";
  1169. var n, i = this && this.__extends || (n = function(e, t) {
  1170. return (n = Object.setPrototypeOf || {
  1171. __proto__: []
  1172. }instanceof Array && function(e, t) {
  1173. e.__proto__ = t
  1174. }
  1175. || function(e, t) {
  1176. for (var o in t)
  1177. t.hasOwnProperty(o) && (e[o] = t[o])
  1178. }
  1179. )(e, t)
  1180. }
  1181. ,
  1182. function(e, t) {
  1183. function o() {
  1184. this.constructor = e
  1185. }
  1186. n(e, t),
  1187. e.prototype = null === t ? Object.create(t) : (o.prototype = t.prototype,
  1188. new o)
  1189. }
  1190. );
  1191. Object.defineProperty(t, "__esModule", {
  1192. value: !0
  1193. });
  1194. var r = o(2038)
  1195. , a = o(4)
  1196. , s = function(e) {
  1197. function t(t) {
  1198. var o = e.call(this, t) || this;
  1199. return o.setup(),
  1200. o
  1201. }
  1202. return i(t, e),
  1203. t.prototype.render = function(e, t) {
  1204. this.update(t);
  1205. var o = this.renderer.getRenderTarget();
  1206. this.renderer.setRenderTarget(this.target),
  1207. this.renderer.clear(),
  1208. this.renderer.render(e, t),
  1209. this.renderer.setRenderTarget(o),
  1210. this.renderer.render(this.postScene, this.postCamera)
  1211. }
  1212. ,
  1213. t.prototype.setEdlStrength = function(e) {
  1214. this.postMaterial.uniforms.edlStrength.value = e
  1215. }
  1216. ,
  1217. t.prototype.update = function(e) {
  1218. var t = this.renderer.getPixelRatio()
  1219. , o = new a.Vector2
  1220. , n = this.renderer.getRenderTarget();
  1221. n && n instanceof a.WebGLRenderTarget ? (o.x = n.width,
  1222. o.y = n.height) : this.renderer.getSize(o),
  1223. this.target.setSize(o.x, o.y),
  1224. this.postMaterial.uniforms.tWidth.value = o.x * t,
  1225. e instanceof a.PerspectiveCamera && (this.postMaterial.uniforms.cameraNear.value = e.near,
  1226. this.postMaterial.uniforms.cameraFar.value = e.far)
  1227. }
  1228. ,
  1229. t.prototype.setup = function() {
  1230. var e = new a.Vector2;
  1231. this.renderer.getSize(e),
  1232. this.target.texture.type = a.FloatType,
  1233. this.target.texture.format = a.RGBAFormat,
  1234. this.target.texture.minFilter = a.LinearFilter,
  1235. this.target.texture.magFilter = a.NearestFilter,
  1236. this.target.texture.generateMipmaps = !1,
  1237. this.target.stencilBuffer = !1,
  1238. this.target.depthBuffer = !0,
  1239. this.target.depthTexture = new a.DepthTexture(e.x,e.y),
  1240. this.target.depthTexture.type = a.UnsignedIntType;
  1241. var t = this.renderer.getPixelRatio();
  1242. this.postMaterial = new a.ShaderMaterial({
  1243. vertexShader: o(2039),
  1244. fragmentShader: o(2040),
  1245. uniforms: {
  1246. tDiffuse: {
  1247. value: this.target.texture
  1248. },
  1249. tDepth: {
  1250. value: this.target.depthTexture
  1251. },
  1252. tWidth: {
  1253. value: e.x * t
  1254. },
  1255. edlStrength: {
  1256. value: 300
  1257. },
  1258. cameraNear: {
  1259. value: .01
  1260. },
  1261. cameraFar: {
  1262. value: 100
  1263. }
  1264. }
  1265. }),
  1266. this.postScene.add(new a.Mesh(new a.PlaneBufferGeometry(2,2,0),this.postMaterial))
  1267. }
  1268. ,
  1269. t
  1270. }(r.TwoPassRenderer);
  1271. t.EdlRenderer = s
  1272. },
  1273. 2038: function(e, t, o) {
  1274. "use strict";
  1275. Object.defineProperty(t, "__esModule", {
  1276. value: !0
  1277. });
  1278. var n = o(4)
  1279. , i = function(e) {
  1280. var t = new n.Vector2;
  1281. e.getSize(t),
  1282. this.renderer = e,
  1283. this.target = new n.WebGLRenderTarget(t.x,t.y),
  1284. this.postCamera = new n.OrthographicCamera(-1,1,1,-1,0,1),
  1285. this.postScene = new n.Scene
  1286. };
  1287. t.TwoPassRenderer = i
  1288. },
  1289. 2039: function(e, t) {
  1290. e.exports = "varying vec2 vUv;\n\nvoid main() {\n\tvUv = uv;\n\tgl_Position = projectionMatrix * modelViewMatrix * vec4(position, 1.0);\n}"
  1291. },
  1292. 2040: function(e, t) {
  1293. 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"
  1294. },
  1295. 2041: function(e, t, o) {
  1296. "use strict";
  1297. o.r(t),
  1298. function(e) {
  1299. o.d(t, "LegacyPointCloudLayerFactory", (function() {
  1300. return h
  1301. }
  1302. ));
  1303. var n = o(4)
  1304. , i = o(646)
  1305. , r = o(7)
  1306. , a = o(254)
  1307. , s = o(212)
  1308. , c = o(639)
  1309. , u = o(157)
  1310. , l = o(344)
  1311. , d = o(52);
  1312. function p(e, t) {
  1313. var o;
  1314. if ("undefined" == typeof Symbol || null == e[Symbol.iterator]) {
  1315. if (Array.isArray(e) || (o = function(e, t) {
  1316. if (!e)
  1317. return;
  1318. if ("string" == typeof e)
  1319. return f(e, t);
  1320. var o = Object.prototype.toString.call(e).slice(8, -1);
  1321. "Object" === o && e.constructor && (o = e.constructor.name);
  1322. if ("Map" === o || "Set" === o)
  1323. return Array.from(e);
  1324. if ("Arguments" === o || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(o))
  1325. return f(e, t)
  1326. }(e)) || t && e && "number" == typeof e.length) {
  1327. o && (e = o);
  1328. var n = 0
  1329. , i = function() {};
  1330. return {
  1331. s: i,
  1332. n: function() {
  1333. return n >= e.length ? {
  1334. done: !0
  1335. } : {
  1336. done: !1,
  1337. value: e[n++]
  1338. }
  1339. },
  1340. e: function(e) {
  1341. throw e
  1342. },
  1343. f: i
  1344. }
  1345. }
  1346. throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")
  1347. }
  1348. var r, a = !0, s = !1;
  1349. return {
  1350. s: function() {
  1351. o = e[Symbol.iterator]()
  1352. },
  1353. n: function() {
  1354. var e = o.next();
  1355. return a = e.done,
  1356. e
  1357. },
  1358. e: function(e) {
  1359. s = !0,
  1360. r = e
  1361. },
  1362. f: function() {
  1363. try {
  1364. a || null == o.return || o.return()
  1365. } finally {
  1366. if (s)
  1367. throw r
  1368. }
  1369. }
  1370. }
  1371. }
  1372. function f(e, t) {
  1373. (null == t || t > e.length) && (t = e.length);
  1374. for (var o = 0, n = new Array(t); o < t; o++)
  1375. n[o] = e[o];
  1376. return n
  1377. }
  1378. function h(t, f, h, v, g, y, m, C, S, b) {
  1379. function P(P, _) {
  1380. var M, w, O, x, D, T = this, N = 1, j = [], E = 0, A = new Worker(e,{
  1381. name: "PointCloud",
  1382. type: void 0
  1383. }), L = l.ColorUtilities.COLOR_DEFS[Object.keys(l.ColorUtilities.COLOR_DEFS)[0]].rgb_color, R = function(e) {
  1384. var t = e / 1e3 * 6 - 5;
  1385. return Math.exp(t) / Math.exp(1) * 1e3
  1386. };
  1387. this.onTransitionStart = function() {}
  1388. ;
  1389. var V, F, I, B = function(e) {
  1390. _.traverse((function(t) {
  1391. "pointCloud" === t.name && e()
  1392. }
  1393. )),
  1394. P.invalidateScene()
  1395. };
  1396. this.changePCFixedSize = function(e) {
  1397. .1 < N + e && N + e < 10 && (N += e,
  1398. P.invalidateScene())
  1399. }
  1400. ,
  1401. this.onAfterRender = function() {
  1402. h.config.showPointCloud && Y(10)
  1403. }
  1404. ,
  1405. this.onBeforeRenderViewport = function(e) {
  1406. h.config.showPointCloud && _.traverse((function(t) {
  1407. if ("pointCloud" === t.name) {
  1408. if (e.cameraController instanceof c.FirstPersonCameraController) {
  1409. var o = 180 * e.getWidth() / Math.PI / e.cameraController.horizontalFOV;
  1410. t.material.uniforms.angle2pixels.value = o,
  1411. t.material.uniforms.fixedSize.value = 0
  1412. } else
  1413. t.material.uniforms.fixedSize.value = N;
  1414. t.userData.dataset.pcColorDefinition_ ? (t.material.uniforms.useRGB.value = !0,
  1415. t.material.uniforms.RGBColor.value = t.userData.dataset.pcColorDefinition_) : (t.material.uniforms.useRGB.value = !1,
  1416. t.material.uniforms.RGBColor.value = L)
  1417. }
  1418. }
  1419. )),
  1420. h.config.showPanosInPerspective && _.traverse((function(t) {
  1421. "pointCloud" === t.name && (t.visible = !(e.getCamera()instanceof n.PerspectiveCamera))
  1422. }
  1423. ))
  1424. }
  1425. ,
  1426. this.onCameraMoveEnd = function() {
  1427. G()
  1428. }
  1429. ;
  1430. var k, G = function() {
  1431. var e = Object(r.filter)(y.data, (function(e) {
  1432. return e.getPointCloudType() === a.PointCloudType.OCTREE
  1433. }
  1434. ));
  1435. I = 0,
  1436. F = 0,
  1437. V = Object(r.sumBy)(e, (function(e) {
  1438. return e.pointCloudVisible ? 1 : 0
  1439. }
  1440. ));
  1441. var t, o = p(e);
  1442. try {
  1443. for (o.s(); !(t = o.n()).done; ) {
  1444. var n = t.value;
  1445. z(n)
  1446. }
  1447. } catch (e) {
  1448. o.e(e)
  1449. } finally {
  1450. o.f()
  1451. }
  1452. }, z = function(e) {
  1453. var t = e.getPointCloudObject();
  1454. if (h.config.showPointCloud) {
  1455. U(t, e.m2w_);
  1456. var o = P.getCamera().position;
  1457. W(o, e),
  1458. t.pointCloudParticleSystemGroup && t.pointCloudParticleSystemGroup.traverse((function(e) {
  1459. e.visible = !0
  1460. }
  1461. )),
  1462. P.invalidateScene()
  1463. } else
  1464. q(t)
  1465. }, W = function e(o, r) {
  1466. var a = h.config.maxDepth;
  1467. if (r.pointCloudVisible) {
  1468. void 0 === k && (k = f.addTask(t.getString("Loading point cloud..."), 1, !1, !1, !0));
  1469. var s = r.getPointCloudObject();
  1470. if (U(s, r.m2w_),
  1471. !s.octreeLoaded)
  1472. return void (s.octreeLoading || (s.octreeLoading = !0,
  1473. K(r, (function(t) {
  1474. s.octreeLoading = !1,
  1475. s.octreeLoaded = !0,
  1476. e(o, r)
  1477. }
  1478. ))));
  1479. var c = [];
  1480. for (var u in s.subOctrees) {
  1481. var l = s.subOctrees[u]
  1482. , d = new n.Vector3(l.center[0],l.center[1],l.center[2]);
  1483. d.applyMatrix4(r.m2w_);
  1484. var p, v = d.sub(o).length();
  1485. for (var g in h.config.distance_to_depth)
  1486. if (v < h.config.distance_to_depth[g][0] || h.config.same_res) {
  1487. p = h.config.distance_to_depth[g][1];
  1488. break
  1489. }
  1490. var y = Math.min(p, Math.min(Object(i.getDepth)(l), a));
  1491. if ((!l.loading || l.loadingDepth != y) && v < h.config.maxDist)
  1492. if (s.octreeParticleSystems && s.subOctrees[l.key] && s.octreeParticleSystems[l.key]) {
  1493. var m = s.octreeParticleSystems[l.key];
  1494. m && (m.octreeDepth < y || m.octreeDepth > y && (v > 25 || m.octreeDepth > a)) && c.push({
  1495. dataset: r,
  1496. subOctree: l,
  1497. loadDepth: y,
  1498. dist: v
  1499. })
  1500. } else
  1501. c.push({
  1502. dataset: r,
  1503. subOctree: l,
  1504. loadDepth: y,
  1505. dist: v
  1506. })
  1507. }
  1508. for (var C in c.sort((function(e, t) {
  1509. return e.dist - t.dist
  1510. }
  1511. )),
  1512. c) {
  1513. var S = c[C];
  1514. S.dist < h.config.maxDist && (J(S.dataset, S.subOctree, S.loadDepth),
  1515. S.subOctree.loading,
  1516. S.subOctree.loading = !0,
  1517. S.subOctree.loadingDepth = S.loadDepth)
  1518. }
  1519. 0 == c.length && (I++,
  1520. V == I && (k.setPercentage(100),
  1521. k = void 0))
  1522. } else
  1523. q(r.getPointCloudObject())
  1524. }, H = function(e, t, i, r) {
  1525. var a = {
  1526. size: {
  1527. type: "f",
  1528. value: i
  1529. },
  1530. fixedSize: {
  1531. type: "f",
  1532. value: 0
  1533. },
  1534. angle2pixels: {
  1535. type: "f",
  1536. value: 10
  1537. },
  1538. hueOffset: {
  1539. type: "f",
  1540. value: h.config.hueOffset
  1541. },
  1542. hueScale: {
  1543. type: "f",
  1544. value: h.config.hueScale
  1545. },
  1546. alpha: {
  1547. type: "f",
  1548. value: h.config.opacity
  1549. },
  1550. alphaAttenuation: {
  1551. type: "f",
  1552. value: R(h.config.brightness)
  1553. },
  1554. useRGB: {
  1555. type: "i",
  1556. value: !1
  1557. },
  1558. RGBColor: {
  1559. type: "c",
  1560. value: L
  1561. }
  1562. }
  1563. , s = new n.ShaderMaterial({
  1564. uniforms: a,
  1565. vertexShader: o(2043),
  1566. fragmentShader: o(2044),
  1567. transparent: !0,
  1568. depthWrite: h.config.zBuffering,
  1569. depthTest: h.config.zBuffering
  1570. })
  1571. , c = new n.Points(t,s);
  1572. return c.name = "pointCloud",
  1573. c.frustumCulled = !0,
  1574. c.userData.raycastable = !1,
  1575. c.userData.dataset = r,
  1576. c
  1577. }, U = function(e, t) {
  1578. if (!e.pointCloudParticleSystemGroup) {
  1579. var o = new n.Object3D;
  1580. o.name = "pointCloudGroup",
  1581. o.matrix = t,
  1582. o.matrixAutoUpdate = !1,
  1583. o.matrixWorldNeedsUpdate = !0,
  1584. _.add(o),
  1585. e.pointCloudParticleSystemGroup = o
  1586. }
  1587. }, K = function(e, o) {
  1588. S.authorizedHttpRequest({
  1589. url: m.base_url + e.getOctreeConfigFilename()
  1590. }, !1).then((function(n) {
  1591. var r;
  1592. (r = new XMLHttpRequest).open("GET", m.base_url + e.getOctreeDirectory() + n.mergedSubData, !0),
  1593. C.setJwtHeaderOnXHR(r),
  1594. r.responseType = "arraybuffer",
  1595. r.onload = function() {
  1596. 200 != this.status && console.error("Loading merged subtree data failed: " + this.status + " (" + this.statusText + ")")
  1597. }
  1598. ,
  1599. r.send(),
  1600. (r = new XMLHttpRequest).open("GET", m.base_url + e.getOctreeDataFilename(), !0),
  1601. C.setJwtHeaderOnXHR(r),
  1602. r.responseType = "arraybuffer",
  1603. r.onload = function() {
  1604. if (200 == this.status) {
  1605. if (e.getPointCloudObject().pointCloudParticleSystemGroup) {
  1606. F++,
  1607. void 0 === k && (k = f.addTask(t.getString("Loading point cloud..."), 1, !1, !1, !0)),
  1608. k.setPercentage(50 * F / V);
  1609. var a = m.base_url;
  1610. a.startsWith("//") && (a = window.location.protocol + a),
  1611. n.prefix = a + e.getOctreeDirectory();
  1612. var s = e.getPointCloudObject();
  1613. s.octreeConfigStruct = n;
  1614. var c = new Uint8Array(r.response)
  1615. , u = new i.Octree(c,n.imoDepth,n.oct_imo_res,(function(t, o, i, r, a) {
  1616. o = n.subTrees.shift(),
  1617. o.center = [.5 * (o.bbX[0] + o.bbX[1]), .5 * (o.bbY[0] + o.bbY[1]), .5 * (o.bbZ[0] + o.bbZ[1])],
  1618. o.keys = new Int32Array(4),
  1619. o.keys[0] = i,
  1620. o.keys[1] = r,
  1621. o.keys[2] = a,
  1622. o.keys[3] = Math.log(t.res / o.res) / Math.log(2),
  1623. s.subOctrees || (s.subOctrees = []),
  1624. s.subOctrees[o.key] = o,
  1625. X(e, i, r, a)
  1626. }
  1627. ));
  1628. o && o(u)
  1629. }
  1630. } else
  1631. console.error("Loading octree data failed: " + this.status + " (" + this.statusText + ")")
  1632. }
  1633. ,
  1634. r.send()
  1635. }
  1636. )).catch((function(e, o, n) {
  1637. console.log(t.getString("Cannot load Octree point cloud: {{y}} {{z}}", {
  1638. y: o,
  1639. z: n
  1640. }))
  1641. }
  1642. ))
  1643. }, X = function(e, o, i, r) {
  1644. var a = e.getPointCloudObject().octreeConfigStruct
  1645. , c = (o + .5) * a.oct_imo_res + a.bbX[0]
  1646. , u = (i + .5) * a.oct_imo_res + a.bbY[0]
  1647. , l = (r + .5) * a.oct_imo_res + a.bbZ[0]
  1648. , p = new n.Mesh(w,O);
  1649. p.position.set(c, u, l),
  1650. p.scale.set(a.oct_imo_res, a.oct_imo_res, a.oct_imo_res),
  1651. p.onMouseOver = function(e, t) {
  1652. ("default" === document.body.style.cursor || "" === document.body.style.cursor) && g.isDatasetAlignmentMode() && t.getCamera()instanceof n.OrthographicCamera && (document.body.style.cursor = "move")
  1653. }
  1654. ,
  1655. p.onMouseOut = function() {
  1656. "move" === document.body.style.cursor && (document.body.style.cursor = "default")
  1657. }
  1658. ,
  1659. p.onDragStart = function(e, t) {
  1660. if (M = t.unprojectScreenCoordinates(e.x, e.y, 1),
  1661. g.isDatasetAlignmentMode() && t.getCamera()instanceof n.OrthographicCamera)
  1662. return v.cacheCurrentState(),
  1663. !0
  1664. }
  1665. ,
  1666. p.onDrag = function(e, t) {
  1667. var o = t.unprojectScreenCoordinates(e.x, e.y, 1)
  1668. , i = (new n.Vector3).subVectors(o, M);
  1669. 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)),
  1670. v.translate(i),
  1671. M = o,
  1672. P.invalidateScene()
  1673. }
  1674. ,
  1675. p.onDragCancel = function() {
  1676. v.undoTranslation(),
  1677. P.invalidateScene()
  1678. }
  1679. ,
  1680. p.onDragEnd = function() {}
  1681. ,
  1682. p.onContextMenu = function(o) {
  1683. if (g.isDatasetAlignmentMode())
  1684. return {
  1685. name: t.getString("Hide {{title}}'s point cloud", {
  1686. title: e.title
  1687. }),
  1688. icon: "delete",
  1689. key: "dataset" + e.id.toString() + "Pointcloud",
  1690. callback: function(t, o) {
  1691. b.deselect(e)
  1692. }
  1693. }
  1694. }
  1695. ;
  1696. var f = e.getPointCloudObject();
  1697. f.pointCloudParticleSystemGroup.add(p)
  1698. }, J = function(e, t, o) {
  1699. var n = {};
  1700. C.setJwtHeaderOnConfig(n),
  1701. A.postMessage({
  1702. cmd: "load",
  1703. datasetId: e.id,
  1704. octreeConfigStruct: e.getPointCloudObject().octreeConfigStruct,
  1705. sub_octree: t,
  1706. load_depth: o,
  1707. headers: n
  1708. })
  1709. }, Z = function(e) {
  1710. if ("pointcloud" == e.data.cmd)
  1711. j.push(e.data),
  1712. P.invalidateScene();
  1713. else if ("status" == e.data.cmd) {
  1714. void 0 !== k && (k.setPercentage(50 + e.data.percent / 2),
  1715. 100 == e.data.percent && (k = void 0));
  1716. var t = Math.round(e.data.percent);
  1717. if (t > E + 10 || 100 === t) {
  1718. E = t
  1719. }
  1720. }
  1721. }, Y = function(e) {
  1722. for (var t = (new Date).getTime(), o = 0; o < j.length && (new Date).getTime() - t < e; o++) {
  1723. var r = j[o]
  1724. , a = y.dataMap[r.datasetId]
  1725. , s = y.dataMap[r.datasetId].getPointCloudObject()
  1726. , c = null;
  1727. if (s.subOctrees)
  1728. if (s.subOctrees[r.sub_octree.key].loading = !1,
  1729. s.subOctrees[r.sub_octree.key].loadingDepth == r.sub_octree.load_depth) {
  1730. s.octreeParticleSystems || (s.octreeParticleSystems = []);
  1731. var u = s.octreeParticleSystems[r.sub_octree.key];
  1732. if (u && ($(u),
  1733. s.pointCloudParticleSystemGroup && s.pointCloudParticleSystemGroup.remove(u)),
  1734. r.error)
  1735. console.log("Discarding erroneous point cloud download");
  1736. else if (h.config.showPointCloud) {
  1737. 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; )
  1738. d.push(new v(p[g],p[g + 1],p[g + 2])),
  1739. g += 3;
  1740. (c = H(0, l, r.sub_octree.res * r.sub_octree.res_scale, a)).octreeDepth = r.sub_octree.load_depth,
  1741. c.octreeMaxDepth = Object(i.getDepth)(r.sub_octree),
  1742. c.position.set(r.sub_octree.center[0], r.sub_octree.center[1], r.sub_octree.center[2]),
  1743. s.octreeParticleSystems[r.sub_octree.key] = c,
  1744. s.pointCloudParticleSystemGroup && s.pointCloudParticleSystemGroup.add(c)
  1745. } else
  1746. delete s.octreeParticleSystems[r.sub_octree.key]
  1747. } else
  1748. 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 + ")")
  1749. }
  1750. j = j.slice(o),
  1751. o > 0 && P.invalidateScene()
  1752. }, q = function(e) {
  1753. if (e) {
  1754. if (e.pointCloudParticleSystemGroup && (_.remove(e.pointCloudParticleSystemGroup),
  1755. $(e.pointCloudParticleSystemGroup),
  1756. delete e.pointCloudParticleSystemGroup),
  1757. e.octreeParticleSystems) {
  1758. for (var t in e.octreeParticleSystems)
  1759. $(e.octreeParticleSystems[t]);
  1760. delete e.octreeParticleSystems
  1761. }
  1762. e.subOctrees = void 0,
  1763. e.octreeLoaded = !1,
  1764. e.octreeLoading = !1,
  1765. e.octreeConfigStruct = void 0,
  1766. P.invalidateScene()
  1767. }
  1768. }, $ = function(e) {
  1769. e.traverse((function(e) {
  1770. void 0 !== e.geometry && e.geometry !== w && e.geometry !== x && e.geometry.dispose(),
  1771. void 0 !== e.material && e.material !== O && e.material !== D && Object(u.disposeMeshMaterial)(e)
  1772. }
  1773. ))
  1774. };
  1775. this.onMouseWheel = function(e, t) {
  1776. if (P.inputHandler.isKeyPressed(s.KeyEvent.DOM_VK_A)) {
  1777. var o = -t;
  1778. return T.changePCFixedSize(o),
  1779. !0
  1780. }
  1781. }
  1782. ,
  1783. A.addEventListener("message", (function(e) {
  1784. Z(e)
  1785. }
  1786. ), !1),
  1787. w = new n.CubeGeometry(1,1,1),
  1788. O = new n.MeshBasicMaterial({
  1789. transparent: !0,
  1790. depthWrite: !1,
  1791. depthTest: !0,
  1792. wireframe: !0,
  1793. visible: !1,
  1794. side: n.DoubleSide
  1795. }),
  1796. x = new n.PlaneGeometry(2 / 3,2 / 3),
  1797. D = new n.MeshBasicMaterial({
  1798. transparent: !0,
  1799. depthWrite: !1,
  1800. depthTest: !0,
  1801. opacity: .5,
  1802. color: 8388608,
  1803. visible: !1,
  1804. side: n.DoubleSide
  1805. }),
  1806. y.entityRemoved.connect((function(e) {
  1807. var t = e.getPointCloudObject();
  1808. t && q(t)
  1809. }
  1810. )),
  1811. y.entityCreated.connect((function() {
  1812. return G()
  1813. }
  1814. )),
  1815. y.entityChanged.connect((function() {
  1816. return G()
  1817. }
  1818. )),
  1819. v.datasetAlignmentChanged.connect((function() {
  1820. return P.invalidateScene()
  1821. }
  1822. )),
  1823. h.configShowPointCloudChanged.connect((function() {
  1824. G(),
  1825. P.invalidateScene()
  1826. }
  1827. )),
  1828. h.configOpacityChanged.connect((function(e) {
  1829. B((function(t) {
  1830. return t.material.uniforms.alpha.value = e
  1831. }
  1832. ))
  1833. }
  1834. )),
  1835. h.configZBufferingChanged.connect((function(e) {
  1836. B((function(t) {
  1837. return t.material.depthWrite = t.material.depthTest = e
  1838. }
  1839. ))
  1840. }
  1841. )),
  1842. h.configBrightnessChanged.connect((function(e) {
  1843. B((function(t) {
  1844. return t.material.uniforms.alphaAttenuation.value = R(e)
  1845. }
  1846. ))
  1847. }
  1848. )),
  1849. h.configDepthCullingChanged.connect((function(e) {
  1850. P.getCamera().far = e < 300 ? e : 1e3,
  1851. G(),
  1852. P.invalidateScene()
  1853. }
  1854. )),
  1855. h.configPcResolutionChanged.connect((function() {
  1856. G(),
  1857. P.invalidateScene()
  1858. }
  1859. )),
  1860. h.configColorHueOffsetChanged.connect((function(e) {
  1861. B((function(t) {
  1862. return t.material.uniforms.hueOffset.value = e
  1863. }
  1864. ))
  1865. }
  1866. )),
  1867. h.configColorHueScaleChanged.connect((function(e) {
  1868. B((function(t) {
  1869. return t.material.uniforms.hueScale.value = e
  1870. }
  1871. ))
  1872. }
  1873. )),
  1874. G()
  1875. }
  1876. return {
  1877. create: function(e, t, o) {
  1878. return new P(e,t,o)
  1879. }
  1880. }
  1881. }
  1882. h.$inject = ["gettextCatalog", "ProgressReportService", "PointCloudMenuService", "DatasetAlignmentService", "ModeService", "DatasetRepository", "IV", "JWTTokenService", "RestService", "AlignmentService"]
  1883. }
  1884. .call(this, o(2042))
  1885. },
  1886. 2042: function(e, t, o) {
  1887. e.exports = o.p + "PointCloud.6891a103d9b18f6f5ac7.worker.js"
  1888. },
  1889. 2043: function(e, t) {
  1890. 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"
  1891. },
  1892. 2044: function(e, t) {
  1893. e.exports = "varying vec4 vColor;\n\nvoid main()\n{\n\tgl_FragColor = vColor;\n}\n"
  1894. }
  1895. }]);