SceneLayerWorker-SAXSQD5N.js 7.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159
  1. import "./chunk-Y2EWIDNZ.js";
  2. import "./chunk-6BRTRIDE.js";
  3. import "./chunk-YZUP3MAF.js";
  4. import "./chunk-E3HOL2XO.js";
  5. import "./chunk-SCXOTZ6Q.js";
  6. import "./chunk-G5AI6ZNE.js";
  7. import "./chunk-WR32EHFC.js";
  8. import "./chunk-NTUXR253.js";
  9. import "./chunk-TERAW6FT.js";
  10. import "./chunk-XNLG7T2T.js";
  11. import "./chunk-IR4PV7VK.js";
  12. import {
  13. a
  14. } from "./chunk-MXB2XLKV.js";
  15. import "./chunk-VNFRAYHO.js";
  16. import "./chunk-R5IG2D6H.js";
  17. import "./chunk-VBRY5KJM.js";
  18. import "./chunk-SAS7RONY.js";
  19. import "./chunk-ULGDPLM2.js";
  20. import "./chunk-EMJ4ZSM2.js";
  21. import "./chunk-IKP3YN53.js";
  22. import {
  23. r,
  24. t3 as t
  25. } from "./chunk-GZT4BVFP.js";
  26. import "./chunk-A5ICIBVI.js";
  27. // node_modules/@arcgis/core/libs/i3s/enums.js
  28. var n;
  29. var e;
  30. !function(n4) {
  31. n4[n4.None = 0] = "None", n4[n4.Int16 = 1] = "Int16", n4[n4.Int32 = 2] = "Int32";
  32. }(n || (n = {})), function(n4) {
  33. n4[n4.Replace = 0] = "Replace", n4[n4.Outside = 1] = "Outside", n4[n4.Inside = 2] = "Inside", n4[n4.Finished = 3] = "Finished";
  34. }(e || (e = {}));
  35. // node_modules/@arcgis/core/libs/i3s/I3SModule.js
  36. function e2() {
  37. return n2 || (n2 = new Promise((t2) => import("./i3s-RJEK4VSY.js").then((t3) => t3.i).then(({ default: e3 }) => {
  38. const n4 = e3({ locateFile: i, onRuntimeInitialized: () => t2(n4) });
  39. delete n4.then;
  40. })).catch((t2) => {
  41. throw t2;
  42. })), n2;
  43. }
  44. function i(e3) {
  45. return a(`esri/libs/i3s/${e3}`);
  46. }
  47. var n2;
  48. // node_modules/@arcgis/core/views/3d/layers/i3s/I3SNode.js
  49. var n3;
  50. var o;
  51. var s;
  52. var a2;
  53. var c;
  54. !function(e3) {
  55. e3[e3.Unmodified = 0] = "Unmodified", e3[e3.Culled = 1] = "Culled", e3[e3.NotChecked = 2] = "NotChecked";
  56. }(n3 || (n3 = {})), function(e3) {
  57. e3[e3.Unmodified = 0] = "Unmodified", e3[e3.PotentiallyModified = 1] = "PotentiallyModified", e3[e3.Culled = 2] = "Culled", e3[e3.Unknown = 3] = "Unknown", e3[e3.NotChecked = 4] = "NotChecked";
  58. }(o || (o = {}));
  59. !function(e3) {
  60. e3[e3.Unknown = 0] = "Unknown", e3[e3.Uncached = 1] = "Uncached", e3[e3.Cached = 2] = "Cached";
  61. }(s || (s = {})), function(e3) {
  62. e3[e3.None = 0] = "None", e3[e3.MaxScreenThreshold = 1] = "MaxScreenThreshold", e3[e3.ScreenSpaceRelative = 2] = "ScreenSpaceRelative", e3[e3.RemovedFeatureDiameter = 3] = "RemovedFeatureDiameter", e3[e3.DistanceRangeFromDefaultCamera = 4] = "DistanceRangeFromDefaultCamera";
  63. }(a2 || (a2 = {})), function(e3) {
  64. e3[e3.Hole = 0] = "Hole", e3[e3.Leaf = 1] = "Leaf";
  65. }(c || (c = {}));
  66. // node_modules/@arcgis/core/views/3d/layers/SceneLayerWorker.js
  67. async function s2(e3) {
  68. await g();
  69. const t2 = [e3.geometryBuffer];
  70. return { result: m(e3, t2), transferList: t2 };
  71. }
  72. async function f(e3) {
  73. await g();
  74. const r2 = [e3.geometryBuffer], { geometryBuffer: n4 } = e3, o2 = n4.byteLength, s3 = y._malloc(o2), f2 = new Uint8Array(y.HEAPU8.buffer, s3, o2);
  75. f2.set(new Uint8Array(n4));
  76. const i3 = y.dracoDecompressPointCloudData(s3, f2.byteLength);
  77. if (y._free(s3), i3.error.length > 0)
  78. throw `i3s.wasm: ${i3.error}`;
  79. const a4 = i3.featureIds?.length > 0 ? t(i3.featureIds) : null, u2 = t(i3.positions);
  80. a4 && r2.push(a4.buffer), r2.push(u2.buffer);
  81. return { result: { positions: u2, featureIds: a4 }, transferList: r2 };
  82. }
  83. async function i2(e3) {
  84. await g(), E(e3);
  85. const t2 = { buffer: e3.buffer };
  86. return { result: t2, transferList: [t2.buffer] };
  87. }
  88. async function a3(e3) {
  89. await g(), b(e3);
  90. }
  91. async function u(e3) {
  92. await g(), y.setLegacySchema(e3.context, e3.jsonSchema);
  93. }
  94. function l(e3) {
  95. h(e3);
  96. }
  97. var c2;
  98. var y;
  99. function b(e3) {
  100. const t2 = e3.modifications, r2 = y._malloc(8 * t2.length), n4 = new Float64Array(y.HEAPU8.buffer, r2, t2.length);
  101. for (let o2 = 0; o2 < t2.length; ++o2)
  102. n4[o2] = t2[o2];
  103. y.setModifications(e3.context, r2, t2.length, e3.isGeodetic), y._free(r2);
  104. }
  105. function m(n4, o2) {
  106. if (!y)
  107. return null;
  108. const { context: s3, localOrigin: f2, globalTrafo: i3, mbs: a4, obb: u2, elevationOffset: l2, geometryBuffer: c3, geometryDescriptor: b2, indexToVertexProjector: m2, vertexToRenderProjector: d2 } = n4, E2 = y._malloc(c3.byteLength), h2 = 33, g2 = y._malloc(h2 * Float64Array.BYTES_PER_ELEMENT), w2 = new Uint8Array(y.HEAPU8.buffer, E2, c3.byteLength);
  109. w2.set(new Uint8Array(c3));
  110. const A = new Float64Array(y.HEAPU8.buffer, g2, h2);
  111. p(A, f2);
  112. let _ = A.byteOffset + 3 * A.BYTES_PER_ELEMENT, L2 = new Float64Array(A.buffer, _);
  113. p(L2, i3), _ += 16 * A.BYTES_PER_ELEMENT, L2 = new Float64Array(A.buffer, _), p(L2, a4), _ += 4 * A.BYTES_PER_ELEMENT, r(u2) && (L2 = new Float64Array(A.buffer, _), p(L2, u2.center), _ += 3 * A.BYTES_PER_ELEMENT, L2 = new Float64Array(A.buffer, _), p(L2, u2.halfSize), _ += 3 * A.BYTES_PER_ELEMENT, L2 = new Float64Array(A.buffer, _), p(L2, u2.quaternion));
  114. const I = b2, T = { isDraco: false, isLegacy: false, color: n4.layouts.some((e3) => e3.some((e4) => e4.name === "color")), normal: n4.needNormals && n4.layouts.some((e3) => e3.some((e4) => e4.name === "normalCompressed")), uv0: n4.layouts.some((e3) => e3.some((e4) => e4.name === "uv0")), uvRegion: n4.layouts.some((e3) => e3.some((e4) => e4.name === "uvRegion")), featureIndex: I.featureIndex }, P = y.process(s3, !!n4.obb, E2, w2.byteLength, I, T, g2, l2, m2, d2, n4.normalReferenceFrame);
  115. if (y._free(g2), y._free(E2), P.error.length > 0)
  116. throw `i3s.wasm: ${P.error}`;
  117. if (P.discarded)
  118. return null;
  119. const U = P.componentOffsets.length > 0 ? t(P.componentOffsets) : null, B = P.featureIds.length > 0 ? t(P.featureIds) : null, F = t(P.interleavedVertedData).buffer, M = P.indicesType === n.Int16 ? t(new Uint16Array(P.indices.buffer, P.indices.byteOffset, P.indices.byteLength / 2)) : t(new Uint32Array(P.indices.buffer, P.indices.byteOffset, P.indices.byteLength / 4)), S = t(P.positions), x = P.positionIndicesType === n.Int16 ? t(new Uint16Array(P.positionIndices.buffer, P.positionIndices.byteOffset, P.positionIndices.byteLength / 2)) : t(new Uint32Array(P.positionIndices.buffer, P.positionIndices.byteOffset, P.positionIndices.byteLength / 4)), O = { layout: n4.layouts[0], interleavedVertexData: F, indices: M, hasColors: P.hasColors, hasModifications: P.hasModifications, positionData: { data: S, indices: x } };
  120. return B && o2.push(B.buffer), U && o2.push(U.buffer), o2.push(F), o2.push(M.buffer), o2.push(S.buffer), o2.push(x.buffer), { componentOffsets: U, featureIds: B, transformedGeometry: O, obb: P.obb };
  121. }
  122. function d(e3) {
  123. return e3 === 0 ? o.Unmodified : e3 === 1 ? o.PotentiallyModified : e3 === 2 ? o.Culled : o.Unknown;
  124. }
  125. function E(e3) {
  126. const { context: t2, buffer: r2 } = e3, n4 = y._malloc(r2.byteLength), o2 = r2.byteLength / Float64Array.BYTES_PER_ELEMENT, s3 = new Float64Array(y.HEAPU8.buffer, n4, o2), f2 = new Float64Array(r2);
  127. s3.set(f2), y.filterOBBs(t2, n4, o2), f2.set(s3), y._free(n4);
  128. }
  129. function h(e3) {
  130. y && y.destroy(e3);
  131. }
  132. function p(e3, t2) {
  133. for (let r2 = 0; r2 < t2.length; ++r2)
  134. e3[r2] = t2[r2];
  135. }
  136. function g() {
  137. return y ? Promise.resolve() : (c2 || (c2 = e2().then((e3) => {
  138. y = e3, c2 = null;
  139. })), c2);
  140. }
  141. var w = { transform: m, destroy: h };
  142. export {
  143. l as destroyContext,
  144. f as dracoDecompressPointCloudData,
  145. i2 as filterObbsForModifications,
  146. E as filterObbsForModificationsSync,
  147. g as initialize,
  148. d as interpretObbModificationResults,
  149. s2 as process,
  150. u as setLegacySchema,
  151. a3 as setModifications,
  152. b as setModificationsSync,
  153. w as test
  154. };
  155. //# sourceMappingURL=SceneLayerWorker-SAXSQD5N.js.map