kstars
#include <skymapdrawabstract.h>

Public Member Functions | |
SkyMapDrawAbstract (SkyMap *sm) | |
void | drawAngleRuler (QPainter &psky) |
void | drawObjectLabels (QList< SkyObject * > &labelObjects) |
void | drawOverlays (QPainter &p, bool drawFov=true) |
void | drawTelescopeSymbols (QPainter &psky) |
void | drawZoomBox (QPainter &psky) |
void | exportSkyImage (QPaintDevice *pd, bool scale=false) |
void | exportSkyImage (SkyQPainter *painter, bool scale=false) |
Static Public Member Functions | |
static bool | drawLock () |
static void | setDrawLock (bool state) |
Protected Member Functions | |
virtual | ~SkyMapDrawAbstract () |
void | calculateFPS () |
virtual void | paintEvent (QPaintEvent *e)=0 |
Protected Attributes | |
KStarsData * | m_KStarsData |
SkyMap * | m_SkyMap |
Static Protected Attributes | |
static bool | m_DrawLock = false |
Detailed Description
This class defines the methods that both rendering engines (GLPainter and QPainter) must implement.
This also allows us to add more rendering engines if required.
- Version
- 1.0
Definition at line 40 of file skymapdrawabstract.h.
Constructor & Destructor Documentation
|
inlineprotectedvirtual |
Virtual Destructor.
Definition at line 46 of file skymapdrawabstract.h.
|
explicit |
Constructor that sets data and m_SkyMap, and initializes the FPS counters.
Definition at line 61 of file skymapdrawabstract.cpp.
Member Function Documentation
|
protected |
Calculate FPS and dump result to stderr using kDebug.
Definition at line 335 of file skymapdrawabstract.cpp.
void SkyMapDrawAbstract::drawAngleRuler | ( | QPainter & | psky | ) |
Draw a dashed line from the Angular-Ruler start point to the current mouse cursor, when in Angular-Ruler mode.
- Parameters
-
psky reference to the QPainter on which to draw (this should be the Sky pixmap).
Definition at line 96 of file skymapdrawabstract.cpp.
|
inlinestatic |
- Returns
- true if a draw is in progress or is locked, false otherwise. This is just the value of m_DrawLock
Definition at line 120 of file skymapdrawabstract.h.
Draw "user labels".
User labels are name labels attached to objects manually with the right-click popup menu. Also adds a label to the FocusObject if the Option UseAutoLabel is true.
- Parameters
-
labelObjects QList of pointers to the objects which need labels (excluding the centered object) psky painter for the sky
- Note
- the labelObjects list is managed by the SkyMapComponents class
Definition at line 112 of file skymapdrawabstract.cpp.
void SkyMapDrawAbstract::drawOverlays | ( | QPainter & | p, |
bool | drawFov = true |
||
) |
Draw the overlays on top of the sky map.
These include the infoboxes, field-of-view indicator, telescope symbols, zoom box and any other user-interaction graphics.
The overlays can be updated rapidly, without having to recompute the entire SkyMap. The stored Sky image is simply blitted onto the SkyMap widget, and then we call drawOverlays() to refresh the overlays.
- Parameters
-
pm pointer to the Sky pixmap
Definition at line 67 of file skymapdrawabstract.cpp.
void SkyMapDrawAbstract::drawTelescopeSymbols | ( | QPainter & | psky | ) |
Draw symbols at the position of each Telescope currently being controlled by KStars.
- Note
- The shape of the Telescope symbol is currently a hard-coded bullseye.
- Parameters
-
psky reference to the QPainter on which to draw (this should be the Sky pixmap).
Definition at line 181 of file skymapdrawabstract.cpp.
void SkyMapDrawAbstract::drawZoomBox | ( | QPainter & | psky | ) |
Draw a dotted-line rectangle which traces the potential new field-of-view in ZoomBox mode.
- Parameters
-
psky reference to the QPainter on which to draw (this should be the Sky pixmap).
Definition at line 104 of file skymapdrawabstract.cpp.
void SkyMapDrawAbstract::exportSkyImage | ( | QPaintDevice * | pd, |
bool | scale = false |
||
) |
Draw the current Sky map to a pixmap which is to be printed or exported to a file.
- Parameters
-
pd pointer to the QPaintDevice on which to draw.
- See also
- KStars::slotExportImage()
- KStars::slotPrint()
Definition at line 302 of file skymapdrawabstract.cpp.
void SkyMapDrawAbstract::exportSkyImage | ( | SkyQPainter * | painter, |
bool | scale = false |
||
) |
Draw the current Sky map using passed SkyQPainter instance.
Required when used QPaintDevice doesn't support drawing using multiple painters (e.g. QSvgGenerator which generates broken SVG output when more than one QPainter subclass is used). Passed painter should already be initialized to draw on selected QPaintDevice subclass using begin() and it won't be ended [end()] by this method.
- Parameters
-
painter pointer to the SkyQPainter already set up to paint on selected QPaintDevice subclass. scale should sky image be scaled to fit used QPaintDevice?
Definition at line 312 of file skymapdrawabstract.cpp.
|
protectedpure virtual |
Overridden paintEvent method.
Must be implemented by subclasses to draw the SkyMap. (This method is pure virtual)
Implemented in SkyMapQDraw, and SkyMapGLDraw.
|
static |
Acquire / release a draw lock.
This prevents other drawing from happening
Definition at line 346 of file skymapdrawabstract.cpp.
Member Data Documentation
|
staticprotected |
Definition at line 151 of file skymapdrawabstract.h.
|
protected |
Definition at line 149 of file skymapdrawabstract.h.
|
protected |
Definition at line 150 of file skymapdrawabstract.h.
The documentation for this class was generated from the following files:
Documentation copyright © 1996-2014 The KDE developers.
Generated on Tue Oct 14 2014 22:36:23 by doxygen 1.8.7 written by Dimitri van Heesch, © 1997-2006
KDE's Doxygen guidelines are available online.