astro-viewer 3.0.0 → 3.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (110) hide show
  1. package/dist/astroviewer.cjs +2505 -1335
  2. package/dist/astroviewer.js +1 -1
  3. package/dist/astroviewer.min.js +1 -1
  4. package/lib-esm/AstroSphere.d.ts +26 -6
  5. package/lib-esm/AstroSphere.js +215 -18
  6. package/lib-esm/AstroViewer.d.ts +18 -5
  7. package/lib-esm/AstroViewer.js +47 -0
  8. package/lib-esm/Camera.js +24 -8
  9. package/lib-esm/Config.js +12 -0
  10. package/lib-esm/Global.js +12 -0
  11. package/lib-esm/index.d.ts +6 -4
  12. package/lib-esm/index.js +16 -3
  13. package/lib-esm/model/AbstractSkyEntity.js +12 -0
  14. package/lib-esm/model/AstroGL.js +12 -0
  15. package/lib-esm/model/ColorMaps.js +12 -0
  16. package/lib-esm/model/MetadataColumn.js +12 -0
  17. package/lib-esm/model/MetadataManager.js +12 -0
  18. package/lib-esm/model/Point.js +12 -0
  19. package/lib-esm/model/Point2D.js +12 -0
  20. package/lib-esm/model/Source.js +12 -0
  21. package/lib-esm/model/SphereFoV.d.ts +30 -0
  22. package/lib-esm/model/SphereFoV.js +195 -0
  23. package/lib-esm/model/catalogues/CatalogueGL.js +12 -0
  24. package/lib-esm/model/catalogues/CatalogueProps.js +13 -1
  25. package/lib-esm/model/earth/{wmts/WMTSAdapter.d.ts → WMTSAdapter.d.ts} +2 -1
  26. package/lib-esm/model/earth/{wmts/WMTSAdapter.js → WMTSAdapter.js} +12 -0
  27. package/lib-esm/model/earth/XYZAnchestorTile.d.ts +17 -0
  28. package/lib-esm/model/earth/XYZAnchestorTile.js +87 -0
  29. package/lib-esm/model/earth/{types.d.ts → XYZConfig.d.ts} +2 -17
  30. package/lib-esm/model/earth/XYZConfig.js +13 -0
  31. package/lib-esm/model/earth/XYZFoVHelper.d.ts +9 -0
  32. package/lib-esm/model/earth/XYZFoVHelper.js +101 -0
  33. package/lib-esm/model/earth/XYZMap.d.ts +31 -0
  34. package/lib-esm/model/earth/XYZMap.js +208 -0
  35. package/lib-esm/model/earth/XYZMapDescriptor.d.ts +29 -0
  36. package/lib-esm/model/earth/XYZMapDescriptor.js +77 -0
  37. package/lib-esm/model/earth/XYZMeshBuilder.d.ts +1 -1
  38. package/lib-esm/model/earth/XYZMeshBuilder.js +13 -2
  39. package/lib-esm/model/earth/XYZTile.d.ts +20 -21
  40. package/lib-esm/model/earth/XYZTile.js +82 -102
  41. package/lib-esm/model/earth/XYZTileBuffer.d.ts +24 -26
  42. package/lib-esm/model/earth/XYZTileBuffer.js +60 -70
  43. package/lib-esm/model/earth/XYZTileRequestScheduler.d.ts +1 -1
  44. package/lib-esm/model/earth/XYZTileRequestScheduler.js +13 -2
  45. package/lib-esm/model/earth/XYZTypes.d.ts +24 -0
  46. package/lib-esm/model/earth/XYZTypes.js +13 -0
  47. package/lib-esm/model/earth/XYZVisibleTilesManager.d.ts +16 -27
  48. package/lib-esm/model/earth/XYZVisibleTilesManager.js +61 -192
  49. package/lib-esm/model/footprints/Footprint.js +12 -0
  50. package/lib-esm/model/footprints/FootprintProps.js +13 -1
  51. package/lib-esm/model/footprints/FootprintSetGL.js +12 -0
  52. package/lib-esm/model/grid/EquatorialGrid.js +20 -6
  53. package/lib-esm/model/grid/GridTextHelper.d.ts +10 -19
  54. package/lib-esm/model/grid/GridTextHelper.js +70 -67
  55. package/lib-esm/model/grid/HealpixGrid.d.ts +4 -4
  56. package/lib-esm/model/grid/HealpixGrid.js +19 -6
  57. package/lib-esm/model/grid/LonLatGrid.d.ts +40 -0
  58. package/lib-esm/model/grid/LonLatGrid.js +258 -0
  59. package/lib-esm/model/hips/AllSky.js +12 -0
  60. package/lib-esm/model/hips/AncestorTile.js +12 -0
  61. package/lib-esm/model/hips/FoVHelper.js +12 -0
  62. package/lib-esm/model/hips/HiPS.js +12 -9
  63. package/lib-esm/model/hips/HiPSDescriptor.js +12 -0
  64. package/lib-esm/model/hips/Tile.js +12 -0
  65. package/lib-esm/model/hips/TileBuffer.js +12 -0
  66. package/lib-esm/model/hips/VisibleTilesManager.js +12 -0
  67. package/lib-esm/model/tap/TapMetadata.js +12 -0
  68. package/lib-esm/model/tap/TapMetadataList.js +12 -0
  69. package/lib-esm/model/tap/TapRepo.js +12 -0
  70. package/lib-esm/model/terra/TerraFootprintSetGL.js +12 -0
  71. package/lib-esm/model/terra/TerraPointSetGL.js +12 -0
  72. package/lib-esm/services/SesameService.js +11 -3
  73. package/lib-esm/services/helpers.js +12 -0
  74. package/lib-esm/services/hipsNodeService.js +12 -0
  75. package/lib-esm/services/parse-hipslist.js +12 -0
  76. package/lib-esm/services/queryCatalogueByFoV.js +13 -1
  77. package/lib-esm/services/queryFootprintSetByFov.js +13 -1
  78. package/lib-esm/services/tapRepoService.js +13 -1
  79. package/lib-esm/services/types.js +12 -0
  80. package/lib-esm/shader/CatalogueShaderProgram.js +12 -0
  81. package/lib-esm/shader/FootprintShaderProgram.js +12 -0
  82. package/lib-esm/shader/GridShaderManager.js +12 -0
  83. package/lib-esm/shader/HiPSShaderProgram.js +12 -0
  84. package/lib-esm/shader/ShaderManager.js +12 -1
  85. package/lib-esm/shader/ShaderManagerMutliHiPS.js +12 -1
  86. package/lib-esm/shader/XYZShaderProgram.d.ts +14 -1
  87. package/lib-esm/shader/XYZShaderProgram.js +127 -2
  88. package/lib-esm/utils/CoordsType.js +12 -0
  89. package/lib-esm/utils/FoVUtils.js +12 -0
  90. package/lib-esm/utils/GeomUtils.js +12 -0
  91. package/lib-esm/utils/MouseHelper.js +12 -0
  92. package/lib-esm/utils/PerspectiveMatrixManager.js +12 -0
  93. package/lib-esm/utils/RayPickingUtils.js +12 -0
  94. package/lib-esm/utils/STCSParser.js +12 -0
  95. package/lib-esm/utils/ShaderUtility.js +13 -1
  96. package/lib-esm/utils/Utils.js +12 -0
  97. package/lib-esm/utils/XYZRayPickingUtils.d.ts +27 -0
  98. package/lib-esm/utils/XYZRayPickingUtils.js +226 -0
  99. package/package.json +1 -1
  100. package/lib-esm/model/FoV.d.ts +0 -62
  101. package/lib-esm/model/FoV.js +0 -274
  102. package/lib-esm/model/earth/XYZAncestorMeshCache.d.ts +0 -10
  103. package/lib-esm/model/earth/XYZAncestorMeshCache.js +0 -31
  104. package/lib-esm/model/earth/XYZLayer.d.ts +0 -31
  105. package/lib-esm/model/earth/XYZLayer.js +0 -231
  106. package/lib-esm/model/earth/XYZTileProvider.d.ts +0 -29
  107. package/lib-esm/model/earth/XYZTileProvider.js +0 -187
  108. package/lib-esm/model/earth/types.js +0 -1
  109. package/lib-esm/model/earth/wmts/types.d.ts +0 -1
  110. package/lib-esm/model/earth/wmts/types.js +0 -1
@@ -1,9 +1,21 @@
1
+ /*
2
+ * AstroViewer
3
+ * Copyright (C) Fabrizio Giordano
4
+ * SPDX-License-Identifier: LicenseRef-AstroViewer-Dual-License
5
+ *
6
+ * This file is part of AstroViewer.
7
+ * AstroViewer is distributed under a dual-license model.
8
+ * Commercial use requires a separate commercial license.
9
+ * Non-commercial use is governed by LICENSE-NONCOMMERCIAL.md.
10
+ *
11
+ * See LICENSE.md, LICENSE-COMMERCIAL.md, and LICENSE-NONCOMMERCIAL.md for details.
12
+ */
13
+ export {};
1
14
  // // addTAPRepo.ts
2
15
  // import { TapRepo } from '../model/tap/TapRepo.js'
3
16
  // import {TapMetadata} from '../model/tap/TapMetadata.js'
4
17
  // import {TapMetadataList} from '../model/tap/TapMetadataList.js'
5
18
  // import global from '../Global.js'
6
- export {};
7
19
  // import {CatalogueGL} from '../model/catalogues/CatalogueGL.js'
8
20
  // import {FootprintSetGL} from '../model/footprints/FootprintSetGL.js'
9
21
  // let catId = 1
@@ -1 +1,13 @@
1
+ /*
2
+ * AstroViewer
3
+ * Copyright (C) Fabrizio Giordano
4
+ * SPDX-License-Identifier: LicenseRef-AstroViewer-Dual-License
5
+ *
6
+ * This file is part of AstroViewer.
7
+ * AstroViewer is distributed under a dual-license model.
8
+ * Commercial use requires a separate commercial license.
9
+ * Non-commercial use is governed by LICENSE-NONCOMMERCIAL.md.
10
+ *
11
+ * See LICENSE.md, LICENSE-COMMERCIAL.md, and LICENSE-NONCOMMERCIAL.md for details.
12
+ */
1
13
  export {};
@@ -1,3 +1,15 @@
1
+ /*
2
+ * AstroViewer
3
+ * Copyright (C) Fabrizio Giordano
4
+ * SPDX-License-Identifier: LicenseRef-AstroViewer-Dual-License
5
+ *
6
+ * This file is part of AstroViewer.
7
+ * AstroViewer is distributed under a dual-license model.
8
+ * Commercial use requires a separate commercial license.
9
+ * Non-commercial use is governed by LICENSE-NONCOMMERCIAL.md.
10
+ *
11
+ * See LICENSE.md, LICENSE-COMMERCIAL.md, and LICENSE-NONCOMMERCIAL.md for details.
12
+ */
1
13
  // HiPSShaderProgram.ts
2
14
  import { mat4 } from 'gl-matrix';
3
15
  import ShaderManager from './ShaderManager.js';
@@ -1,3 +1,15 @@
1
+ /*
2
+ * AstroViewer
3
+ * Copyright (C) Fabrizio Giordano
4
+ * SPDX-License-Identifier: LicenseRef-AstroViewer-Dual-License
5
+ *
6
+ * This file is part of AstroViewer.
7
+ * AstroViewer is distributed under a dual-license model.
8
+ * Commercial use requires a separate commercial license.
9
+ * Non-commercial use is governed by LICENSE-NONCOMMERCIAL.md.
10
+ *
11
+ * See LICENSE.md, LICENSE-COMMERCIAL.md, and LICENSE-NONCOMMERCIAL.md for details.
12
+ */
1
13
  // HiPSShaderProgram.ts
2
14
  import { mat4 } from 'gl-matrix';
3
15
  import ShaderManager from './ShaderManager.js';
@@ -1,3 +1,15 @@
1
+ /*
2
+ * AstroViewer
3
+ * Copyright (C) Fabrizio Giordano
4
+ * SPDX-License-Identifier: LicenseRef-AstroViewer-Dual-License
5
+ *
6
+ * This file is part of AstroViewer.
7
+ * AstroViewer is distributed under a dual-license model.
8
+ * Commercial use requires a separate commercial license.
9
+ * Non-commercial use is governed by LICENSE-NONCOMMERCIAL.md.
10
+ *
11
+ * See LICENSE.md, LICENSE-COMMERCIAL.md, and LICENSE-NONCOMMERCIAL.md for details.
12
+ */
1
13
  // GridShaderManager.ts
2
14
  'use strict';
3
15
  class GridShaderManager {
@@ -1,3 +1,15 @@
1
+ /*
2
+ * AstroViewer
3
+ * Copyright (C) Fabrizio Giordano
4
+ * SPDX-License-Identifier: LicenseRef-AstroViewer-Dual-License
5
+ *
6
+ * This file is part of AstroViewer.
7
+ * AstroViewer is distributed under a dual-license model.
8
+ * Commercial use requires a separate commercial license.
9
+ * Non-commercial use is governed by LICENSE-NONCOMMERCIAL.md.
10
+ *
11
+ * See LICENSE.md, LICENSE-COMMERCIAL.md, and LICENSE-NONCOMMERCIAL.md for details.
12
+ */
1
13
  // HiPSShaderProgram.ts
2
14
  import ShaderManager from './ShaderManager.js';
3
15
  import { ColorMaps } from '../model/ColorMaps.js';
@@ -1,4 +1,15 @@
1
- // ShaderManager.ts
1
+ /*
2
+ * AstroViewer
3
+ * Copyright (C) Fabrizio Giordano
4
+ * SPDX-License-Identifier: LicenseRef-AstroViewer-Dual-License
5
+ *
6
+ * This file is part of AstroViewer.
7
+ * AstroViewer is distributed under a dual-license model.
8
+ * Commercial use requires a separate commercial license.
9
+ * Non-commercial use is governed by LICENSE-NONCOMMERCIAL.md.
10
+ *
11
+ * See LICENSE.md, LICENSE-COMMERCIAL.md, and LICENSE-NONCOMMERCIAL.md for details.
12
+ */
2
13
  export default class ShaderManager {
3
14
  static catalogueVS() {
4
15
  return `#version 300 es
@@ -1,4 +1,15 @@
1
- // ShaderManagerMultiHiPS.ts
1
+ /*
2
+ * AstroViewer
3
+ * Copyright (C) Fabrizio Giordano
4
+ * SPDX-License-Identifier: LicenseRef-AstroViewer-Dual-License
5
+ *
6
+ * This file is part of AstroViewer.
7
+ * AstroViewer is distributed under a dual-license model.
8
+ * Commercial use requires a separate commercial license.
9
+ * Non-commercial use is governed by LICENSE-NONCOMMERCIAL.md.
10
+ *
11
+ * See LICENSE.md, LICENSE-COMMERCIAL.md, and LICENSE-NONCOMMERCIAL.md for details.
12
+ */
2
13
  export default class ShaderManagerMultiHiPS {
3
14
  static hipsVS() {
4
15
  return `#version 300 es
@@ -3,6 +3,7 @@ type XYZLocations = {
3
3
  mMatrix: WebGLUniformLocation | null;
4
4
  vMatrix: WebGLUniformLocation | null;
5
5
  sampler: WebGLUniformLocation | null;
6
+ colorMapIdx: WebGLUniformLocation | null;
6
7
  vertexPositionAttribute: number;
7
8
  textureCoordAttribute: number;
8
9
  };
@@ -10,11 +11,23 @@ export declare class XYZShaderProgram {
10
11
  readonly locations: XYZLocations;
11
12
  private _webgl;
12
13
  private _shaderProgram?;
14
+ private _colorMapBlockIndex;
15
+ private _colorMapBuffer;
16
+ private _runtimeColorMap;
17
+ private _colorMapVariableInfo;
13
18
  constructor(webgl: WebGL2RenderingContext);
14
19
  get shaderProgram(): WebGLProgram;
15
20
  enableProgram(): void;
16
- enableShaders(pMatrix: Float32Array, vMatrix: Float32Array, mMatrix: Float32Array): void;
21
+ setRuntimeColorMap(colorMap: {
22
+ r: Float32Array;
23
+ g: Float32Array;
24
+ b: Float32Array;
25
+ } | undefined): void;
26
+ enableShaders(pMatrix: Float32Array, vMatrix: Float32Array, mMatrix: Float32Array, colorMapIdx?: number): void;
17
27
  private initShaders;
18
28
  private compileShader;
29
+ private initColorMapBuffer;
30
+ private uploadColorMap;
31
+ private getColorMap;
19
32
  }
20
33
  export {};
@@ -1,7 +1,28 @@
1
+ /*
2
+ * AstroViewer
3
+ * Copyright (C) Fabrizio Giordano
4
+ * SPDX-License-Identifier: LicenseRef-AstroViewer-Dual-License
5
+ *
6
+ * This file is part of AstroViewer.
7
+ * AstroViewer is distributed under a dual-license model.
8
+ * Commercial use requires a separate commercial license.
9
+ * Non-commercial use is governed by LICENSE-NONCOMMERCIAL.md.
10
+ *
11
+ * See LICENSE.md, LICENSE-COMMERCIAL.md, and LICENSE-NONCOMMERCIAL.md for details.
12
+ */
13
+ import { ColorMaps } from '../model/ColorMaps.js';
1
14
  export class XYZShaderProgram {
2
15
  locations;
3
16
  _webgl;
4
17
  _shaderProgram;
18
+ _colorMapBlockIndex = null;
19
+ _colorMapBuffer = null;
20
+ _runtimeColorMap;
21
+ _colorMapVariableInfo = {
22
+ r_palette: { index: 0, offset: 0 },
23
+ g_palette: { index: 0, offset: 0 },
24
+ b_palette: { index: 0, offset: 0 },
25
+ };
5
26
  constructor(webgl) {
6
27
  this._webgl = webgl;
7
28
  this.locations = {
@@ -9,6 +30,7 @@ export class XYZShaderProgram {
9
30
  mMatrix: null,
10
31
  vMatrix: null,
11
32
  sampler: null,
33
+ colorMapIdx: null,
12
34
  vertexPositionAttribute: -1,
13
35
  textureCoordAttribute: -1,
14
36
  };
@@ -29,7 +51,10 @@ export class XYZShaderProgram {
29
51
  enableProgram() {
30
52
  this._webgl.useProgram(this.shaderProgram);
31
53
  }
32
- enableShaders(pMatrix, vMatrix, mMatrix) {
54
+ setRuntimeColorMap(colorMap) {
55
+ this._runtimeColorMap = colorMap;
56
+ }
57
+ enableShaders(pMatrix, vMatrix, mMatrix, colorMapIdx = 0) {
33
58
  const gl = this._webgl;
34
59
  const program = this.shaderProgram;
35
60
  gl.useProgram(program);
@@ -37,12 +62,17 @@ export class XYZShaderProgram {
37
62
  this.locations.mMatrix = gl.getUniformLocation(program, 'uMMatrix');
38
63
  this.locations.vMatrix = gl.getUniformLocation(program, 'uVMatrix');
39
64
  this.locations.sampler = gl.getUniformLocation(program, 'uSampler');
65
+ this.locations.colorMapIdx = gl.getUniformLocation(program, 'cmapIdx');
40
66
  this.locations.vertexPositionAttribute = gl.getAttribLocation(program, 'aVertexPosition');
41
67
  this.locations.textureCoordAttribute = gl.getAttribLocation(program, 'aTextureCoord');
42
68
  gl.uniformMatrix4fv(this.locations.pMatrix, false, pMatrix);
43
69
  gl.uniformMatrix4fv(this.locations.vMatrix, false, vMatrix);
44
70
  gl.uniformMatrix4fv(this.locations.mMatrix, false, mMatrix);
45
71
  gl.uniform1i(this.locations.sampler, 0);
72
+ gl.uniform1i(this.locations.colorMapIdx, colorMapIdx);
73
+ if (colorMapIdx >= 2) {
74
+ this.uploadColorMap(colorMapIdx);
75
+ }
46
76
  }
47
77
  initShaders() {
48
78
  const gl = this._webgl;
@@ -61,9 +91,40 @@ export class XYZShaderProgram {
61
91
  precision mediump float;
62
92
  in vec2 vTextureCoord;
63
93
  uniform sampler2D uSampler;
94
+ uniform int cmapIdx;
95
+
96
+ layout (std140) uniform colormap {
97
+ float r_palette[256];
98
+ float g_palette[256];
99
+ float b_palette[256];
100
+ };
101
+
64
102
  out vec4 outColor;
103
+
65
104
  void main(void) {
66
- outColor = texture(uSampler, vTextureCoord);
105
+ vec4 color = texture(uSampler, vTextureCoord);
106
+
107
+ if (cmapIdx == 1) {
108
+ float gray = 0.21 * color.r + 0.71 * color.g + 0.07 * color.b;
109
+ outColor = vec4(vec3(gray), color.a);
110
+ return;
111
+ }
112
+
113
+ if (cmapIdx >= 2) {
114
+ int rIndex = int(clamp(color.r * 255.0, 0.0, 255.0));
115
+ int gIndex = int(clamp(color.g * 255.0, 0.0, 255.0));
116
+ int bIndex = int(clamp(color.b * 255.0, 0.0, 255.0));
117
+
118
+ outColor = vec4(
119
+ r_palette[rIndex] / 256.0,
120
+ g_palette[gIndex] / 256.0,
121
+ b_palette[bIndex] / 256.0,
122
+ color.a
123
+ );
124
+ return;
125
+ }
126
+
127
+ outColor = color;
67
128
  }`);
68
129
  gl.attachShader(this._shaderProgram, vertexShader);
69
130
  gl.attachShader(this._shaderProgram, fragmentShader);
@@ -71,6 +132,7 @@ export class XYZShaderProgram {
71
132
  if (!gl.getProgramParameter(this._shaderProgram, gl.LINK_STATUS)) {
72
133
  throw new Error(gl.getProgramInfoLog(this._shaderProgram) || 'Could not initialise XYZ shaders');
73
134
  }
135
+ this.initColorMapBuffer();
74
136
  }
75
137
  compileShader(type, source) {
76
138
  const gl = this._webgl;
@@ -85,4 +147,67 @@ export class XYZShaderProgram {
85
147
  }
86
148
  return shader;
87
149
  }
150
+ initColorMapBuffer() {
151
+ const gl = this._webgl;
152
+ const program = this._shaderProgram;
153
+ const blockIndex = gl.getUniformBlockIndex(program, 'colormap');
154
+ if (blockIndex === gl.INVALID_INDEX) {
155
+ this._colorMapBlockIndex = null;
156
+ return;
157
+ }
158
+ this._colorMapBlockIndex = blockIndex;
159
+ const variableNames = ['r_palette', 'g_palette', 'b_palette'];
160
+ const variableIndices = gl.getUniformIndices(program, variableNames);
161
+ const variableOffsets = gl.getActiveUniforms(program, variableIndices, gl.UNIFORM_OFFSET);
162
+ variableNames.forEach((name, index) => {
163
+ this._colorMapVariableInfo[name] = {
164
+ index: variableIndices[index],
165
+ offset: variableOffsets[index],
166
+ };
167
+ });
168
+ this._colorMapBuffer = gl.createBuffer();
169
+ gl.bindBuffer(gl.UNIFORM_BUFFER, this._colorMapBuffer);
170
+ gl.bufferData(gl.UNIFORM_BUFFER, 3 * 4096, gl.STATIC_DRAW);
171
+ gl.bindBuffer(gl.UNIFORM_BUFFER, null);
172
+ gl.bindBufferBase(gl.UNIFORM_BUFFER, 0, this._colorMapBuffer);
173
+ gl.uniformBlockBinding(program, blockIndex, 0);
174
+ }
175
+ uploadColorMap(colorMapIdx) {
176
+ if (!this._colorMapBuffer || this._colorMapBlockIndex === null) {
177
+ return;
178
+ }
179
+ const colorMap = this.getColorMap(colorMapIdx);
180
+ if (!colorMap) {
181
+ return;
182
+ }
183
+ const gl = this._webgl;
184
+ const program = this.shaderProgram;
185
+ gl.uniformBlockBinding(program, this._colorMapBlockIndex, 0);
186
+ gl.bindBuffer(gl.UNIFORM_BUFFER, this._colorMapBuffer);
187
+ const info = this._colorMapVariableInfo;
188
+ gl.bufferSubData(gl.UNIFORM_BUFFER, info.r_palette.offset, colorMap.r, 0);
189
+ gl.bufferSubData(gl.UNIFORM_BUFFER, info.g_palette.offset, colorMap.g, 0);
190
+ gl.bufferSubData(gl.UNIFORM_BUFFER, info.b_palette.offset, colorMap.b, 0);
191
+ gl.bindBuffer(gl.UNIFORM_BUFFER, null);
192
+ }
193
+ getColorMap(colorMapIdx) {
194
+ switch (colorMapIdx) {
195
+ case 2:
196
+ return ColorMaps.planck;
197
+ case 3:
198
+ return ColorMaps.cmb;
199
+ case 4:
200
+ return ColorMaps.rainbow;
201
+ case 5:
202
+ return ColorMaps.eosb;
203
+ case 6:
204
+ return ColorMaps.cubehelix;
205
+ case 7:
206
+ return ColorMaps.hot;
207
+ case 8:
208
+ return ColorMaps.gray;
209
+ default:
210
+ return this._runtimeColorMap;
211
+ }
212
+ }
88
213
  }
@@ -1,3 +1,15 @@
1
+ /*
2
+ * AstroViewer
3
+ * Copyright (C) Fabrizio Giordano
4
+ * SPDX-License-Identifier: LicenseRef-AstroViewer-Dual-License
5
+ *
6
+ * This file is part of AstroViewer.
7
+ * AstroViewer is distributed under a dual-license model.
8
+ * Commercial use requires a separate commercial license.
9
+ * Non-commercial use is governed by LICENSE-NONCOMMERCIAL.md.
10
+ *
11
+ * See LICENSE.md, LICENSE-COMMERCIAL.md, and LICENSE-NONCOMMERCIAL.md for details.
12
+ */
1
13
  /**
2
14
  * Enum for coordinate types.
3
15
  * @author Fabrizio Giordano (Fab77)
@@ -1,3 +1,15 @@
1
+ /*
2
+ * AstroViewer
3
+ * Copyright (C) Fabrizio Giordano
4
+ * SPDX-License-Identifier: LicenseRef-AstroViewer-Dual-License
5
+ *
6
+ * This file is part of AstroViewer.
7
+ * AstroViewer is distributed under a dual-license model.
8
+ * Commercial use requires a separate commercial license.
9
+ * Non-commercial use is governed by LICENSE-NONCOMMERCIAL.md.
10
+ *
11
+ * See LICENSE.md, LICENSE-COMMERCIAL.md, and LICENSE-NONCOMMERCIAL.md for details.
12
+ */
1
13
  'use strict';
2
14
  /**
3
15
  * @author Fabrizio Giordano (Fab)
@@ -1,3 +1,15 @@
1
+ /*
2
+ * AstroViewer
3
+ * Copyright (C) Fabrizio Giordano
4
+ * SPDX-License-Identifier: LicenseRef-AstroViewer-Dual-License
5
+ *
6
+ * This file is part of AstroViewer.
7
+ * AstroViewer is distributed under a dual-license model.
8
+ * Commercial use requires a separate commercial license.
9
+ * Non-commercial use is governed by LICENSE-NONCOMMERCIAL.md.
10
+ *
11
+ * See LICENSE.md, LICENSE-COMMERCIAL.md, and LICENSE-NONCOMMERCIAL.md for details.
12
+ */
1
13
  import { Point } from "../model/Point.js";
2
14
  import Point2D from "../model/Point2D.js";
3
15
  import { CoordsType } from "./CoordsType.js";
@@ -1,3 +1,15 @@
1
+ /*
2
+ * AstroViewer
3
+ * Copyright (C) Fabrizio Giordano
4
+ * SPDX-License-Identifier: LicenseRef-AstroViewer-Dual-License
5
+ *
6
+ * This file is part of AstroViewer.
7
+ * AstroViewer is distributed under a dual-license model.
8
+ * Commercial use requires a separate commercial license.
9
+ * Non-commercial use is governed by LICENSE-NONCOMMERCIAL.md.
10
+ *
11
+ * See LICENSE.md, LICENSE-COMMERCIAL.md, and LICENSE-NONCOMMERCIAL.md for details.
12
+ */
1
13
  /**
2
14
  * @author Fabrizio Giordano (Fab)
3
15
  */
@@ -1,3 +1,15 @@
1
+ /*
2
+ * AstroViewer
3
+ * Copyright (C) Fabrizio Giordano
4
+ * SPDX-License-Identifier: LicenseRef-AstroViewer-Dual-License
5
+ *
6
+ * This file is part of AstroViewer.
7
+ * AstroViewer is distributed under a dual-license model.
8
+ * Commercial use requires a separate commercial license.
9
+ * Non-commercial use is governed by LICENSE-NONCOMMERCIAL.md.
10
+ *
11
+ * See LICENSE.md, LICENSE-COMMERCIAL.md, and LICENSE-NONCOMMERCIAL.md for details.
12
+ */
1
13
  import { mat4 } from "gl-matrix";
2
14
  export class PerspectiveMatrixManager {
3
15
  _pMatrix;
@@ -1,3 +1,15 @@
1
+ /*
2
+ * AstroViewer
3
+ * Copyright (C) Fabrizio Giordano
4
+ * SPDX-License-Identifier: LicenseRef-AstroViewer-Dual-License
5
+ *
6
+ * This file is part of AstroViewer.
7
+ * AstroViewer is distributed under a dual-license model.
8
+ * Commercial use requires a separate commercial license.
9
+ * Non-commercial use is governed by LICENSE-NONCOMMERCIAL.md.
10
+ *
11
+ * See LICENSE.md, LICENSE-COMMERCIAL.md, and LICENSE-NONCOMMERCIAL.md for details.
12
+ */
1
13
  /**
2
14
  * @author Fabrizio Giordano (Fab)
3
15
  */
@@ -1,3 +1,15 @@
1
+ /*
2
+ * AstroViewer
3
+ * Copyright (C) Fabrizio Giordano
4
+ * SPDX-License-Identifier: LicenseRef-AstroViewer-Dual-License
5
+ *
6
+ * This file is part of AstroViewer.
7
+ * AstroViewer is distributed under a dual-license model.
8
+ * Commercial use requires a separate commercial license.
9
+ * Non-commercial use is governed by LICENSE-NONCOMMERCIAL.md.
10
+ *
11
+ * See LICENSE.md, LICENSE-COMMERCIAL.md, and LICENSE-NONCOMMERCIAL.md for details.
12
+ */
1
13
  /**
2
14
  * @author Fabrizio Giordano (Fab77)
3
15
  */
@@ -1,6 +1,18 @@
1
+ /*
2
+ * AstroViewer
3
+ * Copyright (C) Fabrizio Giordano
4
+ * SPDX-License-Identifier: LicenseRef-AstroViewer-Dual-License
5
+ *
6
+ * This file is part of AstroViewer.
7
+ * AstroViewer is distributed under a dual-license model.
8
+ * Commercial use requires a separate commercial license.
9
+ * Non-commercial use is governed by LICENSE-NONCOMMERCIAL.md.
10
+ *
11
+ * See LICENSE.md, LICENSE-COMMERCIAL.md, and LICENSE-NONCOMMERCIAL.md for details.
12
+ */
13
+ export {};
1
14
  // import global from "../Global.js";
2
15
  // // import ShaderManager from "../shader/ShaderManager.js";
3
- export {};
4
16
  // // type GL = WebGLRenderingContext | WebGL2RenderingContext;
5
17
  // class ShaderUtility {
6
18
  // private lastUsedProgram: WebGLProgram | null = null;
@@ -1,3 +1,15 @@
1
+ /*
2
+ * AstroViewer
3
+ * Copyright (C) Fabrizio Giordano
4
+ * SPDX-License-Identifier: LicenseRef-AstroViewer-Dual-License
5
+ *
6
+ * This file is part of AstroViewer.
7
+ * AstroViewer is distributed under a dual-license model.
8
+ * Commercial use requires a separate commercial license.
9
+ * Non-commercial use is governed by LICENSE-NONCOMMERCIAL.md.
10
+ *
11
+ * See LICENSE.md, LICENSE-COMMERCIAL.md, and LICENSE-NONCOMMERCIAL.md for details.
12
+ */
1
13
  /**
2
14
  * @author Fabrizio Giordano (Fab)
3
15
  */
@@ -0,0 +1,27 @@
1
+ import { ReadonlyMat4, ReadonlyVec3, vec3 } from 'gl-matrix';
2
+ import Camera from '../Camera.js';
3
+ import { AbstractSkyEntity } from '../model/AbstractSkyEntity.js';
4
+ import type { XYZTileCoord } from '../model/earth/XYZTypes.js';
5
+ export type XYZLonLat = {
6
+ lonDeg: number;
7
+ latDeg: number;
8
+ };
9
+ declare class XYZRayPickingUtils {
10
+ static getRayFromMouse(mouseX: number, mouseY: number, pMatrix: ReadonlyMat4, webgl: WebGL2RenderingContext, vMatrix: ReadonlyMat4): vec3;
11
+ static raySphere(rayOrigWorld: ReadonlyVec3, rayDirectionWorld: ReadonlyVec3, sphere: Pick<AbstractSkyEntity, 'center' | 'radius'>): number;
12
+ static getIntersectionPointWithModel(mouseX: number, mouseY: number, xyzModel: AbstractSkyEntity, webgl: WebGL2RenderingContext, camera: Camera, pMatrix: ReadonlyMat4): [number, number, number] | null;
13
+ static getLonLatFromMouse(mouseX: number, mouseY: number, xyzModel: AbstractSkyEntity, webgl: WebGL2RenderingContext, camera: Camera, pMatrix: ReadonlyMat4): XYZLonLat | null;
14
+ static getTileFromMouse(mouseX: number, mouseY: number, z: number, xyzModel: AbstractSkyEntity, webgl: WebGL2RenderingContext, camera: Camera, pMatrix: ReadonlyMat4): XYZTileCoord | null;
15
+ static getVisibleTilesFromViewport(z: number, xyzModel: AbstractSkyEntity, webgl: WebGL2RenderingContext, camera: Camera, pMatrix: ReadonlyMat4, sampleCount?: number, padding?: number): XYZTileCoord[];
16
+ static modelPointToLonLat(point: Readonly<[number, number, number]>): XYZLonLat;
17
+ static lonLatToTile(lonDeg: number, latDeg: number, z: number): XYZTileCoord;
18
+ static getNeighborTiles(tile: XYZTileCoord, ring?: number): XYZTileCoord[];
19
+ static deduplicateTiles(tiles: XYZTileCoord[]): XYZTileCoord[];
20
+ private static fillSmallTileGaps;
21
+ private static latToTileY;
22
+ private static isMercatorLatitude;
23
+ private static wrapTileX;
24
+ private static clampTileY;
25
+ private static mat4MultiplyVec4;
26
+ }
27
+ export default XYZRayPickingUtils;