Marble: Clip constellation lines properly in the stars plugin
completed by: Timothy Lanzi
mentors: Torsten Rahn, René Küttner, Dennis Nienhüser
In this task
the stars plugin has been extended to display constellation lines.
The lines currently hide immediately if a star at the line ends leaves the viewport
or disappears behind the earth.
This looks odd. The better way would be to clip the lines as needed.
It could be done by using:
QPainter::setClipRegion(clipRegion); This would get rid of the appearance/disappearance of linesegments. For providing the right clipRegion we could then use (pseudocode): QPainterPath planetShape = currentProjetion->mapShape( const ViewportParams *viewport ); QRegion inner = QRegion( planetShape.toFillPolygon()); QRegion outer( viewportRect ); painter.setClipRegion(outer.subtracted(inner)); We just need to take care and save/restore the painter ...
In addition please use ClipPainter::drawPolyline( const QPolygonF & );
instead of using QPainter::drawLine() for drawing the constellations.
This might take some load from the painting process.
In addition make up your mind how performance of this plugin could get improved.
Please upload the result to the reviewboard.