• Skip to content
  • Skip to link menu
KDE API Reference
  • KDE API Reference
  • kdeedu API Reference
  • KDE Home
  • Contact Us
 

kstars

Public Member Functions | Static Public Member Functions | Protected Member Functions | Protected Attributes | Static Protected Attributes | List of all members
SkyMapDrawAbstract Class Referenceabstract

#include <skymapdrawabstract.h>

Inheritance diagram for SkyMapDrawAbstract:
Inheritance graph
[legend]

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
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 40 of file skymapdrawabstract.h.

Constructor & Destructor Documentation

virtual SkyMapDrawAbstract::~SkyMapDrawAbstract ( )
inlineprotectedvirtual

Virtual Destructor.

Definition at line 46 of file skymapdrawabstract.h.

SkyMapDrawAbstract::SkyMapDrawAbstract ( SkyMap *  sm)
explicit

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

Definition at line 61 of file skymapdrawabstract.cpp.

Member Function Documentation

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

Definition at line 96 of file skymapdrawabstract.cpp.

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 120 of file skymapdrawabstract.h.

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)
pskypainter 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
pmpointer 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
pskyreference 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
pskyreference 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
pdpointer 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
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 312 of file skymapdrawabstract.cpp.

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 SkyMapQDraw, and SkyMapGLDraw.

void SkyMapDrawAbstract::setDrawLock ( bool  state)
static

Acquire / release a draw lock.

This prevents other drawing from happening

Definition at line 346 of file skymapdrawabstract.cpp.

Member Data Documentation

bool SkyMapDrawAbstract::m_DrawLock = false
staticprotected

Definition at line 151 of file skymapdrawabstract.h.

KStarsData* SkyMapDrawAbstract::m_KStarsData
protected

Definition at line 149 of file skymapdrawabstract.h.

SkyMap* SkyMapDrawAbstract::m_SkyMap
protected

Definition at line 150 of file skymapdrawabstract.h.


The documentation for this class was generated from the following files:
  • skymapdrawabstract.h
  • skymapdrawabstract.cpp
This file is part of the KDE documentation.
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.

kstars

Skip menu "kstars"
  • Main Page
  • Namespace List
  • Namespace Members
  • Alphabetical List
  • Class List
  • Class Hierarchy
  • Class Members
  • File List
  • File Members
  • Related Pages

kdeedu API Reference

Skip menu "kdeedu API Reference"
  • Analitza
  •     lib
  • kalgebra
  • kalzium
  •   libscience
  • kanagram
  • kig
  •   lib
  • klettres
  • kstars
  • libkdeedu
  •   keduvocdocument
  • marble
  • parley
  • rocs
  •   App
  •   RocsCore
  •   VisualEditor
  •   stepcore

Search



Report problems with this website to our bug tracking system.
Contact the specific authors with questions and comments about the page contents.

KDE® and the K Desktop Environment® logo are registered trademarks of KDE e.V. | Legal