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

kstars

  • sources
  • kde-4.12
  • kdeedu
  • kstars
  • kstars
skymapdrawabstract.h
Go to the documentation of this file.
1 /***************************************************************************
2  skymapdrawabstract.h - K Desktop Planetarium
3  -------------------
4  begin : Mon Dec 20 2010 05:04 AM UTC-6
5  copyright : (C) 2010 Akarsh Simha
6  email : akarsh.simha@kdemail.net
7  ***************************************************************************/
8 
9 /***************************************************************************
10  * *
11  * This program is free software; you can redistribute it and/or modify *
12  * it under the terms of the GNU General Public License as published by *
13  * the Free Software Foundation; either version 2 of the License, or *
14  * (at your option) any later version. *
15  * *
16  ***************************************************************************/
17 
18 #ifndef SKYMAPDRAWABSTRACT_H_
19 #define SKYMAPDRAWABSTRACT_H_
20 
21 #include "kstarsdata.h"
22 #include <QPainter>
23 #include <QPaintEvent>
24 #include <QPaintDevice>
25 
26 class SkyMap;
27 class SkyQPainter;
28 
37 // In summary, this is a class created by stealing all the
38 // drawing-related methods from the old SkyMap class
39 
40 class SkyMapDrawAbstract {
41 
42  protected:
46  virtual ~SkyMapDrawAbstract() { };
47 
48  public:
49 
54  explicit SkyMapDrawAbstract( SkyMap *sm );
55 
56  // *********************** "IMPURE" VIRTUAL METHODS ******************* //
57  // NOTE: The following methods are implemented using native
58  // QPainter in both cases. So it's virtual, but not pure virtual
59 
69  void drawOverlays( QPainter& p, bool drawFov = true );
70 
75  void drawTelescopeSymbols(QPainter &psky);
76 
81  void drawZoomBox( QPainter &psky );
82 
87  void drawAngleRuler( QPainter &psky );
88 
89 
96  void exportSkyImage( QPaintDevice *pd, bool scale = false );
97 
106  void exportSkyImage( SkyQPainter *painter, bool scale = false );
107 
115  void drawObjectLabels( QList< SkyObject* >& labelObjects );
116 
120  static inline bool drawLock() { return m_DrawLock; }
121 
125  static void setDrawLock( bool state );
126 
127  // *********************** PURE VIRTUAL METHODS ******************* //
128  // NOTE: The following methods differ between GL and QPainter backends
129  // Thus, they are pure virtual and must be implemented by the sublcass
130 
131  protected:
137  virtual void paintEvent( QPaintEvent *e ) = 0;
138 
139  /*
140  *NOTE:
141  * Depending on whether the implementation of this class is a
142  * GL-backend, it may need to implement these methods:
143  * virtual void resizeGL(int width, int height);
144  * virtual void initializeGL();
145  * So we will not even bother defining them here.
146  * They must be taken care of in the subclasses
147  */
148 
149  KStarsData *m_KStarsData;
150  SkyMap *m_SkyMap;
151  static bool m_DrawLock;
152 
154  void calculateFPS();
155 private:
156  int m_framecount; // To count FPS
157  QTime m_fpstime;
158 };
159 
160 #endif
SkyMapDrawAbstract::SkyMapDrawAbstract
SkyMapDrawAbstract(SkyMap *sm)
Constructor that sets data and m_SkyMap, and initializes the FPS counters.
Definition: skymapdrawabstract.cpp:61
KStarsData
KStarsData is the backbone of KStars.
Definition: kstarsdata.h:66
SkyMapDrawAbstract::setDrawLock
static void setDrawLock(bool state)
Acquire / release a draw lock.
Definition: skymapdrawabstract.cpp:346
SkyMapDrawAbstract::m_KStarsData
KStarsData * m_KStarsData
Definition: skymapdrawabstract.h:149
SkyMapDrawAbstract::drawOverlays
void drawOverlays(QPainter &p, bool drawFov=true)
Draw the overlays on top of the sky map.
Definition: skymapdrawabstract.cpp:67
SkyMapDrawAbstract::drawLock
static bool drawLock()
Definition: skymapdrawabstract.h:120
SkyMapDrawAbstract::drawObjectLabels
void drawObjectLabels(QList< SkyObject * > &labelObjects)
Draw "user labels".
Definition: skymapdrawabstract.cpp:112
SkyQPainter
The QPainter-based painting backend.
Definition: skyqpainter.h:32
SkyMapDrawAbstract::exportSkyImage
void exportSkyImage(QPaintDevice *pd, bool scale=false)
Draw the current Sky map to a pixmap which is to be printed or exported to a file.
Definition: skymapdrawabstract.cpp:302
SkyMapDrawAbstract::drawAngleRuler
void drawAngleRuler(QPainter &psky)
Draw a dashed line from the Angular-Ruler start point to the current mouse cursor, when in Angular-Ruler mode.
Definition: skymapdrawabstract.cpp:96
SkyMapDrawAbstract::drawTelescopeSymbols
void drawTelescopeSymbols(QPainter &psky)
Draw symbols at the position of each Telescope currently being controlled by KStars.
Definition: skymapdrawabstract.cpp:181
SkyMapDrawAbstract::drawZoomBox
void drawZoomBox(QPainter &psky)
Draw a dotted-line rectangle which traces the potential new field-of-view in ZoomBox mode...
Definition: skymapdrawabstract.cpp:104
SkyMapDrawAbstract::m_SkyMap
SkyMap * m_SkyMap
Definition: skymapdrawabstract.h:150
SkyMapDrawAbstract::m_DrawLock
static bool m_DrawLock
Definition: skymapdrawabstract.h:151
SkyMapDrawAbstract::~SkyMapDrawAbstract
virtual ~SkyMapDrawAbstract()
Virtual Destructor.
Definition: skymapdrawabstract.h:46
SkyMapDrawAbstract::calculateFPS
void calculateFPS()
Calculate FPS and dump result to stderr using kDebug.
Definition: skymapdrawabstract.cpp:335
SkyMapDrawAbstract
This class defines the methods that both rendering engines (GLPainter and QPainter) must implement...
Definition: skymapdrawabstract.h:40
SkyMap
This is the canvas on which the sky is painted.
Definition: skymap.h:72
kstarsdata.h
SkyMapDrawAbstract::paintEvent
virtual void paintEvent(QPaintEvent *e)=0
Overridden paintEvent method.
QList
This file is part of the KDE documentation.
Documentation copyright © 1996-2014 The KDE developers.
Generated on Tue Oct 14 2014 22:36:21 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