astro-viewer 3.9.0 → 3.10.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.
- package/dist/astroviewer.cjs +183 -112
- package/dist/astroviewer.cjs.map +1 -1
- package/dist/astroviewer.js +183 -112
- package/dist/astroviewer.js.map +1 -1
- package/dist/astroviewer.min.js +1 -1
- package/dist/astroviewer.min.js.map +1 -1
- package/lib-esm/AstroViewer.d.ts.map +1 -1
- package/lib-esm/AstroViewer.js +3 -3
- package/lib-esm/AstroViewer.js.map +1 -1
- package/lib-esm/Global.d.ts +3 -3
- package/lib-esm/Global.d.ts.map +1 -1
- package/lib-esm/Global.js +38 -16
- package/lib-esm/Global.js.map +1 -1
- package/lib-esm/model/Source.d.ts.map +1 -1
- package/lib-esm/model/Source.js +2 -1
- package/lib-esm/model/Source.js.map +1 -1
- package/lib-esm/model/catalogues/CatalogueGL.d.ts +8 -7
- package/lib-esm/model/catalogues/CatalogueGL.d.ts.map +1 -1
- package/lib-esm/model/catalogues/CatalogueGL.js +63 -86
- package/lib-esm/model/catalogues/CatalogueGL.js.map +1 -1
- package/lib-esm/model/footprints/FootprintSetGL.d.ts +1 -3
- package/lib-esm/model/footprints/FootprintSetGL.d.ts.map +1 -1
- package/lib-esm/model/footprints/FootprintSetGL.js +1 -3
- package/lib-esm/model/footprints/FootprintSetGL.js.map +1 -1
- package/lib-esm/model/hips/VisibleTilesManager.d.ts +6 -3
- package/lib-esm/model/hips/VisibleTilesManager.d.ts.map +1 -1
- package/lib-esm/model/hips/VisibleTilesManager.js.map +1 -1
- package/lib-esm/model/meships/MeshHiPS.d.ts +4 -4
- package/lib-esm/model/meships/MeshHiPS.d.ts.map +1 -1
- package/lib-esm/model/meships/MeshHiPS.js +28 -12
- package/lib-esm/model/meships/MeshHiPS.js.map +1 -1
- package/lib-esm/model/terra/TerraFootprintSetGL.d.ts +2 -0
- package/lib-esm/model/terra/TerraFootprintSetGL.d.ts.map +1 -1
- package/lib-esm/model/terra/TerraFootprintSetGL.js +19 -0
- package/lib-esm/model/terra/TerraFootprintSetGL.js.map +1 -1
- package/lib-esm/model/terra/TerraPointSetGL.d.ts +4 -0
- package/lib-esm/model/terra/TerraPointSetGL.d.ts.map +1 -1
- package/lib-esm/model/terra/TerraPointSetGL.js +36 -0
- package/lib-esm/model/terra/TerraPointSetGL.js.map +1 -1
- package/lib-esm/model/terra/TerraPolylineSetGL.d.ts +1 -3
- package/lib-esm/model/terra/TerraPolylineSetGL.d.ts.map +1 -1
- package/lib-esm/model/terra/TerraPolylineSetGL.js +1 -3
- package/lib-esm/model/terra/TerraPolylineSetGL.js.map +1 -1
- package/lib-esm/utils/MouseHelper.d.ts.map +1 -1
- package/lib-esm/utils/MouseHelper.js +2 -1
- package/lib-esm/utils/MouseHelper.js.map +1 -1
- package/package.json +1 -1
package/dist/astroviewer.cjs
CHANGED
|
@@ -4826,7 +4826,7 @@ class AstroViewer {
|
|
|
4826
4826
|
}
|
|
4827
4827
|
//FOOTPRINT
|
|
4828
4828
|
createFootprintSet(footprintSetName, footprintSetDescription, providerUrl, metadataManager) {
|
|
4829
|
-
return new FootprintSetGL_js_1.FootprintSetGL(footprintSetName, footprintSetDescription, providerUrl, metadataManager, this.webgl
|
|
4829
|
+
return new FootprintSetGL_js_1.FootprintSetGL(footprintSetName, footprintSetDescription, providerUrl, metadataManager, this.webgl);
|
|
4830
4830
|
}
|
|
4831
4831
|
showFootprintSet(footprintSet) {
|
|
4832
4832
|
this.astroSphere.showFootprintSet(footprintSet);
|
|
@@ -4851,7 +4851,7 @@ class AstroViewer {
|
|
|
4851
4851
|
this.astroSphere.deleteCatalogue(pointSet);
|
|
4852
4852
|
}
|
|
4853
4853
|
createTerraFootprintSet(footprintSetName, footprintSetDescription, providerUrl, metadataManager) {
|
|
4854
|
-
return new TerraFootprintSetGL_js_1.TerraFootprintSetGL(footprintSetName, footprintSetDescription, providerUrl, metadataManager, this.webgl
|
|
4854
|
+
return new TerraFootprintSetGL_js_1.TerraFootprintSetGL(footprintSetName, footprintSetDescription, providerUrl, metadataManager, this.webgl);
|
|
4855
4855
|
}
|
|
4856
4856
|
showTerraFootprintSet(footprintSet) {
|
|
4857
4857
|
this.astroSphere.showFootprintSet(footprintSet);
|
|
@@ -4863,7 +4863,7 @@ class AstroViewer {
|
|
|
4863
4863
|
this.astroSphere.deleteFootprintSet(footprintSet);
|
|
4864
4864
|
}
|
|
4865
4865
|
createTerraPolylineSet(polylineSetName, polylineSetDescription, providerUrl, metadataManager) {
|
|
4866
|
-
return new TerraPolylineSetGL_js_1.TerraPolylineSetGL(polylineSetName, polylineSetDescription, providerUrl, metadataManager, this.webgl
|
|
4866
|
+
return new TerraPolylineSetGL_js_1.TerraPolylineSetGL(polylineSetName, polylineSetDescription, providerUrl, metadataManager, this.webgl);
|
|
4867
4867
|
}
|
|
4868
4868
|
showTerraPolylineSet(polylineSet) {
|
|
4869
4869
|
this.astroSphere.showPolylineSet(polylineSet);
|
|
@@ -5762,7 +5762,7 @@ class Global {
|
|
|
5762
5762
|
// private _gl: GL | null;
|
|
5763
5763
|
_healpix;
|
|
5764
5764
|
// --- config/state flags ---
|
|
5765
|
-
_selectionnside;
|
|
5765
|
+
// private _selectionnside: number;
|
|
5766
5766
|
// private _healpix4footprints: boolean;
|
|
5767
5767
|
_useCORSProxy;
|
|
5768
5768
|
_corsProxyUrl;
|
|
@@ -5770,6 +5770,7 @@ class Global {
|
|
|
5770
5770
|
_debug;
|
|
5771
5771
|
_insideSphere;
|
|
5772
5772
|
_version;
|
|
5773
|
+
_selectionOrder;
|
|
5773
5774
|
constructor() {
|
|
5774
5775
|
this._useCORSProxy = Config_js_1.bootSetup.useCORSProxy;
|
|
5775
5776
|
this._corsProxyUrl = Config_js_1.bootSetup.corsProxyUrl;
|
|
@@ -5778,18 +5779,34 @@ class Global {
|
|
|
5778
5779
|
this._insideSphere = Config_js_1.bootSetup.insideView;
|
|
5779
5780
|
this._version = Config_js_1.bootSetup.version;
|
|
5780
5781
|
this._healpix = {};
|
|
5781
|
-
this._selectionnside = 32;
|
|
5782
|
+
// this._selectionnside = 32;
|
|
5783
|
+
this._selectionOrder = 5;
|
|
5784
|
+
}
|
|
5785
|
+
get selectionOrder() {
|
|
5786
|
+
return this._selectionOrder;
|
|
5782
5787
|
}
|
|
5783
5788
|
init() {
|
|
5784
|
-
console.log(
|
|
5789
|
+
console.log("Global.init()");
|
|
5785
5790
|
}
|
|
5786
5791
|
// --- getters/setters ---
|
|
5787
|
-
get version() {
|
|
5788
|
-
|
|
5789
|
-
|
|
5790
|
-
|
|
5791
|
-
|
|
5792
|
-
|
|
5792
|
+
get version() {
|
|
5793
|
+
return this._version;
|
|
5794
|
+
}
|
|
5795
|
+
set corsProxyUrl(url) {
|
|
5796
|
+
this._corsProxyUrl = url;
|
|
5797
|
+
}
|
|
5798
|
+
get corsProxyUrl() {
|
|
5799
|
+
return this._corsProxyUrl;
|
|
5800
|
+
}
|
|
5801
|
+
get useCORSProxy() {
|
|
5802
|
+
return this._useCORSProxy;
|
|
5803
|
+
}
|
|
5804
|
+
set useCORSProxy(enabled) {
|
|
5805
|
+
this._useCORSProxy = enabled;
|
|
5806
|
+
}
|
|
5807
|
+
get debug() {
|
|
5808
|
+
return this._debug;
|
|
5809
|
+
}
|
|
5793
5810
|
getHealpix(order) {
|
|
5794
5811
|
if (this._healpix[order] === undefined) {
|
|
5795
5812
|
// order is HEALPix "order" ⇒ nside = 2^order
|
|
@@ -5797,10 +5814,15 @@ class Global {
|
|
|
5797
5814
|
}
|
|
5798
5815
|
return this._healpix[order];
|
|
5799
5816
|
}
|
|
5800
|
-
get MAX_DECIMALS() {
|
|
5801
|
-
|
|
5802
|
-
|
|
5803
|
-
|
|
5817
|
+
get MAX_DECIMALS() {
|
|
5818
|
+
return this._maxDecimals;
|
|
5819
|
+
}
|
|
5820
|
+
set insideSphere(v) {
|
|
5821
|
+
this._insideSphere = v;
|
|
5822
|
+
}
|
|
5823
|
+
get insideSphere() {
|
|
5824
|
+
return this._insideSphere;
|
|
5825
|
+
}
|
|
5804
5826
|
}
|
|
5805
5827
|
const global = new Global();
|
|
5806
5828
|
exports["default"] = global;
|
|
@@ -7880,7 +7902,8 @@ class Source {
|
|
|
7880
7902
|
}
|
|
7881
7903
|
computeHealpixPixel() {
|
|
7882
7904
|
// Get Healpix instance from global
|
|
7883
|
-
const healpix =
|
|
7905
|
+
// const healpix: Healpix = global.getHealpix(global.nsideForSelection);
|
|
7906
|
+
const healpix = Global_js_1.default.getHealpix(Global_js_1.default.selectionOrder);
|
|
7884
7907
|
const vec3 = new healpix_1.Vec3(this._point.x, this._point.y, this._point.z);
|
|
7885
7908
|
const ptg = new healpix_1.Pointing(vec3, false);
|
|
7886
7909
|
this._h_pix = healpix.ang2pix(ptg, false);
|
|
@@ -8168,7 +8191,7 @@ class CatalogueGL {
|
|
|
8168
8191
|
_oldMouseCoords;
|
|
8169
8192
|
_metadataManager;
|
|
8170
8193
|
_isVisible = true;
|
|
8171
|
-
_shapeColor =
|
|
8194
|
+
_shapeColor = "#8F00FF";
|
|
8172
8195
|
_healpixDensityMap;
|
|
8173
8196
|
_providerUrl;
|
|
8174
8197
|
_catalogueShaderProgram;
|
|
@@ -8177,7 +8200,7 @@ class CatalogueGL {
|
|
|
8177
8200
|
this._webgl = webgl;
|
|
8178
8201
|
this._ready = false;
|
|
8179
8202
|
this._visibleTilesManager = visibleTilesManager;
|
|
8180
|
-
this.TYPE =
|
|
8203
|
+
this.TYPE = "SOURCE_CATALOGUE";
|
|
8181
8204
|
this._name = catalogueName;
|
|
8182
8205
|
this._description = catalogueDescription;
|
|
8183
8206
|
this._providerUrl = providerUrl;
|
|
@@ -8195,7 +8218,7 @@ class CatalogueGL {
|
|
|
8195
8218
|
this._oldMouseCoords = null;
|
|
8196
8219
|
this._healpixDensityMap = new Map();
|
|
8197
8220
|
// this.catalogueProps = new CatalogueProps(metadataManager, defaultColor);
|
|
8198
|
-
// call catalogueShaderProgram to init shaders if they are not yet initialised
|
|
8221
|
+
// call catalogueShaderProgram to init shaders if they are not yet initialised
|
|
8199
8222
|
this._catalogueShaderProgram = new CatalogueShaderProgram_js_1.CatalogueShaderProgram(this._webgl);
|
|
8200
8223
|
this._catalogueShaderProgram.shaderProgram;
|
|
8201
8224
|
// catalogueShaderProgram.shaderProgram
|
|
@@ -8240,7 +8263,7 @@ class CatalogueGL {
|
|
|
8240
8263
|
}
|
|
8241
8264
|
return {
|
|
8242
8265
|
min: Number(min),
|
|
8243
|
-
max: Number(max)
|
|
8266
|
+
max: Number(max),
|
|
8244
8267
|
};
|
|
8245
8268
|
}
|
|
8246
8269
|
get metadataManager() {
|
|
@@ -8289,7 +8312,7 @@ class CatalogueGL {
|
|
|
8289
8312
|
const raw = Number(source.getDetailByindex(idx));
|
|
8290
8313
|
const min = Number(minmax.min);
|
|
8291
8314
|
const max = Number(minmax.max);
|
|
8292
|
-
const norm = (raw - min) / Math.max(1e-12,
|
|
8315
|
+
const norm = (raw - min) / Math.max(1e-12, max - min);
|
|
8293
8316
|
const size = norm * (20 - 8) + 8;
|
|
8294
8317
|
source.shapeSize = size;
|
|
8295
8318
|
}
|
|
@@ -8326,7 +8349,7 @@ class CatalogueGL {
|
|
|
8326
8349
|
const raw = Number(source.getDetailByindex(idx));
|
|
8327
8350
|
const min = Number(minmax.min);
|
|
8328
8351
|
const max = Number(minmax.max);
|
|
8329
|
-
const norm = (raw - min) / Math.max(1e-12,
|
|
8352
|
+
const norm = (raw - min) / Math.max(1e-12, max - min);
|
|
8330
8353
|
// map [0,1] -> [1,-1]
|
|
8331
8354
|
source.brightnessFactor = -(norm * 2 - 1);
|
|
8332
8355
|
}
|
|
@@ -8356,7 +8379,7 @@ class CatalogueGL {
|
|
|
8356
8379
|
for (let j = 0; j < in_data.length; j++) {
|
|
8357
8380
|
const point = new Point_js_1.Point({
|
|
8358
8381
|
raDeg: in_data[j][raDataIndex],
|
|
8359
|
-
decDeg: in_data[j][decDataIndex]
|
|
8382
|
+
decDeg: in_data[j][decDataIndex],
|
|
8360
8383
|
}, CoordsType_js_1.CoordsType.ASTRO);
|
|
8361
8384
|
const source = new Source_js_1.Source(point, in_data[j]);
|
|
8362
8385
|
// Ensure optional fields exist
|
|
@@ -8427,7 +8450,8 @@ class CatalogueGL {
|
|
|
8427
8450
|
if (i >= 0) {
|
|
8428
8451
|
this.hoveredIndexes.splice(i, 1);
|
|
8429
8452
|
this.vertexCataloguePosition[base + 3] = 0.0; // not hovered
|
|
8430
|
-
this.vertexCataloguePosition[base + 4] =
|
|
8453
|
+
this.vertexCataloguePosition[base + 4] =
|
|
8454
|
+
this._sources[sIdx]?.shapeSize ?? CatalogueGL.STANDARD_SHAPE_SIZE;
|
|
8431
8455
|
}
|
|
8432
8456
|
}
|
|
8433
8457
|
}
|
|
@@ -8451,7 +8475,8 @@ class CatalogueGL {
|
|
|
8451
8475
|
if (i >= 0) {
|
|
8452
8476
|
this.selectedIndexes.splice(i, 1);
|
|
8453
8477
|
this.vertexCataloguePosition[base + 3] = 0.0; // not selected
|
|
8454
|
-
this.vertexCataloguePosition[base + 4] =
|
|
8478
|
+
this.vertexCataloguePosition[base + 4] =
|
|
8479
|
+
this._sources[sIdx]?.shapeSize ?? CatalogueGL.STANDARD_SHAPE_SIZE;
|
|
8455
8480
|
}
|
|
8456
8481
|
}
|
|
8457
8482
|
}
|
|
@@ -8482,9 +8507,11 @@ class CatalogueGL {
|
|
|
8482
8507
|
// hovered flag
|
|
8483
8508
|
this.vertexCataloguePosition[positionIndex + 3] = 0.0;
|
|
8484
8509
|
// size
|
|
8485
|
-
this.vertexCataloguePosition[positionIndex + 4] =
|
|
8510
|
+
this.vertexCataloguePosition[positionIndex + 4] =
|
|
8511
|
+
currSource.shapeSize ?? CatalogueGL.STANDARD_SHAPE_SIZE;
|
|
8486
8512
|
// brightness
|
|
8487
|
-
this.vertexCataloguePosition[positionIndex + 5] =
|
|
8513
|
+
this.vertexCataloguePosition[positionIndex + 5] =
|
|
8514
|
+
currSource.brightnessFactor ?? 0.0;
|
|
8488
8515
|
positionIndex += CatalogueGL.ELEM_SIZE;
|
|
8489
8516
|
}
|
|
8490
8517
|
this._webgl.bufferData(this._webgl.ARRAY_BUFFER, this.vertexCataloguePosition, this._webgl.STATIC_DRAW);
|
|
@@ -8518,50 +8545,8 @@ class CatalogueGL {
|
|
|
8518
8545
|
return 0.0001;
|
|
8519
8546
|
}
|
|
8520
8547
|
}
|
|
8521
|
-
checkClicking(in_mouseHelper) {
|
|
8522
|
-
if (in_mouseHelper.x == null || in_mouseHelper.y == null || in_mouseHelper.z == null) {
|
|
8523
|
-
console.log('CatalogueGL.checkClicking: missing mouse coords');
|
|
8524
|
-
return [];
|
|
8525
|
-
}
|
|
8526
|
-
const clickedIndexes = [];
|
|
8527
|
-
const mousePix = in_mouseHelper.computeNpix();
|
|
8528
|
-
if (mousePix != null && this._healpixDensityMap.has(mousePix)) {
|
|
8529
|
-
const candidates = this._healpixDensityMap.get(mousePix);
|
|
8530
|
-
const selR = this.getSelectionRadius();
|
|
8531
|
-
for (let i = 0; i < candidates.length; i++) {
|
|
8532
|
-
const sourceIdx = candidates[i];
|
|
8533
|
-
const source = this._sources[sourceIdx];
|
|
8534
|
-
if (!source)
|
|
8535
|
-
continue;
|
|
8536
|
-
const dx = source.point.x - in_mouseHelper.x;
|
|
8537
|
-
const dy = source.point.y - in_mouseHelper.y;
|
|
8538
|
-
const dz = source.point.z - in_mouseHelper.z;
|
|
8539
|
-
const dist = Math.sqrt(dx * dx + dy * dy + dz * dz);
|
|
8540
|
-
if (dist <= selR) {
|
|
8541
|
-
clickedIndexes.push(sourceIdx);
|
|
8542
|
-
}
|
|
8543
|
-
}
|
|
8544
|
-
}
|
|
8545
|
-
return clickedIndexes;
|
|
8546
|
-
}
|
|
8547
|
-
// private setSelectedIndexes(nextSelected: number[]) {
|
|
8548
|
-
// const deduped = Array.from(new Set(nextSelected))
|
|
8549
|
-
// .filter((idx) => idx >= 0 && idx < this._sources.length);
|
|
8550
|
-
// if (this.vertexCataloguePosition.length) {
|
|
8551
|
-
// for (const prevIdx of this.selectedIndexes) {
|
|
8552
|
-
// if (deduped.includes(prevIdx)) continue;
|
|
8553
|
-
// const base = prevIdx * CatalogueGL.ELEM_SIZE;
|
|
8554
|
-
// if (base + 4 >= this.vertexCataloguePosition.length) continue;
|
|
8555
|
-
// if (!this.hoveredIndexes.includes(prevIdx) && !this.extHoveredIndexes.includes(prevIdx)) {
|
|
8556
|
-
// this.vertexCataloguePosition[base + 3] = 0.0;
|
|
8557
|
-
// }
|
|
8558
|
-
// this.vertexCataloguePosition[base + 4] = this._sources[prevIdx]?.shapeSize ?? CatalogueGL.STANDARD_SHAPE_SIZE;
|
|
8559
|
-
// }
|
|
8560
|
-
// }
|
|
8561
|
-
// this.selectedIndexes = deduped;
|
|
8562
|
-
// }
|
|
8563
8548
|
setSelectedIndexes(selectedIndex) {
|
|
8564
|
-
selectedIndex.forEach(idx => {
|
|
8549
|
+
selectedIndex.forEach((idx) => {
|
|
8565
8550
|
if (idx < 0 || idx >= this._sources.length)
|
|
8566
8551
|
return;
|
|
8567
8552
|
const base = idx * CatalogueGL.ELEM_SIZE;
|
|
@@ -8570,12 +8555,14 @@ class CatalogueGL {
|
|
|
8570
8555
|
if (this.selectedIndexes.includes(idx)) {
|
|
8571
8556
|
this.selectedIndexes.splice(this.selectedIndexes.indexOf(idx), 1);
|
|
8572
8557
|
this.vertexCataloguePosition[base + 3] = 0.0; // not selected
|
|
8573
|
-
this.vertexCataloguePosition[base + 4] =
|
|
8558
|
+
this.vertexCataloguePosition[base + 4] =
|
|
8559
|
+
this._sources[idx]?.shapeSize ?? CatalogueGL.STANDARD_SHAPE_SIZE;
|
|
8574
8560
|
}
|
|
8575
8561
|
else {
|
|
8576
8562
|
this.selectedIndexes.push(idx);
|
|
8577
8563
|
this.vertexCataloguePosition[base + 3] = 2.0; // selected
|
|
8578
|
-
this.vertexCataloguePosition[base + 4] =
|
|
8564
|
+
this.vertexCataloguePosition[base + 4] =
|
|
8565
|
+
this._sources[idx]?.shapeSize ?? CatalogueGL.STANDARD_SHAPE_SIZE;
|
|
8579
8566
|
}
|
|
8580
8567
|
});
|
|
8581
8568
|
}
|
|
@@ -8592,7 +8579,7 @@ class CatalogueGL {
|
|
|
8592
8579
|
};
|
|
8593
8580
|
}
|
|
8594
8581
|
const sources = [];
|
|
8595
|
-
pickedIndexes.forEach(idx => {
|
|
8582
|
+
pickedIndexes.forEach((idx) => {
|
|
8596
8583
|
const source = this._sources[idx];
|
|
8597
8584
|
if (source)
|
|
8598
8585
|
sources.push(source);
|
|
@@ -8622,7 +8609,7 @@ class CatalogueGL {
|
|
|
8622
8609
|
}
|
|
8623
8610
|
const selectionState = [];
|
|
8624
8611
|
const selectedSources = [];
|
|
8625
|
-
clickedIndexes.forEach(idx => {
|
|
8612
|
+
clickedIndexes.forEach((idx) => {
|
|
8626
8613
|
const source = this._sources[idx];
|
|
8627
8614
|
if (!source)
|
|
8628
8615
|
return;
|
|
@@ -8640,31 +8627,43 @@ class CatalogueGL {
|
|
|
8640
8627
|
const idx = this.hoveredIndexes[0];
|
|
8641
8628
|
return this._sources[idx] ?? null;
|
|
8642
8629
|
}
|
|
8643
|
-
|
|
8644
|
-
if (in_mouseHelper.x == null ||
|
|
8645
|
-
|
|
8646
|
-
|
|
8630
|
+
findNearestSourceIndex(in_mouseHelper) {
|
|
8631
|
+
if (in_mouseHelper.x == null ||
|
|
8632
|
+
in_mouseHelper.y == null ||
|
|
8633
|
+
in_mouseHelper.z == null) {
|
|
8634
|
+
return null;
|
|
8647
8635
|
}
|
|
8648
|
-
const hoveredIndexes = [];
|
|
8649
8636
|
const mousePix = in_mouseHelper.computeNpix();
|
|
8650
|
-
if (mousePix
|
|
8651
|
-
|
|
8652
|
-
|
|
8653
|
-
|
|
8654
|
-
|
|
8655
|
-
|
|
8656
|
-
|
|
8657
|
-
|
|
8658
|
-
|
|
8659
|
-
|
|
8660
|
-
|
|
8661
|
-
|
|
8662
|
-
|
|
8663
|
-
|
|
8664
|
-
|
|
8637
|
+
if (mousePix == null)
|
|
8638
|
+
return null;
|
|
8639
|
+
const candidates = this._healpixDensityMap.get(mousePix);
|
|
8640
|
+
if (!candidates?.length)
|
|
8641
|
+
return null;
|
|
8642
|
+
const selR = this.getSelectionRadius();
|
|
8643
|
+
let nearestIndex = null;
|
|
8644
|
+
let nearestDistance = Number.POSITIVE_INFINITY;
|
|
8645
|
+
for (const sourceIdx of candidates) {
|
|
8646
|
+
const source = this._sources[sourceIdx];
|
|
8647
|
+
if (!source)
|
|
8648
|
+
continue;
|
|
8649
|
+
const dx = source.point.x - in_mouseHelper.x;
|
|
8650
|
+
const dy = source.point.y - in_mouseHelper.y;
|
|
8651
|
+
const dz = source.point.z - in_mouseHelper.z;
|
|
8652
|
+
const dist = Math.sqrt(dx * dx + dy * dy + dz * dz);
|
|
8653
|
+
if (dist <= selR && dist < nearestDistance) {
|
|
8654
|
+
nearestDistance = dist;
|
|
8655
|
+
nearestIndex = sourceIdx;
|
|
8665
8656
|
}
|
|
8666
8657
|
}
|
|
8667
|
-
return
|
|
8658
|
+
return nearestIndex;
|
|
8659
|
+
}
|
|
8660
|
+
checkClicking(in_mouseHelper) {
|
|
8661
|
+
const nearestIndex = this.findNearestSourceIndex(in_mouseHelper);
|
|
8662
|
+
return nearestIndex == null ? [] : [nearestIndex];
|
|
8663
|
+
}
|
|
8664
|
+
checkHovering(in_mouseHelper) {
|
|
8665
|
+
const nearestIndex = this.findNearestSourceIndex(in_mouseHelper);
|
|
8666
|
+
return nearestIndex == null ? [] : [nearestIndex];
|
|
8668
8667
|
}
|
|
8669
8668
|
/**
|
|
8670
8669
|
* @param in_mMatrix Model matrix the current catalogue is associated to (e.g. HiPS matrix)
|
|
@@ -8711,7 +8710,8 @@ class CatalogueGL {
|
|
|
8711
8710
|
const base = this.hoveredIndexes[k] * CatalogueGL.ELEM_SIZE;
|
|
8712
8711
|
// if (this.vertexCataloguePosition[base + 3] == 2.0) continue; // selected, skip hover
|
|
8713
8712
|
this.vertexCataloguePosition[base + 3] = 0.0; // not hovered
|
|
8714
|
-
this.vertexCataloguePosition[base + 4] =
|
|
8713
|
+
this.vertexCataloguePosition[base + 4] =
|
|
8714
|
+
this._sources[this.hoveredIndexes[k]].shapeSize; // size
|
|
8715
8715
|
}
|
|
8716
8716
|
// Hover logic on mouse move
|
|
8717
8717
|
if (in_mouseHelper != null && in_mouseHelper.xyz !== this._oldMouseCoords) {
|
|
@@ -10336,11 +10336,9 @@ class FootprintSetGL {
|
|
|
10336
10336
|
_metadataManager;
|
|
10337
10337
|
_providerUrl;
|
|
10338
10338
|
_footprintShaderProgram;
|
|
10339
|
-
|
|
10340
|
-
constructor(fsetName, fsetDescription, providerUrl, metadataManager, webgl, visibleTilesManager) {
|
|
10339
|
+
constructor(fsetName, fsetDescription, providerUrl, metadataManager, webgl) {
|
|
10341
10340
|
this._webgl = webgl;
|
|
10342
10341
|
this._ready = false;
|
|
10343
|
-
this._visibleTilesManager = visibleTilesManager;
|
|
10344
10342
|
this.TYPE = "FOOTPRINT_SET";
|
|
10345
10343
|
this._name = fsetName;
|
|
10346
10344
|
this._description = fsetDescription;
|
|
@@ -14643,7 +14641,9 @@ class MeshHiPS extends AbstractSkyEntity_js_1.AbstractSkyEntity {
|
|
|
14643
14641
|
const orders = Array.from(byOrder.keys()).sort((a, b) => a - b);
|
|
14644
14642
|
for (const order of orders) {
|
|
14645
14643
|
for (const coord of byOrder.get(order) ?? []) {
|
|
14646
|
-
this._tiles
|
|
14644
|
+
this._tiles
|
|
14645
|
+
.get(this.tileKey(coord))
|
|
14646
|
+
?.draw(pMatrix, vMatrix, mMatrix, this._descriptor.color, this._descriptor.wireframe);
|
|
14647
14647
|
}
|
|
14648
14648
|
}
|
|
14649
14649
|
if (wasCullFace)
|
|
@@ -14656,7 +14656,7 @@ class MeshHiPS extends AbstractSkyEntity_js_1.AbstractSkyEntity {
|
|
|
14656
14656
|
getDebugStats() {
|
|
14657
14657
|
const tiles = Array.from(this._tiles.values());
|
|
14658
14658
|
return {
|
|
14659
|
-
activeBaseLayer:
|
|
14659
|
+
activeBaseLayer: "meships",
|
|
14660
14660
|
meshHiPSName: this._descriptor.name,
|
|
14661
14661
|
meshHiPSUrl: this._descriptor.baseUrl,
|
|
14662
14662
|
currentOrder: this._currentOrder,
|
|
@@ -14675,33 +14675,47 @@ class MeshHiPS extends AbstractSkyEntity_js_1.AbstractSkyEntity {
|
|
|
14675
14675
|
? byOrder.pixels
|
|
14676
14676
|
: [];
|
|
14677
14677
|
if (pixels.length > 0) {
|
|
14678
|
-
return pixels.map((ipix) => ({
|
|
14678
|
+
return pixels.map((ipix) => ({
|
|
14679
|
+
order: this._currentOrder,
|
|
14680
|
+
ipix,
|
|
14681
|
+
}));
|
|
14679
14682
|
}
|
|
14680
14683
|
const tileCount = 12 * 4 ** this._currentOrder;
|
|
14681
|
-
return Array.from({ length: tileCount }, (_, ipix) => ({
|
|
14684
|
+
return Array.from({ length: tileCount }, (_, ipix) => ({
|
|
14685
|
+
order: this._currentOrder,
|
|
14686
|
+
ipix,
|
|
14687
|
+
}));
|
|
14682
14688
|
}
|
|
14683
14689
|
resolveCoverageTiles(visibleTiles) {
|
|
14684
14690
|
const tiles = new Map();
|
|
14685
14691
|
const add = (coord) => {
|
|
14686
|
-
if (coord.order < this._descriptor.minOrder ||
|
|
14692
|
+
if (coord.order < this._descriptor.minOrder ||
|
|
14693
|
+
coord.order > this._descriptor.maxOrder) {
|
|
14687
14694
|
return;
|
|
14695
|
+
}
|
|
14688
14696
|
tiles.set(this.tileKey(coord), coord);
|
|
14689
14697
|
};
|
|
14690
14698
|
for (const coord of visibleTiles) {
|
|
14691
14699
|
add(coord);
|
|
14692
14700
|
for (let order = coord.order - 1; order >= this._descriptor.minOrder; order--) {
|
|
14693
14701
|
const shift = 2 * (coord.order - order);
|
|
14694
|
-
add({
|
|
14702
|
+
add({
|
|
14703
|
+
order,
|
|
14704
|
+
ipix: coord.ipix >> shift,
|
|
14705
|
+
});
|
|
14695
14706
|
}
|
|
14696
14707
|
}
|
|
14697
14708
|
const manager = this._healpixGrid.visibleTilesManager;
|
|
14698
14709
|
const ancestorsMap = manager?.ancestorsMap;
|
|
14699
14710
|
if (ancestorsMap) {
|
|
14700
14711
|
for (const [order, ipixes] of ancestorsMap) {
|
|
14701
|
-
if (order < this._descriptor.minOrder ||
|
|
14712
|
+
if (order < this._descriptor.minOrder ||
|
|
14713
|
+
order > this._descriptor.maxOrder) {
|
|
14702
14714
|
continue;
|
|
14703
|
-
|
|
14715
|
+
}
|
|
14716
|
+
for (const ipix of ipixes) {
|
|
14704
14717
|
add({ order, ipix });
|
|
14718
|
+
}
|
|
14705
14719
|
}
|
|
14706
14720
|
}
|
|
14707
14721
|
return Array.from(tiles.values());
|
|
@@ -16318,6 +16332,9 @@ function normalizeLongitudeDeg(longitudeDeg) {
|
|
|
16318
16332
|
*
|
|
16319
16333
|
* See LICENSE.md, LICENSE-AGPL.md, and LICENSE-COMMERCIAL.md for details.
|
|
16320
16334
|
*/
|
|
16335
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
16336
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
16337
|
+
};
|
|
16321
16338
|
Object.defineProperty(exports, "__esModule", ({ value: true }));
|
|
16322
16339
|
exports.TerraFootprintSetGL = void 0;
|
|
16323
16340
|
const FootprintSetGL_js_1 = __webpack_require__(592);
|
|
@@ -16326,6 +16343,8 @@ const Footprint_js_1 = __webpack_require__(2475);
|
|
|
16326
16343
|
const MetadataColumn_js_1 = __webpack_require__(1072);
|
|
16327
16344
|
const MetadataManager_js_1 = __webpack_require__(5403);
|
|
16328
16345
|
const MetadataColumn_js_2 = __webpack_require__(1072);
|
|
16346
|
+
const Point_js_1 = __webpack_require__(6553);
|
|
16347
|
+
const GeomUtils_js_1 = __importDefault(__webpack_require__(2930));
|
|
16329
16348
|
class TerraFootprintSetGL extends FootprintSetGL_js_1.FootprintSetGL {
|
|
16330
16349
|
_kind = 'TerraFootprintSetGL';
|
|
16331
16350
|
_coordsType = CoordsType_js_1.CoordsType.GEOGRAPHIC;
|
|
@@ -16344,6 +16363,23 @@ class TerraFootprintSetGL extends FootprintSetGL_js_1.FootprintSetGL {
|
|
|
16344
16363
|
this._ready = true;
|
|
16345
16364
|
this._bufferInitialised = false;
|
|
16346
16365
|
}
|
|
16366
|
+
checkSelection(mouseHelper) {
|
|
16367
|
+
if (mouseHelper.x == null || mouseHelper.y == null || mouseHelper.z == null)
|
|
16368
|
+
return;
|
|
16369
|
+
const hoverState = this;
|
|
16370
|
+
hoverState._hoveredFootprints = [];
|
|
16371
|
+
this.totHoveredPoints = 0;
|
|
16372
|
+
const mousePoint = new Point_js_1.Point({ x: mouseHelper.x, y: mouseHelper.y, z: mouseHelper.z }, CoordsType_js_1.CoordsType.CARTESIAN);
|
|
16373
|
+
for (const footprint of this.footprintPolygons) {
|
|
16374
|
+
if (!footprint.selectionObj)
|
|
16375
|
+
continue;
|
|
16376
|
+
if (GeomUtils_js_1.default.checkPointInsidePolygon5(footprint.selectionObj, mousePoint)) {
|
|
16377
|
+
hoverState._hoveredFootprints.push(footprint);
|
|
16378
|
+
this.totHoveredPoints += footprint.totPoints;
|
|
16379
|
+
}
|
|
16380
|
+
}
|
|
16381
|
+
this.initHoveringBuffer();
|
|
16382
|
+
}
|
|
16347
16383
|
createGeoJSONMetadataColumns(features) {
|
|
16348
16384
|
const names = new Set();
|
|
16349
16385
|
features.forEach(feature => Object.keys(feature.properties).forEach(name => names.add(name)));
|
|
@@ -16388,8 +16424,44 @@ exports.TerraFootprintSetGL = TerraFootprintSetGL;
|
|
|
16388
16424
|
Object.defineProperty(exports, "__esModule", ({ value: true }));
|
|
16389
16425
|
exports.TerraPointSetGL = void 0;
|
|
16390
16426
|
const CatalogueGL_js_1 = __webpack_require__(1232);
|
|
16427
|
+
const MetadataManager_js_1 = __webpack_require__(5403);
|
|
16428
|
+
const Point_js_1 = __webpack_require__(6553);
|
|
16429
|
+
const CoordsType_js_1 = __webpack_require__(8145);
|
|
16391
16430
|
class TerraPointSetGL extends CatalogueGL_js_1.CatalogueGL {
|
|
16392
16431
|
_kind = 'TerraPointSetGL';
|
|
16432
|
+
addSources(inData, columnsMeta) {
|
|
16433
|
+
this._ready = false;
|
|
16434
|
+
this._sources = [];
|
|
16435
|
+
const metadataManager = new MetadataManager_js_1.MetadataManager(columnsMeta);
|
|
16436
|
+
this._metadataManager = metadataManager;
|
|
16437
|
+
const lonDataIndex = metadataManager.selectedRaColumn?.index ?? -1;
|
|
16438
|
+
const latDataIndex = metadataManager.selectedDecColumn?.index ?? -1;
|
|
16439
|
+
if (lonDataIndex < 0 || latDataIndex < 0) {
|
|
16440
|
+
throw new Error(`(lon, lat) idx not defined (${lonDataIndex}, ${latDataIndex}) `);
|
|
16441
|
+
}
|
|
16442
|
+
for (const row of inData) {
|
|
16443
|
+
const point = new Point_js_1.Point({
|
|
16444
|
+
lonDeg: Number(row[lonDataIndex]),
|
|
16445
|
+
latDeg: Number(row[latDataIndex]),
|
|
16446
|
+
}, CoordsType_js_1.CoordsType.GEOGRAPHIC);
|
|
16447
|
+
this.addSource({
|
|
16448
|
+
point,
|
|
16449
|
+
details: row,
|
|
16450
|
+
healpixPixel: 0,
|
|
16451
|
+
shapeSize: CatalogueGL_js_1.CatalogueGL.STANDARD_SHAPE_SIZE,
|
|
16452
|
+
brightnessFactor: 3,
|
|
16453
|
+
getDetailByindex(index) {
|
|
16454
|
+
return index < 0 || index >= row.length ? undefined : row[index];
|
|
16455
|
+
},
|
|
16456
|
+
});
|
|
16457
|
+
}
|
|
16458
|
+
this._ready = true;
|
|
16459
|
+
this._bufferInitialised = false;
|
|
16460
|
+
}
|
|
16461
|
+
draw(inMatrix, inMouseHelper, viewMatrix, projectionMatrix) {
|
|
16462
|
+
this._oldMouseCoords = inMouseHelper?.xyz ?? null;
|
|
16463
|
+
super.draw(inMatrix, inMouseHelper, viewMatrix, projectionMatrix);
|
|
16464
|
+
}
|
|
16393
16465
|
}
|
|
16394
16466
|
exports.TerraPointSetGL = TerraPointSetGL;
|
|
16395
16467
|
|
|
@@ -16422,7 +16494,6 @@ class TerraPolylineSetGL {
|
|
|
16422
16494
|
_providerUrl;
|
|
16423
16495
|
_metadataManager;
|
|
16424
16496
|
_webgl;
|
|
16425
|
-
_visibleTilesManager;
|
|
16426
16497
|
static ELEM_SIZE = 3;
|
|
16427
16498
|
static BYTES_X_ELEM = new Float32Array().BYTES_PER_ELEMENT;
|
|
16428
16499
|
_kind = 'TerraPolylineSetGL';
|
|
@@ -16433,13 +16504,12 @@ class TerraPolylineSetGL {
|
|
|
16433
16504
|
paths = [];
|
|
16434
16505
|
renderSegments = [];
|
|
16435
16506
|
_polylineShaderProgram;
|
|
16436
|
-
constructor(_name, _description, _providerUrl, _metadataManager, _webgl
|
|
16507
|
+
constructor(_name, _description, _providerUrl, _metadataManager, _webgl) {
|
|
16437
16508
|
this._name = _name;
|
|
16438
16509
|
this._description = _description;
|
|
16439
16510
|
this._providerUrl = _providerUrl;
|
|
16440
16511
|
this._metadataManager = _metadataManager;
|
|
16441
16512
|
this._webgl = _webgl;
|
|
16442
|
-
this._visibleTilesManager = _visibleTilesManager;
|
|
16443
16513
|
this._polylineShaderProgram = new FootprintShaderProgram_js_1.FootprintShaderProgram(this._webgl);
|
|
16444
16514
|
}
|
|
16445
16515
|
addPath(points, metadata) {
|
|
@@ -18765,7 +18835,8 @@ class MouseHelper {
|
|
|
18765
18835
|
computeNpix() {
|
|
18766
18836
|
if (!this._xyz)
|
|
18767
18837
|
return null;
|
|
18768
|
-
const hp =
|
|
18838
|
+
// const hp: Healpix = global.getHealpix(global.nsideForSelection);
|
|
18839
|
+
const hp = Global_js_1.default.getHealpix(Global_js_1.default.selectionOrder);
|
|
18769
18840
|
const v = new healpix_1.Vec3(this._xyz[0], this._xyz[1], this._xyz[2]);
|
|
18770
18841
|
const ptg = new healpix_1.Pointing(v, false);
|
|
18771
18842
|
return hp.ang2pix(ptg, false);
|