• 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
skypainter.h
Go to the documentation of this file.
1 /*
2  SkyPainter: class for painting onto the sky for KStars
3  Copyright (C) 2010 Henry de Valence <hdevalence@gmail.com>
4 
5  This program is free software; you can redistribute it and/or modify
6  it under the terms of the GNU General Public License as published by
7  the Free Software Foundation; either version 2 of the License, or
8  (at your option) any later version.
9 
10  This program is distributed in the hope that it will be useful,
11  but WITHOUT ANY WARRANTY; without even the implied warranty of
12  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13  GNU General Public License for more details.
14 
15  You should have received a copy of the GNU General Public License along
16  with this program; if not, write to the Free Software Foundation, Inc.,
17  51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
18 
19 */
20 
21 #ifndef SKYPAINTER_H
22 #define SKYPAINTER_H
23 
24 #include <QPainter>
25 
26 #include "skycomponents/typedef.h"
27 
28 class TrailObject;
29 class KSPlanetBase;
30 class KSAsteroid;
31 class KSComet;
32 class DeepSkyObject;
33 class SkyPoint;
34 class SkyObject;
35 class SkyMap;
36 class SkipList;
37 class LineList;
38 class LineListLabel;
39 class Satellite;
40 class Supernova;
41 
42 
47 class SkyPainter
48 {
49 public:
52  SkyPainter();
53 
57  virtual ~SkyPainter();
58 
60  virtual void setPen(const QPen& pen) = 0;
61 
63  virtual void setBrush(const QBrush& brush) = 0;
64 
65  //FIXME: find a better way to do this.
66  void setSizeMagLimit(float sizeMagLim);
67 
72  virtual void begin() =0;
73 
79  virtual void end() =0;
80 
82  // //
83  // SKY DRAWING FUNCTIONS: //
84  // //
86 
88  virtual void drawSkyBackground() = 0;
89 
95  virtual void drawSkyLine(SkyPoint* a, SkyPoint* b) =0;
96 
104  virtual void drawSkyPolyline(LineList* list, SkipList *skipList = 0,
105  LineListLabel *label = 0) =0;
106 
111  virtual void drawSkyPolygon(LineList* list) =0;
112 
119  virtual bool drawPointSource(SkyPoint *loc, float mag, char sp = 'A') =0;
120 
126  virtual bool drawDeepSkyObject(DeepSkyObject *obj, bool drawImage = false) =0;
127 
132  virtual bool drawPlanet(KSPlanetBase *planet) =0;
133 
137  virtual void drawObservingList( const QList<SkyObject*>& obs ) = 0;
138 
141  virtual void drawFlags() = 0;
142 
145  virtual void drawSatellite( Satellite* sat ) = 0;
146 
149  virtual bool drawSupernova(Supernova* sup) = 0;
150 
151  virtual void drawHorizon( bool filled, SkyPoint *labelPoint = 0, bool *drawLabel = 0) = 0;
152 
154  float starWidth(float mag) const;
155 
156 protected:
157 
158  SkyMap *m_sm;
159 
160 private:
161  float m_sizeMagLim;
162 };
163 
164 #endif // SKYPAINTER_H
SkyPainter::drawSkyLine
virtual void drawSkyLine(SkyPoint *a, SkyPoint *b)=0
Draw a line between points in the sky.
SkyPainter::drawPointSource
virtual bool drawPointSource(SkyPoint *loc, float mag, char sp= 'A')=0
Draw a point source (e.g., a star).
SkyPainter::setBrush
virtual void setBrush(const QBrush &brush)=0
Set the brush of the painter.
SkyPainter::drawSkyBackground
virtual void drawSkyBackground()=0
Draw the sky background.
LineListLabel
Definition: linelistlabel.h:36
typedef.h
SkyPainter::begin
virtual void begin()=0
Begin painting.
SkyPainter::m_sm
SkyMap * m_sm
Definition: skypainter.h:158
LineList
Definition: linelist.h:35
SkyPainter::drawObservingList
virtual void drawObservingList(const QList< SkyObject * > &obs)=0
Draw the symbols for the observing list.
SkyPainter::drawFlags
virtual void drawFlags()=0
Draw flags.
SkyPoint
The sky coordinates of a point in the sky.
Definition: skypoint.h:50
SkyPainter::starWidth
float starWidth(float mag) const
Get the width of a star of magnitude mag.
Definition: skypainter.cpp:50
KSComet
A subclass of KSPlanetBase that implements comets.
Definition: kscomet.h:50
Supernova
Represents the supernova object.
Definition: supernova.h:44
SkyPainter::drawPlanet
virtual bool drawPlanet(KSPlanetBase *planet)=0
Draw a planet.
SkyPainter::end
virtual void end()=0
End and finalize painting.
SkyPainter::setSizeMagLimit
void setSizeMagLimit(float sizeMagLim)
Definition: skypainter.cpp:45
SkyPainter::drawHorizon
virtual void drawHorizon(bool filled, SkyPoint *labelPoint=0, bool *drawLabel=0)=0
SkyPainter::drawSupernova
virtual bool drawSupernova(Supernova *sup)=0
Draw a Supernova.
KSAsteroid
A subclass of KSPlanetBase that implements asteroids.
Definition: ksasteroid.h:48
SkyPainter::setPen
virtual void setPen(const QPen &pen)=0
Set the pen of the painter.
DeepSkyObject
Provides all necessary information about a deep-sky object: data inherited from SkyObject (coordinate...
Definition: deepskyobject.h:43
SkyPainter::drawSkyPolygon
virtual void drawSkyPolygon(LineList *list)=0
Draw a polygon in the sky.
TrailObject
provides a SkyObject with an attachable Trail
Definition: trailobject.h:33
SkyMap
This is the canvas on which the sky is painted.
Definition: skymap.h:72
SkyPainter::SkyPainter
SkyPainter()
Constructor.
Definition: skypainter.cpp:34
Satellite
Represents an artificial satellites.
Definition: satellite.h:35
KSPlanetBase
A subclass of TrailObject that provides additional information needed for most solar system objects...
Definition: ksplanetbase.h:63
SkyPainter::drawSatellite
virtual void drawSatellite(Satellite *sat)=0
Draw a satellite.
SkyObject
Provides all necessary information about an object in the sky: its coordinates, name(s), type, magnitude, and QStringLists of URLs for images and webpages regarding the object.
Definition: skyobject.h:46
SkyPainter
Draws things on the sky, without regard to backend.
Definition: skypainter.h:47
SkyPainter::~SkyPainter
virtual ~SkyPainter()
Destructor.
Definition: skypainter.cpp:40
SkipList
Definition: SkipList.h:17
SkyPainter::drawSkyPolyline
virtual void drawSkyPolyline(LineList *list, SkipList *skipList=0, LineListLabel *label=0)=0
Draw a polyline in the sky.
SkyPainter::drawDeepSkyObject
virtual bool drawDeepSkyObject(DeepSkyObject *obj, bool drawImage=false)=0
Draw a deep sky object.
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