VoxelLayer-VXHDUDBI.js 27 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455
  1. import {
  2. A
  3. } from "./chunk-C62PEMUB.js";
  4. import "./chunk-5ZZSM3DU.js";
  5. import "./chunk-BQ7UE3XL.js";
  6. import "./chunk-UILPRJKY.js";
  7. import "./chunk-524XACB7.js";
  8. import "./chunk-QY775BFA.js";
  9. import {
  10. i as i2
  11. } from "./chunk-FMKGHOGD.js";
  12. import {
  13. p as p2
  14. } from "./chunk-6URTNEGN.js";
  15. import {
  16. l as l3
  17. } from "./chunk-3D3QEPRE.js";
  18. import {
  19. S as S2
  20. } from "./chunk-X7DBH4KK.js";
  21. import {
  22. l as l2
  23. } from "./chunk-7XXXCK2A.js";
  24. import {
  25. v
  26. } from "./chunk-KHA63LLS.js";
  27. import {
  28. c as c2
  29. } from "./chunk-FGKNEJKJ.js";
  30. import {
  31. c,
  32. f,
  33. p
  34. } from "./chunk-PSV473TI.js";
  35. import {
  36. O
  37. } from "./chunk-I3OBGWNS.js";
  38. import "./chunk-FONIFA5N.js";
  39. import "./chunk-EG5OI4V4.js";
  40. import {
  41. i
  42. } from "./chunk-65BYCSII.js";
  43. import "./chunk-WZQZRKNH.js";
  44. import "./chunk-LRDX4TO7.js";
  45. import "./chunk-6A4U74YA.js";
  46. import {
  47. t as t2
  48. } from "./chunk-W72F6AS3.js";
  49. import "./chunk-O4FY3ITT.js";
  50. import {
  51. b
  52. } from "./chunk-4DDBH2K5.js";
  53. import "./chunk-7N4X6GF3.js";
  54. import "./chunk-JXW4QTJA.js";
  55. import "./chunk-UXF37FQ4.js";
  56. import "./chunk-ZOEK6QHJ.js";
  57. import {
  58. z
  59. } from "./chunk-XNLG7T2T.js";
  60. import {
  61. r as r2
  62. } from "./chunk-IR4PV7VK.js";
  63. import "./chunk-2Z6LERTI.js";
  64. import "./chunk-OWVBLVP3.js";
  65. import {
  66. n as n2
  67. } from "./chunk-AFZ7XSEW.js";
  68. import "./chunk-EGZW6HC3.js";
  69. import "./chunk-4NKD334K.js";
  70. import "./chunk-65K7LC56.js";
  71. import "./chunk-ATPLLI5W.js";
  72. import "./chunk-WJ3OEUD3.js";
  73. import "./chunk-MXB2XLKV.js";
  74. import "./chunk-XH7RUGVZ.js";
  75. import "./chunk-TBBTRX4O.js";
  76. import "./chunk-YBSUITLL.js";
  77. import {
  78. j
  79. } from "./chunk-ALDCDSPV.js";
  80. import "./chunk-DT6EAZQ5.js";
  81. import "./chunk-HNOZUNJ4.js";
  82. import "./chunk-VNFRAYHO.js";
  83. import "./chunk-R5IG2D6H.js";
  84. import "./chunk-VBRY5KJM.js";
  85. import "./chunk-PDKDCAAD.js";
  86. import {
  87. o
  88. } from "./chunk-ECW2QABR.js";
  89. import "./chunk-GCDJLKH4.js";
  90. import "./chunk-MRJEICT6.js";
  91. import {
  92. d,
  93. e,
  94. l3 as l,
  95. n2 as n
  96. } from "./chunk-Y3WMVFTW.js";
  97. import "./chunk-SAS7RONY.js";
  98. import "./chunk-WSRBH7BF.js";
  99. import {
  100. S
  101. } from "./chunk-IHXECKQQ.js";
  102. import {
  103. w
  104. } from "./chunk-ULGDPLM2.js";
  105. import {
  106. s,
  107. s3 as s2
  108. } from "./chunk-EMJ4ZSM2.js";
  109. import "./chunk-IKP3YN53.js";
  110. import {
  111. r,
  112. t
  113. } from "./chunk-GZT4BVFP.js";
  114. import "./chunk-A5ICIBVI.js";
  115. // node_modules/@arcgis/core/layers/support/VoxelDynamicSection.js
  116. var p3 = class extends l3(l) {
  117. constructor() {
  118. super(...arguments), this.enabled = true, this.label = "", this.normal = null, this.point = null;
  119. }
  120. };
  121. e([d({ type: Boolean, json: { default: true, write: true } })], p3.prototype, "enabled", void 0), e([d({ type: String, json: { write: true } })], p3.prototype, "label", void 0), e([d({ type: [Number], json: { write: true } })], p3.prototype, "normal", void 0), e([d({ type: [Number], json: { write: true } })], p3.prototype, "point", void 0), p3 = e([n("esri.layers.support.VoxelDynamicSection")], p3);
  122. var i3 = p3;
  123. // node_modules/@arcgis/core/layers/support/VoxelSlice.js
  124. var p4 = class extends l3(l) {
  125. constructor() {
  126. super(...arguments), this.enabled = true, this.label = "", this.normal = null, this.point = null;
  127. }
  128. };
  129. e([d({ type: Boolean, json: { write: true } })], p4.prototype, "enabled", void 0), e([d({ type: String, json: { write: true } })], p4.prototype, "label", void 0), e([d({ type: [Number], json: { write: true } })], p4.prototype, "normal", void 0), e([d({ type: [Number], json: { write: true } })], p4.prototype, "point", void 0), p4 = e([n("esri.layers.support.VoxelSlice")], p4);
  130. var i4 = p4;
  131. // node_modules/@arcgis/core/layers/support/VoxelSection.js
  132. var n3 = class extends l {
  133. constructor() {
  134. super(...arguments), this.enabled = true, this.href = null, this.id = null, this.label = "", this.normal = null, this.point = null, this.sizeInPixel = null, this.slices = null, this.timeId = 0, this.variableId = null;
  135. }
  136. readHref(e2, r3, o2) {
  137. return i(e2, o2);
  138. }
  139. };
  140. e([d({ type: Boolean, json: { default: true, write: true } })], n3.prototype, "enabled", void 0), e([d({ type: String, json: { write: { enabled: true, isRequired: true } } })], n3.prototype, "href", void 0), e([o(["service", "web-scene"], "href")], n3.prototype, "readHref", null), e([d({ type: S, json: { write: { enabled: true, isRequired: true } } })], n3.prototype, "id", void 0), e([d({ type: String, json: { write: true } })], n3.prototype, "label", void 0), e([d({ type: [Number], json: { write: { enabled: true, isRequired: true } } })], n3.prototype, "normal", void 0), e([d({ type: [Number], json: { write: { enabled: true, isRequired: true } } })], n3.prototype, "point", void 0), e([d({ type: [S], json: { write: { enabled: true, isRequired: true } } })], n3.prototype, "sizeInPixel", void 0), e([d({ type: [i4], json: { write: true } })], n3.prototype, "slices", void 0), e([d({ type: S, json: { default: 0, write: true } })], n3.prototype, "timeId", void 0), e([d({ type: S, json: { write: { enabled: true, isRequired: true } } })], n3.prototype, "variableId", void 0), n3 = e([n("esri.layers.support.VoxelSection")], n3);
  141. var a = n3;
  142. // node_modules/@arcgis/core/layers/support/VoxelSimpleShading.js
  143. var t3 = class extends l {
  144. constructor() {
  145. super(...arguments), this.diffuseFactor = 0.5, this.specularFactor = 0.5;
  146. }
  147. };
  148. e([d({ type: Number, range: { min: 0, max: 1 }, json: { default: 0.5, write: true } })], t3.prototype, "diffuseFactor", void 0), e([d({ type: Number, range: { min: 0, max: 1 }, json: { default: 0.5, write: true } })], t3.prototype, "specularFactor", void 0), t3 = e([n("esri.layers.support.VoxelSimpleShading")], t3);
  149. var p5 = t3;
  150. // node_modules/@arcgis/core/layers/support/VoxelFormat.js
  151. var s3 = class extends l {
  152. constructor() {
  153. super(...arguments), this.continuity = null, this.hasNoData = false, this.noData = 0, this.offset = 0, this.scale = 1, this.type = null;
  154. }
  155. };
  156. e([d({ type: ["discrete", "continuous"], json: { write: true } })], s3.prototype, "continuity", void 0), e([d({ type: Boolean, json: { write: true } })], s3.prototype, "hasNoData", void 0), e([d({ type: Number, json: { write: true } })], s3.prototype, "noData", void 0), e([d({ type: Number, json: { write: true } })], s3.prototype, "offset", void 0), e([d({ type: Number, json: { write: true } })], s3.prototype, "scale", void 0), e([d({ type: String, json: { write: { enabled: true, isRequired: true } } })], s3.prototype, "type", void 0), s3 = e([n("esri.layers.support.VoxelFormat")], s3);
  157. var p6 = s3;
  158. // node_modules/@arcgis/core/layers/support/VoxelVariable.js
  159. var i5 = class extends l {
  160. constructor() {
  161. super(...arguments), this.id = null, this.description = "", this.name = null, this.originalFormat = null, this.renderingFormat = null, this.unit = "", this.volumeId = 0, this.type = null;
  162. }
  163. };
  164. e([d({ type: Number, json: { write: { enabled: true, isRequired: true } } })], i5.prototype, "id", void 0), e([d({ type: String, json: { write: true } })], i5.prototype, "description", void 0), e([d({ type: String, json: { write: { enabled: true, isRequired: true } } })], i5.prototype, "name", void 0), e([d({ type: p6, json: { write: true } })], i5.prototype, "originalFormat", void 0), e([d({ type: p6, json: { write: { enabled: true, isRequired: true } } })], i5.prototype, "renderingFormat", void 0), e([d({ type: String, json: { write: true } })], i5.prototype, "unit", void 0), e([d({ type: Number, json: { write: true } })], i5.prototype, "volumeId", void 0), e([d({ type: ["stc-hot-spot-results", "stc-cluster-outlier-results", "stc-estimated-bin", "generic-nearest-interpolated"], json: { write: true } })], i5.prototype, "type", void 0), i5 = e([n("esri.layers.support.VoxelVariable")], i5);
  165. var p7 = i5;
  166. // node_modules/@arcgis/core/layers/support/VoxelIsosurface.js
  167. var l4 = class extends l {
  168. constructor() {
  169. super(...arguments), this.color = null, this.value = null, this.enabled = true, this.label = null;
  170. }
  171. };
  172. e([d({ type: l2, json: { type: [S], write: { enabled: true, isRequired: true } } })], l4.prototype, "color", void 0), e([d({ type: Number, json: { write: { enabled: true, isRequired: true } } })], l4.prototype, "value", void 0), e([d({ type: Boolean, json: { default: true, write: true } })], l4.prototype, "enabled", void 0), e([d({ type: String, json: { write: true } })], l4.prototype, "label", void 0), l4 = e([n("esri.layers.support.VoxelIsosurface")], l4);
  173. var i6 = l4;
  174. // node_modules/@arcgis/core/layers/support/VoxelAlphaStop.js
  175. var t4 = class extends l {
  176. constructor() {
  177. super(...arguments), this.alpha = 0, this.position = 0;
  178. }
  179. };
  180. e([d({ type: Number, json: { write: { enabled: true, isRequired: true } } })], t4.prototype, "alpha", void 0), e([d({ type: Number, json: { write: { enabled: true, isRequired: true } } })], t4.prototype, "position", void 0), t4 = e([n("esri.layers.support.VoxelAlphaStop")], t4);
  181. var p8 = t4;
  182. // node_modules/@arcgis/core/layers/support/VoxelColorStop.js
  183. var i7 = class extends l {
  184. constructor() {
  185. super(...arguments), this.color = null, this.position = 0;
  186. }
  187. };
  188. e([d({ type: l2, json: { type: [S], write: { enabled: true, isRequired: true } } })], i7.prototype, "color", void 0), e([d({ type: Number, json: { write: { enabled: true, isRequired: true } } })], i7.prototype, "position", void 0), i7 = e([n("esri.layers.support.VoxelColorStop")], i7);
  189. var c3 = i7;
  190. // node_modules/@arcgis/core/layers/support/VoxelRangeFilter.js
  191. var t5 = class extends l {
  192. constructor() {
  193. super(...arguments), this.enabled = false, this.range = null;
  194. }
  195. };
  196. e([d({ type: Boolean, json: { default: false, write: true } })], t5.prototype, "enabled", void 0), e([d({ type: [Number], json: { write: true } })], t5.prototype, "range", void 0), t5 = e([n("esri.layers.support.VoxelRangeFilter")], t5);
  197. var p9 = t5;
  198. // node_modules/@arcgis/core/layers/support/VoxelTransferFunctionStyle.js
  199. var n4 = class extends l {
  200. constructor(o2) {
  201. super(o2), this.interpolation = null, this.stretchRange = null, this.rangeFilter = null, this.colorStops = new j(), this.alphaStops = new j();
  202. }
  203. set colorStops(o2) {
  204. this._set("colorStops", n2(o2, this._get("colorStops"), j.ofType(c3)));
  205. }
  206. set alphaStops(o2) {
  207. this._set("alphaStops", n2(o2, this._get("alphaStops"), j.ofType(p8)));
  208. }
  209. };
  210. e([d({ type: ["linear", "nearest"], json: { write: true } })], n4.prototype, "interpolation", void 0), e([d({ type: [Number], json: { write: { enabled: true, isRequired: true } } })], n4.prototype, "stretchRange", void 0), e([d({ type: j.ofType(c3), json: { write: { enabled: true, overridePolicy() {
  211. return { enabled: !!this.colorStops && this.colorStops.length > 0 };
  212. } } } })], n4.prototype, "colorStops", null), e([d({ type: j.ofType(p8), json: { write: { enabled: true, overridePolicy() {
  213. return { enabled: !!this.alphaStops && this.alphaStops.length > 0 };
  214. } } } })], n4.prototype, "alphaStops", null), e([d({ type: p9, json: { write: true } })], n4.prototype, "rangeFilter", void 0), n4 = e([n("esri.layers.support.VoxelTransferFunctionStyle")], n4);
  215. var c4 = n4;
  216. // node_modules/@arcgis/core/layers/support/VoxelUniqueValue.js
  217. var i8 = class extends l {
  218. constructor() {
  219. super(...arguments), this.color = null, this.value = 0, this.enabled = true, this.label = null;
  220. }
  221. };
  222. e([d({ type: l2, json: { type: [S], write: { enabled: true, isRequired: true } } })], i8.prototype, "color", void 0), e([d({ type: S, json: { write: { enabled: true, isRequired: true } } })], i8.prototype, "value", void 0), e([d({ type: Boolean, json: { default: true, write: true } })], i8.prototype, "enabled", void 0), e([d({ type: String, json: { write: true } })], i8.prototype, "label", void 0), i8 = e([n("esri.layers.support.VoxelUniqueValue")], i8);
  223. var l5 = i8;
  224. // node_modules/@arcgis/core/layers/support/VoxelVariableStyle.js
  225. var c5 = class extends l3(l) {
  226. constructor(e2) {
  227. super(e2), this.variableId = 0, this.label = null, this.transferFunction = null, this.uniqueValues = new j(), this.isosurfaces = new j();
  228. }
  229. set uniqueValues(e2) {
  230. this._set("uniqueValues", n2(e2, this._get("uniqueValues"), j.ofType(l5)));
  231. }
  232. set isosurfaces(e2) {
  233. this._set("isosurfaces", n2(e2, this._get("isosurfaces"), j.ofType(i6)));
  234. }
  235. };
  236. e([d({ type: S, json: { write: { enabled: true, isRequired: true } } })], c5.prototype, "variableId", void 0), e([d({ type: String, json: { write: true } })], c5.prototype, "label", void 0), e([d({ type: c4, json: { write: { enabled: true, overridePolicy() {
  237. return { enabled: !this.uniqueValues || this.uniqueValues.length < 1 };
  238. } } } })], c5.prototype, "transferFunction", void 0), e([d({ type: j.ofType(l5), json: { write: { enabled: true, overridePolicy() {
  239. return { enabled: !!this.uniqueValues && this.uniqueValues.length > 0 };
  240. } } } })], c5.prototype, "uniqueValues", null), e([d({ type: j.ofType(i6), json: { write: { enabled: true, overridePolicy() {
  241. const e2 = !this.uniqueValues || this.uniqueValues.length < 1, s5 = !!this.isosurfaces && this.isosurfaces.length > 0;
  242. return { enabled: e2 && s5 };
  243. } } } })], c5.prototype, "isosurfaces", null), c5 = e([n("esri.layers.support.VoxelVariableStyle")], c5);
  244. var f2 = c5;
  245. // node_modules/@arcgis/core/layers/support/VoxelIrregularSpacing.js
  246. var t6 = class extends l {
  247. constructor() {
  248. super(...arguments), this.values = null;
  249. }
  250. };
  251. e([d({ type: [Number], json: { write: true } })], t6.prototype, "values", void 0), t6 = e([n("esri.layers.support.VoxelIrregularSpacing")], t6);
  252. var p10 = t6;
  253. // node_modules/@arcgis/core/layers/support/VoxelRegularSpacing.js
  254. var t7 = class extends l {
  255. constructor() {
  256. super(...arguments), this.scale = 1, this.offset = 0;
  257. }
  258. };
  259. e([d({ type: Number, json: { write: true } })], t7.prototype, "scale", void 0), e([d({ type: Number, json: { write: true } })], t7.prototype, "offset", void 0), t7 = e([n("esri.layers.support.VoxelRegularSpacing")], t7);
  260. var p11 = t7;
  261. // node_modules/@arcgis/core/layers/support/VoxelDimension.js
  262. var p12 = class extends l {
  263. constructor() {
  264. super(...arguments), this.irregularSpacing = null, this.isPositiveUp = null, this.isWrappedDateLine = null, this.label = null, this.name = null, this.quantity = null, this.regularSpacing = null, this.size = 0, this.unit = null;
  265. }
  266. };
  267. e([d({ type: p10, json: { write: true } })], p12.prototype, "irregularSpacing", void 0), e([d({ type: Boolean, json: { write: true } })], p12.prototype, "isPositiveUp", void 0), e([d({ type: Boolean, json: { write: true } })], p12.prototype, "isWrappedDateLine", void 0), e([d({ type: String, json: { write: true } })], p12.prototype, "label", void 0), e([d({ type: String, json: { write: true } })], p12.prototype, "name", void 0), e([d({ type: String, json: { write: true } })], p12.prototype, "quantity", void 0), e([d({ type: p11, json: { write: true } })], p12.prototype, "regularSpacing", void 0), e([d({ type: Number, json: { write: true } })], p12.prototype, "size", void 0), e([d({ type: String, json: { write: true } })], p12.prototype, "unit", void 0), p12 = e([n("esri.layers.support.VoxelDimension")], p12);
  268. var n5 = p12;
  269. // node_modules/@arcgis/core/layers/support/VoxelVolume.js
  270. var t8 = class extends l {
  271. constructor() {
  272. super(...arguments), this.id = 0, this.dimensions = null;
  273. }
  274. getZDimension() {
  275. if (!this.dimensions)
  276. return -1;
  277. if (!Array.isArray(this.dimensions))
  278. return -1;
  279. if (this.dimensions.length !== 4)
  280. return -1;
  281. for (let s5 = 2; s5 < 4; ++s5)
  282. if (this.dimensions[s5].size > 0)
  283. return s5;
  284. return -1;
  285. }
  286. isVolumeValid() {
  287. return !!this.dimensions && (!!Array.isArray(this.dimensions) && (this.dimensions.length === 4 && (!(this.dimensions[0].size < 1 || this.dimensions[1].size < 1) && this.getZDimension() !== -1)));
  288. }
  289. };
  290. e([d({ type: Number, json: { write: { enabled: true, isRequired: true } } })], t8.prototype, "id", void 0), e([d({ type: [n5], json: { write: { enabled: true, isRequired: true } } })], t8.prototype, "dimensions", void 0), t8 = e([n("esri.layers.support.VoxelVolume")], t8);
  291. var n6 = t8;
  292. // node_modules/@arcgis/core/layers/support/VoxelVolumeIndex.js
  293. var t9;
  294. var s4 = t9 = class extends l {
  295. constructor() {
  296. super(...arguments), this.apronWidth = 1, this.brickSize = [32, 32, 32], this.maxLodLevel = 0, this.nodeSize = [4, 4, 4];
  297. }
  298. isValid() {
  299. const e2 = new t9();
  300. return e2.apronWidth === this.apronWidth && e2.maxLodLevel === this.maxLodLevel && (!!this.brickSize && (!!this.nodeSize && (!(!Array.isArray(this.brickSize) || !Array.isArray(this.nodeSize)) && (this.brickSize.length === 3 && this.nodeSize.length === 3 && (this.brickSize[0] === 32 && this.brickSize[1] === 32 && this.brickSize[2] === 32 && (this.nodeSize[0] === 4 && this.nodeSize[1] === 4 && this.nodeSize[2] === 4))))));
  301. }
  302. };
  303. e([d({ type: Number, json: { write: { enabled: true, isRequired: true } } })], s4.prototype, "apronWidth", void 0), e([d({ type: [Number], json: { write: { enabled: true, isRequired: true } } })], s4.prototype, "brickSize", void 0), e([d({ type: Number, json: { write: { enabled: true, isRequired: true } } })], s4.prototype, "maxLodLevel", void 0), e([d({ type: [Number], json: { write: { enabled: true, isRequired: true } } })], s4.prototype, "nodeSize", void 0), s4 = t9 = e([n("esri.layers.support.VoxelVolumeIndex")], s4);
  304. var p13 = s4;
  305. // node_modules/@arcgis/core/layers/support/VoxelVolumeStyle.js
  306. var a2 = class extends l3(l) {
  307. constructor(e2) {
  308. super(e2), this.volumeId = 0, this.verticalExaggeration = 1, this.exaggerationMode = "scale-height", this.verticalOffset = 0, this.slices = new j(), this.dynamicSections = new j();
  309. }
  310. set slices(e2) {
  311. this._set("slices", n2(e2, this._get("slices"), j.ofType(i4)));
  312. }
  313. set dynamicSections(e2) {
  314. this._set("dynamicSections", n2(e2, this._get("dynamicSections"), j.ofType(i3)));
  315. }
  316. };
  317. e([d({ type: S, json: { write: { enabled: true, isRequired: true } } })], a2.prototype, "volumeId", void 0), e([d({ type: Number, json: { default: 1, write: true } })], a2.prototype, "verticalExaggeration", void 0), e([d({ type: ["scale-position", "scale-height"], json: { default: "scale-height", write: true } })], a2.prototype, "exaggerationMode", void 0), e([d({ type: Number, json: { default: 0, write: true } })], a2.prototype, "verticalOffset", void 0), e([d({ type: j.ofType(i4), json: { write: { enabled: true, overridePolicy() {
  318. return { enabled: !!this.slices && this.slices.length > 0 };
  319. } } } })], a2.prototype, "slices", null), e([d({ type: j.ofType(i3), json: { write: { enabled: true, overridePolicy() {
  320. return { enabled: !!this.dynamicSections && this.dynamicSections.length > 0 };
  321. } } } })], a2.prototype, "dynamicSections", null), a2 = e([n("esri.layers.support.VoxelVolumeStyle")], a2);
  322. var m = a2;
  323. // node_modules/@arcgis/core/layers/VoxelLayer.js
  324. var A2 = s.getLogger(" esri.layers.VoxelLayer");
  325. var J = class extends A(p2(c2(v(t2(O(i2(b))))))) {
  326. constructor(e2) {
  327. super(e2), this.serviceRoot = "", this.popupEnabled = true, this.operationalLayerType = "Voxel", this.legendEnabled = true, this.title = null, this.sections = new j(), this.currentVariableId = 0, this.volumeStyles = null, this.renderMode = "volume", this.variableStyles = null, this.enableSlices = true, this.enableSections = true, this.enableDynamicSections = true, this.enableIsosurfaces = true, this.shading = new p5(), this.opacity = 1, this.variables = new j(), this.volumes = new j(), this.index = null, this.minScale = 0, this.maxScale = 0, this.type = "voxel", this.version = { major: Number.NaN, minor: Number.NaN, versionString: "" }, this.volumeStyles = new j(), this.variableStyles = new j();
  328. }
  329. set url(e2) {
  330. this._set("url", S2(e2, A2));
  331. }
  332. load(e2) {
  333. const i9 = r(e2) ? e2.signal : null, r3 = this.loadFromPortal({ supportedTypes: ["Scene Service"] }, e2).catch(w).then(() => this._fetchService(i9)).then(() => this.serviceRoot = this.url);
  334. return this.addResolvingPromise(r3), Promise.resolve(this);
  335. }
  336. readVersion(e2, i9) {
  337. return super.parseVersionString(e2);
  338. }
  339. validateLayer(e2) {
  340. if (e2.layerType && e2.layerType !== this.operationalLayerType)
  341. throw new s2("voxel-layer:layer-type-not-supported", "VoxelLayer does not support this layer type", { layerType: e2.layerType });
  342. if (isNaN(this.version.major) || isNaN(this.version.minor) || this.version.major < 3)
  343. throw new s2("layer:service-version-not-supported", "Service version is not supported.", { serviceVersion: this.version.versionString, supportedVersions: "3.x" });
  344. if (this.version.major > 3)
  345. throw new s2("layer:service-version-too-new", "Service version is too new.", { serviceVersion: this.version.versionString, supportedVersions: "3.x" });
  346. }
  347. getConfiguration() {
  348. const e2 = { layerType: this.operationalLayerType, version: this.version.versionString, name: this.title, spatialReference: this.spatialReference, fullExtent: this.fullExtent, volumes: this.volumes.toJSON(), variables: this.variables.toJSON(), index: this.index.toJSON(), sections: this.sections.toJSON(), style: { volumeStyles: this.volumeStyles.toJSON(), currentVariableId: this.currentVariableId, renderMode: this.renderMode, variableStyles: this.variableStyles.toJSON(), enableSections: this.enableSections, enableDynamicSections: this.enableDynamicSections, enableIsosurfaces: this.enableIsosurfaces, enableSlices: this.enableSlices, shading: this.shading } };
  349. return e2.index && this.index.isValid() ? JSON.stringify(e2) : "";
  350. }
  351. getVariableStyle(e2) {
  352. let i9 = -1;
  353. i9 = r(e2) ? e2 : this.currentVariableId;
  354. if (!this.variableStyles || i9 === -1)
  355. return null;
  356. const r3 = this.variableStyles.findIndex((e3) => e3.variableId === i9);
  357. return r3 < 0 ? null : this.variableStyles.getItemAt(r3);
  358. }
  359. getVariable(e2) {
  360. let i9 = -1;
  361. if (i9 = r(e2) ? e2 : this.currentVariableId, !this.variables || i9 === -1)
  362. return null;
  363. const r3 = this.variables.findIndex((e3) => e3.id === i9);
  364. return r3 < 0 ? null : this.variables.getItemAt(r3);
  365. }
  366. getSections() {
  367. const e2 = [];
  368. for (const i9 of this.sections)
  369. e2.push(new a({ enabled: i9.enabled, href: i9.href, id: i9.id, label: i9.label, normal: i9.normal, point: i9.point, sizeInPixel: i9.sizeInPixel, slices: i9.slices, timeId: i9.timeId, variableId: i9.variableId }));
  370. return e2;
  371. }
  372. getVolume(e2) {
  373. const i9 = this.getVariable(e2);
  374. return r(i9) ? this.volumes.find(({ id: e3 }) => e3 === i9.volumeId) : null;
  375. }
  376. getVolumeStyle(e2) {
  377. const i9 = this.getVariable(e2);
  378. return r(i9) ? this.volumeStyles.find(({ volumeId: e3 }) => e3 === i9.volumeId) : null;
  379. }
  380. getSlices() {
  381. const e2 = [], i9 = this.getVolume(null);
  382. if (t(i9) || !i9.isVolumeValid())
  383. return e2;
  384. const r3 = this.getVolumeStyle(null);
  385. if (t(r3))
  386. return e2;
  387. for (const t10 of r3.slices)
  388. this._isPlaneValid(t10, [0, 1, i9.getZDimension()], i9.dimensions) ? e2.push(new i4({ enabled: t10.enabled, label: t10.label, point: t10.point, normal: t10.normal })) : e2.push(new i4({ enabled: false, label: "invalid", point: t10.point, normal: t10.normal }));
  389. return e2;
  390. }
  391. getDynamicSections() {
  392. const e2 = [], i9 = this.getVolume(null);
  393. if (t(i9) || !i9.isVolumeValid())
  394. return e2;
  395. const r3 = this.getVolumeStyle(null);
  396. if (t(r3))
  397. return e2;
  398. for (const t10 of r3.dynamicSections)
  399. this._isPlaneValid(t10, [0, 1, i9.getZDimension()], i9.dimensions) ? e2.push(new i3({ enabled: t10.enabled, label: t10.label, point: t10.point, normal: t10.normal })) : e2.push(new i3({ enabled: false, label: "invalid", point: t10.point, normal: t10.normal }));
  400. return e2;
  401. }
  402. getVerticalExaggeration() {
  403. const e2 = 1, i9 = this.getVolumeStyle(null);
  404. return t(i9) ? e2 : i9.verticalExaggeration;
  405. }
  406. getVerticalOffset() {
  407. const e2 = 1, i9 = this.getVolumeStyle(null);
  408. return t(i9) ? e2 : i9.verticalOffset;
  409. }
  410. _isPlaneValid(e2, i9, r3) {
  411. if (!e2.point)
  412. return false;
  413. if (!Array.isArray(e2.point) || e2.point.length !== 3)
  414. return false;
  415. if (!e2.normal)
  416. return false;
  417. if (!Array.isArray(e2.normal) || e2.normal.length !== 3)
  418. return false;
  419. for (let s5 = 0; s5 < 3; ++s5) {
  420. const t11 = e2.point[s5];
  421. if (t11 < 0 || t11 >= r3[i9[s5]].size)
  422. return false;
  423. }
  424. const t10 = r2(e2.normal[0], e2.normal[1], e2.normal[2]);
  425. z(t10, t10);
  426. const o2 = 1e-6;
  427. return !(Math.abs(t10[0]) + Math.abs(t10[1]) + Math.abs(t10[2]) < o2) && (e2.normal[0] = t10[0], e2.normal[1] = t10[1], e2.normal[2] = t10[2], true);
  428. }
  429. };
  430. e([d(p)], J.prototype, "popupEnabled", void 0), e([d({ type: ["Voxel"] })], J.prototype, "operationalLayerType", void 0), e([d(c)], J.prototype, "legendEnabled", void 0), e([d({ json: { write: true } })], J.prototype, "title", void 0), e([d(f)], J.prototype, "url", null), e([d({ type: j.ofType(a), json: { origins: { "web-scene": { name: "layerDefinition.sections", write: true } } } })], J.prototype, "sections", void 0), e([d({ type: S, json: { origins: { "web-scene": { name: "layerDefinition.style.currentVariableId", write: { enabled: true, isRequired: true } }, service: { name: "style.currentVariableId" } } } })], J.prototype, "currentVariableId", void 0), e([d({ type: j.ofType(m), json: { origins: { "web-scene": { name: "layerDefinition.style.volumeStyles", write: true }, service: { name: "style.volumeStyles" } } } })], J.prototype, "volumeStyles", void 0), e([d({ type: ["volume", "surfaces"], json: { origins: { "web-scene": { name: "layerDefinition.style.renderMode", write: true }, service: { name: "style.renderMode" } } } })], J.prototype, "renderMode", void 0), e([d({ type: j.ofType(f2), json: { origins: { "web-scene": { name: "layerDefinition.style.variableStyles", write: true }, service: { name: "style.variableStyles" } } } })], J.prototype, "variableStyles", void 0), e([d({ type: Boolean, json: { origins: { "web-scene": { name: "layerDefinition.style.enableSlices", write: true }, service: { name: "style.enableSlices" } } } })], J.prototype, "enableSlices", void 0), e([d({ type: Boolean, json: { origins: { "web-scene": { name: "layerDefinition.style.enableSections", write: true }, service: { name: "style.enableSections" } } } })], J.prototype, "enableSections", void 0), e([d({ type: Boolean, json: { origins: { "web-scene": { name: "layerDefinition.style.enableDynamicSections", write: true }, service: { name: "style.enableDynamicSections" } } } })], J.prototype, "enableDynamicSections", void 0), e([d({ type: Boolean, json: { origins: { "web-scene": { name: "layerDefinition.style.enableIsosurfaces", write: true }, service: { name: "style.enableIsosurfaces" } } } })], J.prototype, "enableIsosurfaces", void 0), e([d({ type: p5, json: { origins: { "web-scene": { name: "layerDefinition.style.shading", write: true }, service: { name: "style.shading" } } } })], J.prototype, "shading", void 0), e([d({ type: ["show", "hide"] })], J.prototype, "listMode", void 0), e([d({ type: Number, range: { min: 0, max: 1 }, nonNullable: true, json: { read: false, write: false, origins: { "web-scene": { read: false, write: false }, "portal-item": { read: false, write: false } } } })], J.prototype, "opacity", void 0), e([d({ type: j.ofType(p7) })], J.prototype, "variables", void 0), e([d({ type: j.ofType(n6) })], J.prototype, "volumes", void 0), e([d({ type: p13 })], J.prototype, "index", void 0), e([d({ type: Number, json: { name: "layerDefinition.minScale", read: false, write: false, origins: { service: { read: false, write: false } } } })], J.prototype, "minScale", void 0), e([d({ type: Number, json: { name: "layerDefinition.maxScale", read: false, write: false, origins: { service: { read: false, write: false } } } })], J.prototype, "maxScale", void 0), e([d({ json: { read: false }, readOnly: true })], J.prototype, "type", void 0), e([d({ readOnly: true, json: { name: "serviceVersion" } })], J.prototype, "version", void 0), e([o("service", "version")], J.prototype, "readVersion", null), J = e([n("esri.layers.VoxelLayer")], J);
  431. var R = J;
  432. export {
  433. R as default
  434. };
  435. //# sourceMappingURL=VoxelLayer-VXHDUDBI.js.map