• 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
skyglpainter.h
Go to the documentation of this file.
1 /*
2  Copyright (C) 2010 Henry de Valence <hdevalence@gmail.com>
3 
4  This program is free software; you can redistribute it and/or modify
5  it under the terms of the GNU General Public License as published by
6  the Free Software Foundation; either version 2 of the License, or
7  (at your option) any later version.
8 
9  This program is distributed in the hope that it will be useful,
10  but WITHOUT ANY WARRANTY; without even the implied warranty of
11  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12  GNU General Public License for more details.
13 
14  You should have received a copy of the GNU General Public License along
15  with this program; if not, write to the Free Software Foundation, Inc.,
16  51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
17 
18 */
19 
20 #ifndef SKYGLPAINTER_H
21 #define SKYGLPAINTER_H
22 
23 #include <cstddef>
24 #include <Eigen/Core>
25 USING_PART_OF_NAMESPACE_EIGEN
26 
27 #include "skypainter.h"
28 #include "skyobjects/skyobject.h"
29 #include "projections/projector.h"
30 
31 class QGLWidget;
32 
33 class SkyGLPainter : public SkyPainter
34 {
35 public:
36  explicit SkyGLPainter( QGLWidget *widget );
37  virtual bool drawPlanet(KSPlanetBase* planet);
38  virtual bool drawDeepSkyObject(DeepSkyObject* obj, bool drawImage = false);
39  virtual bool drawPointSource(SkyPoint* loc, float mag, char sp = 'A');
40  virtual void drawSkyPolygon(LineList* list);
41  virtual void drawSkyPolyline(LineList* list, SkipList* skipList = 0, LineListLabel* label = 0);
42  virtual void drawSkyLine(SkyPoint* a, SkyPoint* b);
43  virtual void drawSkyBackground();
44  virtual void drawObservingList(const QList<SkyObject*>& obs);
45  virtual void drawFlags();
46  virtual void end();
47  virtual void begin();
48  virtual void setBrush(const QBrush& brush);
49  virtual void setPen(const QPen& pen);
50  virtual void drawHorizon( bool filled, SkyPoint *labelPoint = 0, bool *drawLabel = 0);
51  virtual void drawSatellite( Satellite* sat );
52  virtual bool drawSupernova(Supernova* sup);
53  void drawText( int x, int y, const QString text, QFont font, QColor color );
54 private:
55  bool addItem(SkyPoint* p, int type, float width, char sp = 'a');
56  void drawBuffer(int type);
57  void drawPolygon(const QVector< Vector2f >& poly, bool convex = true, bool flush_buffers = true);
58 
61  void drawTexturedRectangle( const QImage& img,
62  const Vector2f& pos, const float angle,
63  const float sizeX, const float sizeY );
64 
65  const Projector *m_proj;
66 
67  Vector4f m_pen;
68  static const int BUFSIZE = 512;
70  static const int NUMTYPES = (int)SkyObject::TYPE_UNKNOWN + 1;
71  static Vector2f m_vertex[NUMTYPES][6*BUFSIZE];
72  static Vector2f m_texcoord[NUMTYPES][6*BUFSIZE];
73  static Vector3f m_color[NUMTYPES][6*BUFSIZE];
74  static int m_idx[NUMTYPES];
75  static bool m_init;
76  QGLWidget* m_widget; // Pointer to (GL) widget on which we are painting
77 };
78 
79 #endif // SKYGLPAINTER_H
SkyGLPainter::SkyGLPainter
SkyGLPainter(QGLWidget *widget)
Definition: skyglpainter.cpp:63
SkyGLPainter::drawSupernova
virtual bool drawSupernova(Supernova *sup)
Draw a Supernova.
Definition: skyglpainter.cpp:739
SkyObject::TYPE_UNKNOWN
Definition: skyobject.h:112
LineListLabel
Definition: linelistlabel.h:36
skyobject.h
SkyGLPainter::drawFlags
virtual void drawFlags()
Draw flags.
Definition: skyglpainter.cpp:527
SkyGLPainter::drawHorizon
virtual void drawHorizon(bool filled, SkyPoint *labelPoint=0, bool *drawLabel=0)
Definition: skyglpainter.cpp:432
SkyGLPainter::end
virtual void end()
End and finalize painting.
Definition: skyglpainter.cpp:638
skypainter.h
LineList
Definition: linelist.h:35
SkyGLPainter::drawText
void drawText(int x, int y, const QString text, QFont font, QColor color)
Definition: skyglpainter.cpp:563
SkyPoint
The sky coordinates of a point in the sky.
Definition: skypoint.h:50
Projector
This class serves as an interface to handle projections.
Definition: projector.h:49
Supernova
Represents the supernova object.
Definition: supernova.h:44
SkyGLPainter::drawSkyPolygon
virtual void drawSkyPolygon(LineList *list)
Draw a polygon in the sky.
Definition: skyglpainter.cpp:347
SkyGLPainter::drawSkyBackground
virtual void drawSkyBackground()
Draw the sky background.
Definition: skyglpainter.cpp:630
SkyGLPainter::drawDeepSkyObject
virtual bool drawDeepSkyObject(DeepSkyObject *obj, bool drawImage=false)
Draw a deep sky object.
Definition: skyglpainter.cpp:276
QGLWidget
DeepSkyObject
Provides all necessary information about a deep-sky object: data inherited from SkyObject (coordinate...
Definition: deepskyobject.h:43
SkyGLPainter::drawSkyPolyline
virtual void drawSkyPolyline(LineList *list, SkipList *skipList=0, LineListLabel *label=0)
Draw a polyline in the sky.
Definition: skyglpainter.cpp:452
SkyGLPainter::drawPointSource
virtual bool drawPointSource(SkyPoint *loc, float mag, char sp= 'A')
Draw a point source (e.g., a star).
Definition: skyglpainter.cpp:340
SkyGLPainter::drawPlanet
virtual bool drawPlanet(KSPlanetBase *planet)
Draw a planet.
Definition: skyglpainter.cpp:232
projector.h
SkyGLPainter::drawSkyLine
virtual void drawSkyLine(SkyPoint *a, SkyPoint *b)
Draw a line between points in the sky.
Definition: skyglpainter.cpp:602
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
SkyGLPainter::setPen
virtual void setPen(const QPen &pen)
Set the pen of the painter.
Definition: skyglpainter.cpp:685
SkyGLPainter::drawObservingList
virtual void drawObservingList(const QList< SkyObject * > &obs)
Draw the symbols for the observing list.
Definition: skyglpainter.cpp:508
SkyGLPainter
Definition: skyglpainter.h:33
SkyGLPainter::drawSatellite
virtual void drawSatellite(Satellite *sat)
Draw a satellite.
Definition: skyglpainter.cpp:699
SkyPainter
Draws things on the sky, without regard to backend.
Definition: skypainter.h:47
SkyGLPainter::begin
virtual void begin()
Begin painting.
Definition: skyglpainter.cpp:645
SkyGLPainter::setBrush
virtual void setBrush(const QBrush &brush)
Set the brush of the painter.
Definition: skyglpainter.cpp:675
SkipList
Definition: SkipList.h:17
QList
This file is part of the KDE documentation.
Documentation copyright © 1996-2014 The KDE developers.
Generated on Tue Oct 14 2014 22:36:20 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