Kstars

alignview.h
1/* Ekos Alignment View
2 Child of FITSView with few additions necessary for Alignment functions
3
4 SPDX-FileCopyrightText: 2017 Jasem Mutlaq <mutlaqja@ikarustech.com>
5
6 SPDX-License-Identifier: GPL-2.0-or-later
7*/
8
9#pragma once
10
11#include "fitsviewer/fitsview.h"
12
13#include <QVector3D>
14
15class QPainter;
16
17class AlignView : public FITSView
18{
20 public:
21 explicit AlignView(QWidget *parent = nullptr, FITSMode mode = FITS_NORMAL, FITSScale filter = FITS_NONE);
22
23 // Calculate WCS header info and update WCS info.
24 // If the expensive computations are not included, e.g. extras == false, then there's
25 // no reason to block (i.e. use the wcsWatcher). The computations are quick.
26 bool injectWCS(double orientation, double ra, double dec, double pixscale, bool eastToTheRight, bool block = true);
27
28 void drawOverlay(QPainter *, double scale) override;
29
30 // Resets the marker and lines, celestial pole point and raAxis.
31 void reset();
32
33 // Setup correction triangle
34 void setCorrectionParams(const QPointF &from, const QPointF &to, const QPointF &altTo);
35
36 void setRaAxis(const QPointF &value);
37 void setCelestialPole(const QPointF &value);
38 void setRefreshEnabled(bool enable);
39
40 // When non-null, alignview draws a small circle in the pixel position specified.
41 void setStarCircle(const QPointF &pixel = QPointF());
42
43 void holdOnToImage();
44 void releaseImage();
45 const QSharedPointer<FITSData> keptImage() const
46 {
47 return keptImagePointer;
48 }
49
50 protected:
51 // Draw the polar-align triangle which guides the user how to correct polar alignment.
52 void drawTriangle(QPainter *painter, const QPointF &from, const QPointF &to, const QPointF &altTo);
53 // Draws the mounts current RA axis (set in setRaAxis() above).
54 void drawRaAxis(QPainter *painter);
55 // Draw the circle around the star used to help the user correct polar alignment.
56 void drawStarCircle(QPainter *painter, const QPointF &center, double radius, const QColor &color);
57
58 virtual void processMarkerSelection(int x, int y) override;
59
60 private:
61 // Correction points. from=user-selected point. to=destination for the point.
62 // altTo = destination to correct altitude only.
63 QPointF correctionFrom, correctionTo, correctionAltTo;
64 // The celestial pole's position on the image.
65 QPointF celestialPolePoint;
66 // The mount's RA axis' position on the image.
67 QPointF raAxis;
68 QSharedPointer<FITSData> keptImagePointer;
69 // The position of a star being tracked in the polar-alignment routine.
70 QPointF starCircle;
71
72 signals:
73 void newCorrectionVector(QLineF correctionVector);
74};
Q_OBJECTQ_OBJECT
QObject * parent() const const
This file is part of the KDE documentation.
Documentation copyright © 1996-2024 The KDE developers.
Generated on Mon Nov 4 2024 16:38:42 by doxygen 1.12.0 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.