[Kstars-devel] skycomponents: update vs. updatePlanets vs. updateMoons
Jason Harris
kstars at 30doradus.org
Sat Oct 22 20:17:01 CEST 2005
Hello,
Do we need separate functions update(), updatePlanets() and updateMoons()?
The reasoning behind separating them is:
most of the time, we just need to update the Horizontal coordinates of all
objects in the sky; in that case, we use skyComponents()->update(). Less
often, the Moons (Earth's and Jupiter's) positions need to be updated; in
that case we'd call skyComponents()->updateMoons(). Finally, the eight
planets + Sun need their positions updated even less often than the Moons; in
that case, we'd call skyComponents()->updatePlanets().
It seems wasteful to have updatePlanets() and updateMoons() at the
SkyComponents level of the hierarchy, because they are irrelevant for the
vast majority of objects (i.e., all non-solar system objects).
Suggestion: Provide updatePlanets() and updateMoons() only in
SolarSystemComposite and its children. We'd need to have direct access to
the SolarSystemComposite in KStars, so we could just call
"solarSystem()->updatePlanets()" when needed. Similar arguments can be made
for SkyComponent::addTrail(o)/removeTrail(o): there's no point looping over
all the stars and deep-sky objects looking for an object with a trail, so it
would be better to restrict this function to the SolarSystemComposite and its
children.
What do you think?
Jason
--
KStars: KDE Desktop Planetarium
http://edu.kde.org/kstars
More information about the Kstars-devel
mailing list