Kstars

skyglpainter.h
1/*
2 SPDX-FileCopyrightText: 2010 Henry de Valence <hdevalence@gmail.com>
3
4 SPDX-License-Identifier: GPL-2.0-or-later
5*/
6
7#ifndef SKYGLPAINTER_H
8#define SKYGLPAINTER_H
9
10#include <cstddef>
11#include <Eigen/Core>
12
13#include "skypainter.h"
14#include "skyobjects/skyobject.h"
15#include "projections/projector.h"
16
17class QGLWidget;
18
19class SkyGLPainter : public SkyPainter
20{
21 public:
22 explicit SkyGLPainter(QGLWidget *widget);
23 bool drawPlanet(KSPlanetBase *planet) override;
24 bool drawPointSource(const SkyPoint *loc, float mag, char sp = 'A') override;
25 void drawSkyPolygon(LineList *list, bool forceClip = true) override;
26 void drawSkyPolyline(LineList *list, SkipHashList *skipList = nullptr,
27 LineListLabel *label = nullptr) override;
28 void drawSkyLine(SkyPoint *a, SkyPoint *b) override;
29 void drawSkyBackground() override;
30 void drawObservingList(const QList<SkyObject *> &obs) override;
31 void drawFlags() override;
32 void end() override;
33 void begin() override;
34 void setBrush(const QBrush &brush) override;
35 void setPen(const QPen &pen) override;
36 void drawHorizon(bool filled, SkyPoint *labelPoint = nullptr,
37 bool *drawLabel = nullptr) override;
38 bool drawSatellite(Satellite *sat) override;
39 bool drawSupernova(Supernova *sup) override;
40 void drawText(int x, int y, const QString text, QFont font, QColor color);
41 bool drawConstellationArtImage(ConstellationsArt *obj) override;
42 bool drawHips(bool useCache = false) override;
43
44 private:
45 bool addItem(SkyPoint *p, int type, float width, char sp = 'a');
46 void drawBuffer(int type);
47 void drawPolygon(const QVector<Eigen::Vector2f> &poly, bool convex = true,
48 bool flush_buffers = true);
49
50 /** Render textured rectangle on screeen. Parameters are texture
51 * to be used, position, orientation and size of rectangle*/
52 void drawTexturedRectangle(const QImage &img, const Eigen::Vector2f &pos, const float angle,
53 const float sizeX, const float sizeY);
54
55 const Projector *m_proj;
56
57 Eigen::Vector4f m_pen;
58 static const int BUFSIZE = 512;
59 ///FIXME: what kind of TYPE_UNKNOWN objects are there?
60 static const int NUMTYPES = (int)SkyObject::TYPE_UNKNOWN + 1;
61 static Eigen::Vector2f m_vertex[NUMTYPES][6 * BUFSIZE];
62 static Eigen::Vector2f m_texcoord[NUMTYPES][6 * BUFSIZE];
63 static Eigen::Vector3f m_color[NUMTYPES][6 * BUFSIZE];
64 static int m_idx[NUMTYPES];
65 static bool m_init; ///< keep track of whether we have filled the texcoord array
66 QGLWidget *m_widget; // Pointer to (GL) widget on which we are painting
67};
68
69#endif // SKYGLPAINTER_H
Information about a ConstellationsArt object.
A subclass of TrailObject that provides additional information needed for most solar system objects.
A simple data container used by LineListIndex.
Definition linelist.h:25
The Projector class is the primary class that serves as an interface to handle projections.
Definition projector.h:58
Represents an artificial satellites.
Definition satellite.h:23
Draws things on the sky, without regard to backend.
Definition skypainter.h:40
The sky coordinates of a point in the sky.
Definition skypoint.h:45
Represents the supernova object.
Definition supernova.h:34
This file is part of the KDE documentation.
Documentation copyright © 1996-2024 The KDE developers.
Generated on Fri Dec 20 2024 11:53:00 by doxygen 1.12.0 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.