Skip to content

Refactor artificial horizon constraints. Add ceiling constraint. Add unit tests. Use Great circle.

Hy Murveit requested to merge murveit/kstars:horizon3 into master

The ArtificialHorizonComponent class was refactored, so artificial horizon could be unit tested. A new class, ArtificialHorizon which does not interact with the UI was extracted from ArtificialHorizonComponent, and it is unit tested in the new testartificialhorizon.cpp unit test.

New capability was also added to the artificial horizon feature. A new kind of ArtificialHorizonEntity (a series of connected line segments) called "a ceiling line" can be drawn. This ceiling defines an upper altitude limit, similar to the previous/standard horizon lines which define lower altitude limits. Many sets of connected line segments can be enabled, either as horizons or ceilings.

The ceiling feature is also tested in the unit test above, and also tested in the kstars_ui/test_aritificial_horizon.cpp test.

Finally a new utility class, GreatCircle, is introduced in tools/greatcircle.cpp and unit tested in testgreatcircle.cpp. It computes points along an arc from one azimuth,altitude coordinate to another, where the arc is part of a great circle (a circle whose center is also the center of the celestial sphere). Artificial horizon rendering now uses the GreatCircle class to make its rendering more accurate.

Merge request reports