From 4e33ea1b6bac7ab8cf5d632526a45756f36ff60e Mon Sep 17 00:00:00 2001 From: Matthieu BAUMANN Date: Sat, 29 Oct 2022 01:42:12 +0200 Subject: [PATCH] set rotation + tan change --- deploy.sh | 8 ++++---- src/core/src/line.rs | 2 +- src/core/src/math/projection.rs | 8 ++++---- src/js/Aladin.js | 4 ++++ src/js/View.js | 7 +++++-- 5 files changed, 18 insertions(+), 11 deletions(-) diff --git a/deploy.sh b/deploy.sh index 6fe0b8d2..83423a3f 100755 --- a/deploy.sh +++ b/deploy.sh @@ -4,8 +4,8 @@ DATEUPLOAD="$(date '+%Y-%m-%d')" ssh $USER_ALADIN@aladin 'sg hips -c "mkdir -p $HOME/al-tmp && rm -rf $HOME/al-tmp/*"' scp dist/* $USER_ALADIN@aladin:~/al-tmp -ssh $USER_ALADIN@aladin 'sg hips -c "rm -rf /home/thomas.boch/AladinLite/www/api/v3/27-10-2022 && -mkdir -p /home/thomas.boch/AladinLite/www/api/v3/27-10-2022 && -cp $HOME/al-tmp/* /home/thomas.boch/AladinLite/www/api/v3/27-10-2022 && +ssh $USER_ALADIN@aladin 'sg hips -c "rm -rf /home/thomas.boch/AladinLite/www/api/v3/28-10-2022 && +mkdir -p /home/thomas.boch/AladinLite/www/api/v3/28-10-2022 && +cp $HOME/al-tmp/* /home/thomas.boch/AladinLite/www/api/v3/28-10-2022 && rm -rf /home/thomas.boch/AladinLite/www/api/v3/latest && -ln -s /home/thomas.boch/AladinLite/www/api/v3/27-10-2022 /home/thomas.boch/AladinLite/www/api/v3/latest"' +ln -s /home/thomas.boch/AladinLite/www/api/v3/28-10-2022 /home/thomas.boch/AladinLite/www/api/v3/latest"' diff --git a/src/core/src/line.rs b/src/core/src/line.rs index 729a2536..8d1d7fd7 100644 --- a/src/core/src/line.rs +++ b/src/core/src/line.rs @@ -60,7 +60,7 @@ pub fn project_along_longitudes_and_latitudes( } use crate::ArcDeg; use crate::LonLatT; -const MAX_ANGLE_BEFORE_SUBDIVISION: Angle = Angle(0.20943951023); // 12 degrees +const MAX_ANGLE_BEFORE_SUBDIVISION: Angle = Angle(0.10943951023); // 12 degrees const MAX_ITERATION: usize = 3; pub fn subdivide_along_longitude_and_latitudes( vertices: &mut Vec>, diff --git a/src/core/src/math/projection.rs b/src/core/src/math/projection.rs index ec22a5fb..f037da98 100644 --- a/src/core/src/math/projection.rs +++ b/src/core/src/math/projection.rs @@ -817,8 +817,8 @@ impl Projection for Gnomonic { //if pos_clip_space.x * pos_clip_space.x + pos_clip_space.y * pos_clip_space.y >= 1.0 { // None //} else { - let x_2d = pos_clip_space.x * PI; - let y_2d = pos_clip_space.y * PI; + let x_2d = pos_clip_space.x; + let y_2d = pos_clip_space.y; let r = x_2d * x_2d + y_2d * y_2d; let z = 1.0 / (1.0 + r).sqrt(); @@ -850,8 +850,8 @@ impl Projection for Gnomonic { fn world_to_clip_space_unchecked(&self, pos_world_space: &Vector4) -> Vector2 { let z = pos_world_space.z.abs(); Vector2::new( - (-pos_world_space.x / z) / std::f64::consts::PI, - (pos_world_space.y / z) / std::f64::consts::PI, + -pos_world_space.x / z, + pos_world_space.y / z, ) } } diff --git a/src/js/Aladin.js b/src/js/Aladin.js index 8cff564b..a3f88115 100644 --- a/src/js/Aladin.js +++ b/src/js/Aladin.js @@ -1051,6 +1051,10 @@ export let Aladin = (function () { this.view.decreaseZoom(0.01); }; + Aladin.prototype.setRotation = function(rotation) { + this.view.setRotation(rotation); + } + // @api // Set the current layer that is targeted // Rightclicking for changing the cuts is done the targeted layer diff --git a/src/js/View.js b/src/js/View.js index e71bb741..db79146d 100644 --- a/src/js/View.js +++ b/src/js/View.js @@ -787,6 +787,7 @@ export let View = (function () { var scrolling = false; var oldTime = 0; var newTime = 0; + var scrolling; $(view.catalogCanvas).on('wheel', function (event) { event.preventDefault(); event.stopPropagation(); @@ -863,8 +864,6 @@ export let View = (function () { }, 300); } view.debounceProgCatOnZoom(); - //view.setZoomLevel(level); - //view.refreshProgressiveCats(); return false; }); @@ -1384,6 +1383,10 @@ export let View = (function () { this.setZoom(new_fov); } + View.prototype.setRotation = function(rotation) { + this.aladin.webglAPI.setRotationAroundCenter(rotation); + } + View.prototype.setGridConfig = function (gridCfg) { this.aladin.webglAPI.setGridConfig(gridCfg);