SkyMapDrawAbstract

Search for usage in LXR

#include <skymapdrawabstract.h>

Inheritance diagram for SkyMapDrawAbstract:

Public Member Functions

 SkyMapDrawAbstract (SkyMap *sm)
 
void drawAngleRuler (QPainter &psky)
 
void drawObjectLabels (QList< SkyObject * > &labelObjects)
 
void drawOrientationArrows (QPainter &p)
 
void drawOverlays (QPainter &p, bool drawFov=true)
 
void drawSolverFOV (QPainter &psky)
 
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 ()=default
 
virtual void paintEvent (QPaintEvent *e)=0
 

Protected Attributes

KStarsDatam_KStarsData
 
SkyMapm_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
Author
Akarsh Simha akars.nosp@m.h.si.nosp@m.mha@k.nosp@m.dema.nosp@m.il.ne.nosp@m.t

Definition at line 29 of file skymapdrawabstract.h.

Constructor & Destructor Documentation

◆ ~SkyMapDrawAbstract()

virtual SkyMapDrawAbstract::~SkyMapDrawAbstract ( )
protectedvirtualdefault

Virtual Destructor.

◆ SkyMapDrawAbstract()

SkyMapDrawAbstract::SkyMapDrawAbstract ( SkyMap * sm)
explicit

Constructor that sets data and m_SkyMap, and initializes the FPS counters.

Definition at line 50 of file skymapdrawabstract.cpp.

Member Function Documentation

◆ drawAngleRuler()

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
pskyreference to the QPainter on which to draw (this should be the Sky pixmap).

Definition at line 106 of file skymapdrawabstract.cpp.

◆ drawLock()

static bool SkyMapDrawAbstract::drawLock ( )
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 119 of file skymapdrawabstract.h.

◆ drawObjectLabels()

void SkyMapDrawAbstract::drawObjectLabels ( QList< SkyObject * > & labelObjects)

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
labelObjectsQList of pointers to the objects which need labels (excluding the centered object)
Note
the labelObjects list is managed by the SkyMapComponents class

Definition at line 205 of file skymapdrawabstract.cpp.

◆ drawOrientationArrows()

void SkyMapDrawAbstract::drawOrientationArrows ( QPainter & p)

Draw north and zenith arrows to show the orientation while rotating the sky map.

Parameters
preference to the QPainter on which to draw (this should be the sky map)

Definition at line 117 of file skymapdrawabstract.cpp.

◆ drawOverlays()

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
ppointer to the Sky pixmap
drawFovdetermines if the FOV should be drawn

Definition at line 56 of file skymapdrawabstract.cpp.

◆ drawSolverFOV()

void SkyMapDrawAbstract::drawSolverFOV ( QPainter & psky)

Draw FOV of solved image in Ekos Alignment Module.

Parameters
pskyreference to the QPainter on which to draw (this should be the Sky pixmap).

Definition at line 293 of file skymapdrawabstract.cpp.

◆ drawTelescopeSymbols()

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
pskyreference to the QPainter on which to draw (this should be the Sky pixmap).

Definition at line 334 of file skymapdrawabstract.cpp.

◆ drawZoomBox()

void SkyMapDrawAbstract::drawZoomBox ( QPainter & psky)

Draw a dotted-line rectangle which traces the potential new field-of-view in ZoomBox mode.

Parameters
pskyreference to the QPainter on which to draw (this should be the Sky pixmap).

Definition at line 194 of file skymapdrawabstract.cpp.

◆ exportSkyImage() [1/2]

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.

 @param pd pointer to the QPaintDevice on which to draw.
 @param scale defines if the Sky map should be scaled.
 @see KStars::slotExportImage()
 @see KStars::slotPrint()

Definition at line 418 of file skymapdrawabstract.cpp.

◆ exportSkyImage() [2/2]

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
painterpointer to the SkyQPainter already set up to paint on selected QPaintDevice subclass.
scaleshould sky image be scaled to fit used QPaintDevice?

Definition at line 429 of file skymapdrawabstract.cpp.

◆ paintEvent()

virtual void SkyMapDrawAbstract::paintEvent ( QPaintEvent * e)
protectedpure virtual

Overridden paintEvent method.

Must be implemented by subclasses to draw the SkyMap. (This method is pure virtual)

Implemented in SkyMapGLDraw.

◆ setDrawLock()

void SkyMapDrawAbstract::setDrawLock ( bool state)
static

Acquire / release a draw lock.

This prevents other drawing from happening

Definition at line 466 of file skymapdrawabstract.cpp.

Member Data Documentation

◆ m_DrawLock

bool SkyMapDrawAbstract::m_DrawLock = false
staticprotected

Definition at line 150 of file skymapdrawabstract.h.

◆ m_KStarsData

KStarsData* SkyMapDrawAbstract::m_KStarsData
protected

Definition at line 148 of file skymapdrawabstract.h.

◆ m_SkyMap

SkyMap* SkyMapDrawAbstract::m_SkyMap
protected

Definition at line 149 of file skymapdrawabstract.h.


The documentation for this class was generated from the following files:
This file is part of the KDE documentation.
Documentation copyright © 1996-2024 The KDE developers.
Generated on Mon Nov 18 2024 12:16:43 by doxygen 1.12.0 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.