[Kstars-devel] Unique Object ID for SkyObjects?

Akarsh Simha akarshsimha at gmail.com
Thu Dec 25 19:36:41 CET 2008


Hi

The current code uses the name of the object to find objects etc. For
instance, to have a KSPlanet::findMagnitude() method that works for
all planets, we compare the name of the KSPlanet with "Mercury" or
whatever.

Now, this is leading to a lot of issues with translated names, and
makes code unnecessarily complicated.

I feel that the clean way to go about this is to have a unique object
ID for each SkyObject. Of course, there will be some logic behind
assigning the UID, that would make a lot of features more convenient
to implement.

We could then have UID vs SkyObject* hashes in each SkyComponent, so
that searching by UID becomes fast.

As an example of how we may want to assign UIDs, a star in the NOMAD
catalog could have an ID like 0 03 62345 897 for the 897th star (type
0) in NOMAD (03) under trixel 62345, encoded in a single long or
something, so that we could locate it by name.

I don't know how much sense this makes or how useful it'll be to
implement this, so wanted to ask.

Regards
Akarsh


More information about the Kstars-devel mailing list