7#include "skyqpainter.h"
11#include "kstarsdata.h"
15#include "projections/projector.h"
16#include "skycomponents/flagcomponent.h"
17#include "skycomponents/linelist.h"
18#include "skycomponents/linelistlabel.h"
19#include "skycomponents/satellitescomponent.h"
20#include "skycomponents/skiphashlist.h"
21#include "skycomponents/skymapcomposite.h"
22#include "skycomponents/solarsystemcomposite.h"
23#include "skycomponents/earthshadowcomponent.h"
24#include "skycomponents/imageoverlaycomponent.h"
25#include "skyobjects/skyobject.h"
26#include "skyobjects/constellationsart.h"
27#include "skyobjects/catalogobject.h"
28#include "skyobjects/ksasteroid.h"
29#include "skyobjects/kscomet.h"
30#include "skyobjects/kssun.h"
31#include "skyobjects/ksmoon.h"
32#include "skyobjects/satellite.h"
33#include "skyobjects/supernova.h"
34#include "skyobjects/ksearthshadow.h"
36#include "skyobjects/mosaictiles.h"
38#include "hips/hipsrenderer.h"
39#include "terrain/terrainrenderer.h"
40#include <QElapsedTimer>
41#include "auxiliary/rectangleoverlap.h"
47int harvardToIndex(
char c)
79const int nStarSizes = 15;
82const int nSPclasses = 7;
87QPixmap *imageCache[nSPclasses][nStarSizes] = { {
nullptr } };
89std::unique_ptr<QPixmap> visibleSatPixmap, invisibleSatPixmap;
92int SkyQPainter::starColorMode = 0;
98 for (
char &color : ColorMap.keys())
100 QPixmap **pmap = imageCache[harvardToIndex(color)];
102 for (
int size = 1; size < nStarSizes; size++)
107 pmap[size] =
nullptr;
117 m_hipsRender =
new HIPSRenderer();
125 m_hipsRender =
new HIPSRenderer();
132 m_pd = (pd ? pd : widget);
133 m_size = widget->
size();
134 m_hipsRender =
new HIPSRenderer();
137SkyQPainter::~SkyQPainter()
139 delete (m_hipsRender);
142void SkyQPainter::setSize(
int width,
int height)
144 m_size.setWidth(width);
145 m_size.setHeight(height);
151 bool aa = !SkyMap::Instance()->isSlewing() && Options::useAntialias();
154 m_proj = SkyMap::Instance()->projector();
165double circleOverlap(
double d,
double radius1,
double radius2)
168 const double r1 = (radius1 >= radius2) ? radius1 : radius2;
170 const double r2 = (radius1 >= radius2) ? radius2 : radius1;
177 if (d == 0 || r2 + d <= r1)
178 return M_PI * r2 * r2;
181 if (r1 <= 0 || r2 <= 0 || d < 0)
185 const double d1 = (r1 * r1 - r2 * r2 + d * d) / (2 * d);
186 const double d2 = d - d1;
187 const double intersection =
188 r1 * r1 * acos(d1 / r1) - d1 * sqrt(r1 * r1 - d1 * d1) +
189 r2 * r2 * acos(d2 / r2) - d2 * sqrt(r2 * r2 - d2 * d2);
195QColor SkyQPainter::skyColor()
const
198 QColor sky = nightSky;
199 if (Options::simulateDaytime())
201 KSSun *sun = KStarsData::Instance()->
skyComposite()->solarSystemComposite()->sun();
204 const double nightFraction = sun->nightFraction();
205 const double dayFraction = 1 - nightFraction;
207 sky = QColor(nightFraction * nightSky.
red() + dayFraction * daySky.
red(),
208 nightFraction * nightSky.
green() + dayFraction * daySky.
green(),
209 nightFraction * nightSky.
blue() + dayFraction * daySky.
blue());
212 const KSMoon *moon = KStarsData::Instance()->
skyComposite()->solarSystemComposite()->moon();
216 const double sunRadius = sun->
angSize() * 0.5 / 60.0;
217 const double moonRadius = moon->
angSize() * 0.5 / 60.0;
218 if (separation < sunRadius + moonRadius)
222 if (moonRadius >= separation + sunRadius)
228 const double sunArea = M_PI * sunRadius * sunRadius;
229 const double overlapArea = circleOverlap(separation, moonRadius, sunRadius);
230 const double sunFraction = (sunArea - overlapArea) / sunArea;
231 if (sunFraction <= .05)
233 const double dayFraction = sunFraction / .05;
234 const double nightFraction = 1 - dayFraction;
235 sky = QColor(dayFraction * sky.
red() + nightFraction * nightSky.
red(),
236 dayFraction * sky.
green() + nightFraction * nightSky.
green(),
237 dayFraction * sky.
blue() + nightFraction * nightSky.
blue());
250 fillRect(0, 0, m_size.width(), m_size.height(), skyColor());
265 const int starColorIntensity = Options::starColorIntensity();
268 switch (Options::starColorMode())
291 if (ColorMap.isEmpty())
293 ColorMap.insert(
'O', m_starColor);
294 ColorMap.insert(
'B', m_starColor);
295 ColorMap.insert(
'A', m_starColor);
296 ColorMap.insert(
'F', m_starColor);
297 ColorMap.insert(
'G', m_starColor);
298 ColorMap.insert(
'K', m_starColor);
299 ColorMap.insert(
'M', m_starColor);
302 for (
char &color : ColorMap.keys())
310 if (Options::starColorMode() == 0)
312 #if QT_VERSION >= QT_VERSION_CHECK(6, 0, 0)
318 QColor starColor = ColorMap[color];
319 starColor.
getHsvF(&h, &s, &v, &a);
320 for (
int i = 0; i < 8; i++)
322 for (
int j = 0; j < 8; j++)
326 qreal dist = sqrt(x * x + y * y) / 7.0;
330 dist < (10 - starColorIntensity) / 10.0 ? 0 : dist),
333 dist < (10 - starColorIntensity) / 20.0 ? 1 : 1 - dist));
352 QPixmap **pmap = imageCache[harvardToIndex(color)];
354 for (
int size = 1; size < nStarSizes; size++)
362 starColorMode = Options::starColorMode();
364 if (!visibleSatPixmap.get())
365 visibleSatPixmap.reset(
new QPixmap(
":/icons/kstars_satellites_visible.svg"));
366 if (!invisibleSatPixmap.get())
367 invisibleSatPixmap.reset(
new QPixmap(
":/icons/kstars_satellites_invisible.svg"));
372 bool aVisible, bVisible;
373 QPointF aScreen = m_proj->toScreen(a,
true, &aVisible);
374 QPointF bScreen = m_proj->toScreen(b,
true, &bVisible);
397 LineListLabel * label)
399 SkyList *points = list->points();
400 bool isVisible, isVisibleLast;
402 if (points->size() == 0)
404 QPointF oLast = m_proj->toScreen(points->first().get(),
true, &isVisibleLast);
406 isVisibleLast &= m_proj->checkVisibility(points->first().get());
409 for (
int j = 1; j < points->size(); j++)
411 SkyPoint *pThis = points->at(j).get();
413 oThis2 = oThis = m_proj->toScreen(pThis,
true, &isVisible);
415 isVisible &= m_proj->checkVisibility(pThis);
419 doSkip = skipList->skip(j);
422 bool pointsVisible =
false;
424 if (SkyMap::Instance()->projector()->type() == Projector::Gnomonic)
426 if (isVisible && isVisibleLast)
427 pointsVisible =
true;
431 if (isVisible || isVisibleLast)
432 pointsVisible =
true;
441 label->updateLabelCandidates(oThis.
x(), oThis.
y(), list, j);
446 isVisibleLast = isVisible;
452 bool isVisible =
false, isVisibleLast;
453 SkyList *points = list->points();
456 if (forceClip ==
false)
458 for (
const auto &point : *points)
460 polygon << m_proj->toScreen(point.get(),
false, &isVisibleLast);
461 isVisible |= isVisibleLast;
465 if (polygon.
size() && isVisible)
471 SkyPoint *pLast = points->last().get();
472 QPointF oLast = m_proj->toScreen(pLast,
true, &isVisibleLast);
474 isVisibleLast &= m_proj->checkVisibility(pLast);
476 for (
const auto &point : *points)
479 QPointF oThis = m_proj->toScreen(pThis,
true, &isVisible);
481 isVisible &= m_proj->checkVisibility(pThis);
483 if (isVisible && isVisibleLast)
487 else if (isVisibleLast)
489 QPointF oMid = m_proj->clipLine(pLast, pThis);
494 QPointF oMid = m_proj->clipLine(pThis, pLast);
501 isVisibleLast = isVisible;
510 if (!m_proj->checkVisibility(planet))
513 bool visible =
false;
514 QPointF pos = m_proj->toScreen(planet,
true, &visible);
515 if (!visible || !m_proj->onScreen(pos))
518 float fakeStarSize = (10.0 + log10(Options::zoomFactor()) - log10(MINZOOM)) *
519 (10 - planet->
mag()) / 10;
520 if (fakeStarSize > 15.0)
523 double size = planet->
angSize() *
dms::PI * Options::zoomFactor() / 10800.0;
524 if (size < fakeStarSize && planet->name() !=
i18n(
"Sun") &&
534 else if (planet->
name() ==
i18n(
"Jupiter") || planet->
name() ==
i18n(
"Mercury") ||
550 if (planet->
name() ==
i18n(
"Sun")) size = size * Options::sunScale();
551 if (planet->
name() ==
i18n(
"Moon")) size = size * Options::moonScale();
556 if (Options::showPlanetImages() && !planet->
image().
isNull())
559 if (planet->
name() ==
"Saturn")
560 size = int(2.5 * size);
562 else if (planet->
name() ==
"Pluto")
563 size = int(size * exp(1.5 * size));
567 rotate(m_proj->findPA(planet, pos.
x(), pos.
y()));
575 auto keepBrush =
brush();
576 auto keepPen =
pen();
600 if (!m_proj->checkVisibility(shadow))
603 bool visible =
false;
604 QPointF pos = m_proj->toScreen(shadow,
true, &visible);
611 double penumbra_size =
626 if (!m_proj->checkVisibility(com))
634 bool visible =
false;
635 QPointF pos = m_proj->toScreen(com,
true, &visible);
638 if (visible && m_proj->onScreen(pos))
647 if (Options::showCometComas() && comaLength > size)
650 KStarsData::Instance()->skyComposite()->solarSystemComposite()->sun();
653 double comaAngle = m_proj->
findPA(sun, pos.
x(), pos.
y());
657 QPoint(pos.
x(), pos.
y() + comaLength)
694 if (!m_proj->checkVisibility(ast))
699 bool visible =
false;
700 QPointF pos = m_proj->toScreen(ast,
true, &visible);
702 if (visible && m_proj->onScreen(pos))
719 if (!m_proj->checkVisibility(loc))
722 bool visible =
false;
723 QPointF pos = m_proj->toScreen(loc,
true, &visible);
725 if (visible && m_proj->onScreen(pos))
738 int isize = qMin(
static_cast<int>(size), 14);
739 if (!m_vectorStars || starColorMode == 0)
742 QPixmap *im = imageCache[harvardToIndex(sp)][isize];
743 float offset = 0.5 * im->
width();
749 if (starColorMode != 4)
766 drawEllipse(pos.
x() - 0.5 * size, pos.
y() - 0.5 * size,
int(size),
int(size));
774 double zoom = Options::zoomFactor();
776 bool visible =
false;
778 KStarsData::Instance()->geo()->lat());
779 QPointF constellationmidpoint = m_proj->toScreen(obj,
true, &visible);
781 if (!visible || !m_proj->onScreen(constellationmidpoint))
785 float positionangle =
786 m_proj->findPA(obj, constellationmidpoint.
x(), constellationmidpoint.
y());
798 if (m_proj->viewParams().mirror)
812bool SkyQPainter::drawMosaicPanel(MosaicTiles * obj)
814 bool visible =
false;
816 KStarsData::Instance()->geo()->lat());
819 if (!visible || !m_proj->
onScreen(tileMid) || !obj->isValid())
825 const auto mirror = m_proj->viewParams().mirror;
826 auto PA = (obj->positionAngle() < 0) ? obj->positionAngle() + 360 : obj->positionAngle();
827 auto finalPA = m_proj->
findNorthPA(obj, tileMid.
x(), tileMid.
y()) - (mirror ? -PA : PA);
844 if (useCache && m_HiPSImage)
852 bool rendered = m_hipsRender->render(w, h, m_HiPSImage.data(), m_proj);
866 TerrainRenderer *renderer = TerrainRenderer::Instance();
867 bool rendered = renderer->render(w, h, terrainImage, m_proj);
871 delete (terrainImage);
878 if (!Options::showImageOverlays())
881 constexpr int minDisplayDimension = 5;
884 auto localTime = KStarsData::Instance()->geo()->UTtoLT(KStarsData::Instance()->clock()->utc());
887 const double vw = view.width, vh = view.height;
893 for (
const ImageOverlay &o : *imageOverlays)
895 if (o.m_Status != ImageOverlay::AVAILABLE || o.m_Img.get() ==
nullptr)
898 double orientation = o.m_Orientation, ra = o.m_RA, dec = o.m_DEC,
scale = o.m_ArcsecPerPixel;
899 const int origWidth = o.m_Width, origHeight = o.m_Height;
906 const dms raDms(ra), decDms(dec);
912 const double a = origWidth *
scale / 60.0;
913 const double zoom = Options::zoomFactor();
916 const double w = a *
dms::PI * zoom / 10800.0;
917 const double h = w * origHeight / origWidth;
918 const double maxDimension = std::max(w, h);
919 if (maxDimension < minDisplayDimension)
923 QPointF pos = m_proj->toScreen(&coord,
true, &visible);
924 if (!visible || isnan(pos.
x()) || isnan(pos.
y()))
927 const auto PA = (orientation < 0) ? orientation + 360 : orientation;
928 const auto mirror = m_proj->viewParams().mirror;
929 const auto finalPA = m_proj->findNorthPA(&coord, pos.
x(), pos.
y()) - (mirror ? -PA : PA);
938 this->
scale(-1., 1.);
951 const auto &image = obj.
image();
956 double zoom = Options::zoomFactor();
957 double w = obj.
a() *
dms::PI * zoom / 10800.0;
958 double h = obj.
e() * w;
969 if (!m_proj->checkVisibility(&obj))
972 bool visible =
false;
973 QPointF pos = m_proj->toScreen(&obj,
true, &visible);
974 if (!visible || !m_proj->onScreen(pos))
979 float majorAxis = obj.
a();
980 if (majorAxis == 0.0)
985 float size = majorAxis *
dms::PI * Options::zoomFactor() / 10800.0;
987 const auto mirror = m_proj->viewParams().mirror;
988 const auto positionAngle = m_proj->findNorthPA(&obj, pos.
x(), pos.
y())
989 - (mirror ? -obj.
pa() : obj.
pa())
993 if (Options::showInlineImages() && Options::zoomFactor() > 5. * MINZOOM &&
994 !Options::showHIPS())
995 drawCatalogObjectImage(pos, obj, positionAngle);
998 drawDeepSkySymbol(pos, obj.
type(), size, obj.
e(), positionAngle);
1003void SkyQPainter::drawDeepSkySymbol(
const QPointF &pos,
int type,
float size,
float e,
1004 float positionAngle)
1008 float zoom = Options::zoomFactor();
1010 int isize = int(size);
1012 float dx1 = -0.5 * size;
1013 float dx2 = 0.5 * size;
1014 float dy1 = -1.0 * e * size / 2.;
1015 float dy2 = e * size / 2.;
1021 float dxa = -size / 4.;
1022 float dxb = size / 4.;
1023 float dya = -1.0 * e * size / 4.;
1024 float dyb = e * size / 4.;
1036 std::function<void(
float,
float,
float,
float)> lambdaDrawEllipse;
1037 std::function<void(
float,
float,
float,
float)> lambdaDrawLine;
1038 std::function<void(
float,
float,
float,
float)> lambdaDrawCross;
1040 if (Options::useAntialias())
1042 lambdaDrawEllipse = [
this](
float x,
float y,
float width,
float height)
1046 lambdaDrawLine = [
this](
float x1,
float y1,
float x2,
float y2)
1050 lambdaDrawCross = [
this](
float centerX,
float centerY,
float sizeX,
float sizeY)
1053 QLineF(centerX - sizeX / 2., centerY, centerX + sizeX / 2., centerY));
1055 QLineF(centerX, centerY - sizeY / 2., centerX, centerY + sizeY / 2.));
1060 lambdaDrawEllipse = [
this](
float x,
float y,
float width,
float height)
1064 lambdaDrawLine = [
this](
float x1,
float y1,
float x2,
float y2)
1068 lambdaDrawCross = [
this](
float centerX,
float centerY,
float sizeX,
float sizeY)
1070 drawLine(QLine(centerX - sizeX / 2., centerY, centerX + sizeX / 2., centerY));
1071 drawLine(QLine(centerX, centerY - sizeY / 2., centerX, centerY + sizeY / 2.));
1077 case SkyObject::STAR:
1078 case SkyObject::CATALOG_STAR:
1082 lambdaDrawEllipse(x - size / 2., y - size / 2., size, size);
1084 case SkyObject::PLANET:
1086 case SkyObject::OPEN_CLUSTER:
1087 case SkyObject::ASTERISM:
1089 tempBrush =
brush();
1097 auto putDot = [psize, &lambdaDrawEllipse](
float x,
float y)
1099 lambdaDrawEllipse(x - psize / 2., y - psize / 2., psize, psize);
1112 case SkyObject::GLOBULAR_CLUSTER:
1119 lambdaDrawEllipse(dx1, dy1, size, e * size);
1120 lambdaDrawCross(0, 0, size, e * size);
1124 case SkyObject::GASEOUS_NEBULA:
1125 case SkyObject::DARK_NEBULA:
1130 lambdaDrawLine(dx1, dy1, dx2, dy1);
1131 lambdaDrawLine(dx2, dy1, dx2, dy2);
1132 lambdaDrawLine(dx2, dy2, dx1, dy2);
1133 lambdaDrawLine(dx1, dy2, dx1, dy1);
1136 case SkyObject::PLANETARY_NEBULA:
1143 lambdaDrawEllipse(dx1, dy1, size, e * size);
1144 lambdaDrawLine(0., dy1, 0., dy1 - e * size / 2.);
1145 lambdaDrawLine(0., dy2, 0., dy2 + e * size / 2.);
1146 lambdaDrawLine(dx1, 0., dx1 - size / 2., 0.);
1147 lambdaDrawLine(dx2, 0., dx2 + size / 2., 0.);
1150 case SkyObject::SUPERNOVA_REMNANT:
1155 lambdaDrawLine(0., dy1, dx2, 0.);
1156 lambdaDrawLine(dx2, 0., 0., dy2);
1157 lambdaDrawLine(0., dy2, dx1, 0.);
1158 lambdaDrawLine(dx1, 0., 0., dy1);
1161 case SkyObject::GALAXY:
1162 case SkyObject::QUASAR:
1164 if (size < 1. && zoom > 20 * MINZOOM)
1166 if (size < 1. && zoom > 5 * MINZOOM)
1173 lambdaDrawEllipse(dx1, dy1, size, e * size);
1181 case SkyObject::GALAXY_CLUSTER:
1183 tempBrush =
brush();
1189 QPen newPen =
pen();
1192 lambdaDrawEllipse(dx1, dy1, size, e * size);
1200 if (size < 1. && zoom > 20 * MINZOOM)
1202 if (size < 1. && zoom > 5 * MINZOOM)
1208 const QString qMark =
" ? ";
1210#if QT_VERSION >= QT_VERSION_CHECK(5, 11, 0)
1213 double scaleFactor = 0.8 * size /
fontMetrics().width(qMark);
1216 f.setPointSizeF(f.pointSizeF() * scaleFactor);
1220 lambdaDrawEllipse(dx1, dy1, size, e * size);
1221 if (Options::useAntialias())
1225 int idx1 = int(dx1);
1226 int idy1 = int(dy1);
1234 if (Options::useAntialias())
1246 bool visible =
false;
1247 QPointF o = m_proj->toScreen(obj,
true, &visible);
1248 if (!visible || !m_proj->onScreen(o))
1252 float x1 = o.
x() - 0.5 * size;
1253 float y1 = o.
y() - 0.5 * size;
1262 std::shared_ptr<SkyPoint> point;
1264 bool visible =
false;
1267 for (
int i = 0; i < data->
skyComposite()->flags()->size(); i++)
1273 point->EquatorialToHorizontal(data->
lst(), data->
geo()->
lat());
1276 pos = m_proj->toScreen(point.get(),
true, &visible);
1279 if (!visible || !m_proj->onScreen(pos))
1292void SkyQPainter::drawHorizon(
bool filled,
SkyPoint * labelPoint,
bool * drawLabel)
1298 for (
int i = 0; i < ground.
size(); ++i)
1299 groundPoly[i] = KSUtils::vecToPoint(ground[i]);
1304 groundPoly.append(groundPoly.first());
1312 if (!m_proj->checkVisibility(sat))
1316 bool visible =
false;
1320 pos = m_proj->toScreen(sat,
true, &visible);
1322 if (!visible || !m_proj->onScreen(pos))
1325 if (Options::drawSatellitesLikeStars())
1352 if (!m_proj->checkVisibility(sup))
1357 bool visible =
false;
1358 QPointF pos = m_proj->toScreen(sup,
true, &visible);
1361 if (!visible || !m_proj->onScreen(pos))
A simple container object to hold the minimum information for a Deep Sky Object to be drawn on the sk...
std::pair< bool, const QImage & > image() const
Get the image for this object.
double pa() const override
QColor colorNamed(const QString &name) const
Retrieve a color by name.
Information about a ConstellationsArt object.
QColor labelColor(int index)
Get label color.
QString label(int index)
Get label.
QImage image(int index)
Get image.
const CachingDms * lat() const
A subclass of KSPlanetBase that implements asteroids.
A subclass of KSPlanetBase that implements comets.
A class that manages the calculation of the earths shadow (in moon distance) as a 'virtual' skyobject...
double getPenumbraAngSize() const
double getUmbraAngSize() const
A subclass of TrailObject that provides additional information needed for most solar system objects.
const QImage & image() const
void findPA(const KSNumbers *num)
Determine the position angle of the planet for a given date (used internally by findPosition() )
Child class of KSPlanetBase; encapsulates information about the Sun.
KStarsData is the backbone of KStars.
ColorScheme * colorScheme()
SkyMapComposite * skyComposite()
static KStars * Instance()
A simple data container used by LineListIndex.
QPointF toScreen(const SkyPoint *o, bool oRefract=true, bool *onVisibleHemisphere=nullptr) const
This is exactly the same as toScreenVec but it returns a QPointF.
bool onScreen(const QPointF &p) const
Check whether the projected point is on-screen.
double findNorthPA(const SkyPoint *o, float x, float y) const
Determine the on-screen position angle of a SkyPont with recept with NCP.
virtual QVector< Eigen::Vector2f > groundPoly(SkyPoint *labelpoint=nullptr, bool *drawLabel=nullptr) const
Get the ground polygon.
This class checks if two rectangles overlap.
bool intersects(const QPointF ¢er, int width, int height, double rotationDegrees=0.0) const
Check if the input rectangle overlaps the reference rectangle.
Represents an artificial satellites.
Provides all necessary information about an object in the sky: its coordinates, name(s),...
virtual QString name(void) const
TYPE
The type classification of the SkyObject.
float starWidth(float mag) const
Get the width of a star of magnitude mag.
The sky coordinates of a point in the sky.
void apparentCoord(long double jd0, long double jdf)
Computes the apparent coordinates for this SkyPoint for any epoch, accounting for the effects of prec...
dms angularDistanceTo(const SkyPoint *sp, double *const positionAngle=nullptr) const
Computes the angular distance between two SkyObjects.
void EquatorialToHorizontal(const CachingDms *LST, const CachingDms *lat)
Determine the (Altitude, Azimuth) coordinates of the SkyPoint from its (RA, Dec) coordinates,...
bool drawAsteroid(KSAsteroid *ast) override
Draw an asteroid in the sky.
bool drawComet(KSComet *com) override
Draw a comet in the sky.
void end() override
End and finalize painting.
SkyQPainter(QPaintDevice *pd, const QSize &canvasSize)
Creates a SkyQPainter with the given QPaintDevice and uses the dimensions of the paint device as canv...
bool drawPlanet(KSPlanetBase *planet) override
Draw a planet.
bool drawPointSource(const SkyPoint *loc, float mag, char sp='A') override
Draw a point source (e.g., a star).
void drawSkyLine(SkyPoint *a, SkyPoint *b) override
Draw a line between points in the sky.
bool drawImageOverlay(const QList< ImageOverlay > *imageOverlays, bool useCache=false) override
drawImageOverlay Draws a user-supplied image onto the skymap
void setBrush(const QBrush &brush) override
Set the brush of the painter.
void drawSkyPolyline(LineList *list, SkipHashList *skipList=nullptr, LineListLabel *label=nullptr) override
Draw a polyline in the sky.
bool drawTerrain(bool useCache=false) override
drawTerrain Draw the Terrain
void drawSkyPolygon(LineList *list, bool forceClip=true) override
Draw a polygon in the sky.
void drawSkyBackground() override
Draw the sky background.
bool drawCatalogObject(const CatalogObject &obj) override
Draw a deep sky object (loaded from the new implementation)
void drawObservingList(const QList< SkyObject * > &obs) override
Draw the symbols for the observing list.
static void initStarImages()
Recalculates the star pixmaps.
static void releaseImageCache()
Release the image cache.
void setPen(const QPen &pen) override
Set the pen of the painter.
bool drawEarthShadow(KSEarthShadow *shadow) override
Draw the earths shadow on the moon (red-ish)
bool drawConstellationArtImage(ConstellationsArt *obj) override
Draw a ConstellationsArt object.
void drawFlags() override
Draw flags.
bool drawSupernova(Supernova *sup) override
Draw a Supernova.
bool drawHips(bool useCache=false) override
drawMosaicPanel Draws mosaic panel in planning or operation mode.
bool drawSatellite(Satellite *sat) override
Draw a satellite.
void begin() override
Begin painting.
Represents the supernova object.
This is just a container that holds information needed to do projections.
An angle, stored as degrees, but expressible in many ways.
static constexpr double PI
PI is a const static member; it's public so that it can be used anywhere, as long as dms....
const double & Degrees() const
QString i18n(const char *text, const TYPE &arg...)
void getHsvF(float *h, float *s, float *v, float *a) const const
QString name(NameFormat format) const const
void setHsvF(float h, float s, float v, float a)
int horizontalAdvance(QChar ch) const const
void setColorAt(qreal position, const QColor &color)
bool isNull() const const
const_reference at(qsizetype i) const const
qsizetype size() const const
bool begin(QPaintDevice *device)
const QBrush & brush() const const
CompositionMode compositionMode() const const
void drawArc(const QRect &rectangle, int startAngle, int spanAngle)
void drawConvexPolygon(const QPoint *points, int pointCount)
void drawEllipse(const QPoint ¢er, int rx, int ry)
void drawImage(const QPoint &point, const QImage &image)
void drawLine(const QLine &line)
void drawPixmap(const QPoint &point, const QPixmap &pixmap)
void drawPoint(const QPoint &position)
void drawPolygon(const QPoint *points, int pointCount, Qt::FillRule fillRule)
void drawPolyline(const QPoint *points, int pointCount)
void drawText(const QPoint &position, const QString &text)
void fillRect(const QRect &rectangle, QGradient::Preset preset)
const QFont & font() const const
QFontMetrics fontMetrics() const const
const QPen & pen() const const
void scale(qreal sx, qreal sy)
void setBrush(Qt::BrushStyle style)
void setCompositionMode(CompositionMode mode)
void setFont(const QFont &font)
void setOpacity(qreal opacity)
void setPen(Qt::PenStyle style)
void setRenderHint(RenderHint hint, bool on)
void setRenderHints(RenderHints hints, bool on)
void translate(const QPoint &offset)
QRect viewport() const const
QColor color() const const
void setStyle(Qt::PenStyle style)
void fill(const QColor &color)
QPixmap scaled(const QSize &size, Qt::AspectRatioMode aspectRatioMode, Qt::TransformationMode transformMode) const const
QPoint toPoint() const const
QPoint point(int index) const const