[Kstars-devel] Refactoring of SkyComponents
Khudyakov Alexey
alexey.skladnoy at gmail.com
Sat Jan 16 16:44:50 CET 2010
Hello everyone.
It seems that trunk is open for general development with maybe string freeze
in effect. Or am I wrong?
I mostly finished work on refactoring of skycomponents. It got uncomfortably
large. Currently it consists of 88 patches. List of notable changes below.
I used git locally because it has great support for branches and much better
at merging.
So when will unfrozen branch be merged into trunk so I could commit my branch?
Although probability of conflict is low I think it would be easier for me to do
merge.
Notable changes:
* Unused functions and data members are removed. I used rather strict approach
to removal of unused functions. If function is not used it is to be removed.
This is especially true for accessors.
* If function is called only by subclasses make it protected. Usually such
functions either used to add data or provide access to innards of class.
I think it is not sensible to expose it to whole world.
* If class A is only subclass of class B merge them into one class.
I think it's better to have fewer classes. And it's reasonable to keep
- SkipListIndex -> MilkyWay
- SingleComponent -> SolarSystemSingleComponent
* Change type of SkyComponent's parent to SkyComposite. Its parent is always
SkyComposite so lets enforce it at type level.
* Add static function to StarObject to draw star image of specified size and
spectral class. This function now used in SolarSystemSingleComponent for
planet drawing.
* Unify methods for determining SkyComponent visibility. Drop pointer to
function SkyComponent::visible in favor of virtual function
SkyComponent::selected. Implement `selected' for SolarSystemComposite in terms
of virtual function.
* Remove functions {add,delete,clear}Trail from SkyComponent. Instead modify
TrailObject directly. This however required to maintain global set of object
with trails.
* Classes ConstellationsBoundary and ConstellationBoundaryLines are merged
into one class.
* A lot of not so notable changes.
== Still on TODO list: ==
* Document API properly
* Get rid of explicit pointer casts. There
* Sort out visibility of methods.
--
Khudyakov Alexey
More information about the Kstars-devel
mailing list