SceneLayerWorker-HPZS4JRR.js 7.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163
  1. import "./chunk-ZNJHHCMJ.js";
  2. import "./chunk-44FMXGSC.js";
  3. import "./chunk-XFDO4CMR.js";
  4. import "./chunk-GHN7C53L.js";
  5. import "./chunk-K7B6OWCU.js";
  6. import "./chunk-OJ2HHY2O.js";
  7. import "./chunk-C7742RNZ.js";
  8. import "./chunk-VGWC3IKZ.js";
  9. import {
  10. a
  11. } from "./chunk-ZLNEXZAN.js";
  12. import "./chunk-RYY6632W.js";
  13. import "./chunk-DW42UVIT.js";
  14. import "./chunk-YAEIHDJH.js";
  15. import "./chunk-TJNOJH33.js";
  16. import "./chunk-OSHI574D.js";
  17. import "./chunk-DVUG3KID.js";
  18. import "./chunk-FWSQEIAR.js";
  19. import "./chunk-VEGAOVMY.js";
  20. import "./chunk-6KZ2LTDA.js";
  21. import "./chunk-V6P2MAQQ.js";
  22. import "./chunk-E5O6P5I2.js";
  23. import "./chunk-SPWQ3AWG.js";
  24. import {
  25. t2 as t
  26. } from "./chunk-2TIUKVZN.js";
  27. import {
  28. r
  29. } from "./chunk-YXWMMD76.js";
  30. import "./chunk-S5KM4IGW.js";
  31. // node_modules/@arcgis/core/libs/i3s/enums.js
  32. var n;
  33. var e;
  34. !function(n4) {
  35. n4[n4.None = 0] = "None", n4[n4.Int16 = 1] = "Int16", n4[n4.Int32 = 2] = "Int32";
  36. }(n || (n = {})), function(n4) {
  37. n4[n4.Replace = 0] = "Replace", n4[n4.Outside = 1] = "Outside", n4[n4.Inside = 2] = "Inside", n4[n4.Finished = 3] = "Finished";
  38. }(e || (e = {}));
  39. // node_modules/@arcgis/core/libs/i3s/I3SModule.js
  40. function e2() {
  41. return n2 || (n2 = new Promise((t2) => import("./i3s-6P5X4JEO.js").then((t3) => t3.i).then(({ default: e3 }) => {
  42. const n4 = e3({ locateFile: i, onRuntimeInitialized: () => t2(n4) });
  43. delete n4.then;
  44. })).catch((t2) => {
  45. throw t2;
  46. })), n2;
  47. }
  48. function i(e3) {
  49. return a(`esri/libs/i3s/${e3}`);
  50. }
  51. var n2;
  52. // node_modules/@arcgis/core/views/3d/layers/i3s/I3SNode.js
  53. var n3;
  54. var o;
  55. var s;
  56. var a2;
  57. var c;
  58. !function(e3) {
  59. e3[e3.Unmodified = 0] = "Unmodified", e3[e3.Culled = 1] = "Culled", e3[e3.NotChecked = 2] = "NotChecked";
  60. }(n3 || (n3 = {})), function(e3) {
  61. 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";
  62. }(o || (o = {}));
  63. !function(e3) {
  64. e3[e3.Unknown = 0] = "Unknown", e3[e3.Uncached = 1] = "Uncached", e3[e3.Cached = 2] = "Cached";
  65. }(s || (s = {})), function(e3) {
  66. 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";
  67. }(a2 || (a2 = {})), function(e3) {
  68. e3[e3.Hole = 0] = "Hole", e3[e3.Leaf = 1] = "Leaf";
  69. }(c || (c = {}));
  70. // node_modules/@arcgis/core/views/3d/layers/SceneLayerWorker.js
  71. async function s2(e3) {
  72. await g();
  73. const t2 = [e3.geometryBuffer];
  74. return { result: m(e3, t2), transferList: t2 };
  75. }
  76. async function f(e3) {
  77. var _a;
  78. await g();
  79. const r2 = [e3.geometryBuffer], { geometryBuffer: n4 } = e3, o2 = n4.byteLength, s3 = y._malloc(o2), f2 = new Uint8Array(y.HEAPU8.buffer, s3, o2);
  80. f2.set(new Uint8Array(n4));
  81. const i3 = y.dracoDecompressPointCloudData(s3, f2.byteLength);
  82. if (y._free(s3), i3.error.length > 0)
  83. throw `i3s.wasm: ${i3.error}`;
  84. const a4 = ((_a = i3.featureIds) == null ? void 0 : _a.length) > 0 ? t(i3.featureIds) : null, u2 = t(i3.positions);
  85. return a4 && r2.push(a4.buffer), r2.push(u2.buffer), { result: { positions: u2, featureIds: a4 }, transferList: r2 };
  86. }
  87. async function i2(e3) {
  88. await g(), E2(e3);
  89. const t2 = { buffer: e3.buffer };
  90. return { result: t2, transferList: [t2.buffer] };
  91. }
  92. async function a3(e3) {
  93. await g(), b(e3);
  94. }
  95. async function u(e3) {
  96. await g(), y.setLegacySchema(e3.context, e3.jsonSchema);
  97. }
  98. function l(e3) {
  99. h(e3);
  100. }
  101. var c2;
  102. var y;
  103. function b(e3) {
  104. const t2 = e3.modifications, r2 = y._malloc(8 * t2.length), n4 = new Float64Array(y.HEAPU8.buffer, r2, t2.length);
  105. for (let o2 = 0; o2 < t2.length; ++o2)
  106. n4[o2] = t2[o2];
  107. y.setModifications(e3.context, r2, t2.length, e3.isGeodetic), y._free(r2);
  108. }
  109. function m(n4, o2) {
  110. if (!y)
  111. return null;
  112. const { context: s3, localOrigin: f2, globalTrafo: i3, mbs: a4, obb: u2, elevationOffset: l2, geometryBuffer: c3, geometryDescriptor: b2, indexToVertexProjector: m2, vertexToRenderProjector: d2 } = n4, E3 = y._malloc(c3.byteLength), h2 = 33, g2 = y._malloc(h2 * Float64Array.BYTES_PER_ELEMENT), w2 = new Uint8Array(y.HEAPU8.buffer, E3, c3.byteLength);
  113. w2.set(new Uint8Array(c3));
  114. const A = new Float64Array(y.HEAPU8.buffer, g2, h2);
  115. p(A, f2);
  116. let _ = A.byteOffset + 3 * A.BYTES_PER_ELEMENT, L = new Float64Array(A.buffer, _);
  117. p(L, i3), _ += 16 * A.BYTES_PER_ELEMENT, L = new Float64Array(A.buffer, _), p(L, a4), _ += 4 * A.BYTES_PER_ELEMENT, r(u2) && (L = new Float64Array(A.buffer, _), p(L, u2.center), _ += 3 * A.BYTES_PER_ELEMENT, L = new Float64Array(A.buffer, _), p(L, u2.halfSize), _ += 3 * A.BYTES_PER_ELEMENT, L = new Float64Array(A.buffer, _), p(L, u2.quaternion));
  118. const I = b2, T = { isDraco: false, isLegacy: false, color: n4.layouts.some((e3) => e3.some((e4) => "color" === e4.name)), normal: n4.needNormals && n4.layouts.some((e3) => e3.some((e4) => "normalCompressed" === e4.name)), uv0: n4.layouts.some((e3) => e3.some((e4) => "uv0" === e4.name)), uvRegion: n4.layouts.some((e3) => e3.some((e4) => "uvRegion" === e4.name)), featureIndex: I.featureIndex }, P = y.process(s3, !!n4.obb, E3, w2.byteLength, I, T, g2, l2, m2, d2, n4.normalReferenceFrame);
  119. if (y._free(g2), y._free(E3), P.error.length > 0)
  120. throw `i3s.wasm: ${P.error}`;
  121. if (P.discarded)
  122. return null;
  123. 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 } };
  124. 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 };
  125. }
  126. function d(e3) {
  127. return 0 === e3 ? o.Unmodified : 1 === e3 ? o.PotentiallyModified : 2 === e3 ? o.Culled : o.Unknown;
  128. }
  129. function E2(e3) {
  130. 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);
  131. s3.set(f2), y.filterOBBs(t2, n4, o2), f2.set(s3), y._free(n4);
  132. }
  133. function h(e3) {
  134. y && y.destroy(e3);
  135. }
  136. function p(e3, t2) {
  137. for (let r2 = 0; r2 < t2.length; ++r2)
  138. e3[r2] = t2[r2];
  139. }
  140. function g() {
  141. return y ? Promise.resolve() : (c2 || (c2 = e2().then((e3) => {
  142. y = e3, c2 = null;
  143. })), c2);
  144. }
  145. var w = { transform: m, destroy: h };
  146. export {
  147. l as destroyContext,
  148. f as dracoDecompressPointCloudData,
  149. i2 as filterObbsForModifications,
  150. E2 as filterObbsForModificationsSync,
  151. g as initialize,
  152. d as interpretObbModificationResults,
  153. s2 as process,
  154. u as setLegacySchema,
  155. a3 as setModifications,
  156. b as setModificationsSync,
  157. w as test
  158. };
  159. //# sourceMappingURL=SceneLayerWorker-HPZS4JRR.js.map