Fix right-click popup menu on deep stars
A bit of explanation is warranted:
The objectNearest()
method on many SkyComponent
subclasses will
use the HTM index to identify which trixels to search for candidate
objects that are close to the sky map point where the right-click
occurred.
We must note that our catalogs contain the trixel IDs as an index so we can quickly retrieve all stars / deep-sky objects in that trixel. These trixel IDs are pre-computed using the catalog coordinates, i.e. J2000 / ICRS coordinates of the star / DSO and not the present epoch (JNow) coordinates. Thus, any "look up" of the trixel index must use the J2000 coordinates and not the JNow coordinates.
My previous commit involving the SkyMesh
class (HTM wrapper) changed
the default behavior of SkyMesh::intersect
(one overload of which
provides a list of trixels within a given radius of a sky point) to
default to using the J2000.0 coordinates. This messed-up the
objectNearest()
results, especially on DeepStarComponent
which has
fine trixels, as the J2000 coordinates of the clicked point were not
computed correctly (instead they were simply filled with the JNow
positions!) The earlier working code, as I understand it, looked up
the index based on the JNow coordinates, which is the wrong thing to
do!
So now we do (what I think) is the correct thing:
- We compute the J2000 coordinates of the clicked point (in
Projector::fromScreen
) - We look up the HTMesh index using the J2000 coordinates and not the JNow coordinates