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 <[email protected]>
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 
15 class QPainter;
16 
17 class AlignView : public FITSView
18 {
19  Q_OBJECT
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,
27  bool extras, bool block = true);
28 
29  void drawOverlay(QPainter *, double scale) override;
30 
31  // Resets the marker and lines, celestial pole point and raAxis.
32  void reset();
33 
34  // Setup correction triangle
35  void setCorrectionParams(const QPointF &from, const QPointF &to, const QPointF &altTo);
36 
37  void setRaAxis(const QPointF &value);
38  void setCelestialPole(const QPointF &value);
39  void setRefreshEnabled(bool enable);
40 
41  // When non-null, alignview draws a small circle in the pixel position specified.
42  void setStarCircle(const QPointF &pixel = QPointF());
43 
44  void holdOnToImage();
45  void releaseImage();
46  const QSharedPointer<FITSData> keptImage() const
47  {
48  return keptImagePointer;
49  }
50 
51  protected:
52  // Draw the polar-align triangle which guides the user how to correct polar alignment.
53  void drawTriangle(QPainter *painter, const QPointF &from, const QPointF &to, const QPointF &altTo);
54  // Draws the mounts current RA axis (set in setRaAxis() above).
55  void drawRaAxis(QPainter *painter);
56  // Draw the circle around the star used to help the user correct polar alignment.
57  void drawStarCircle(QPainter *painter, const QPointF &center, double radius, const QColor &color);
58 
59  virtual void processMarkerSelection(int x, int y) override;
60 
61  private:
62  // Correction points. from=user-selected point. to=destination for the point.
63  // altTo = destination to correct altitude only.
64  QPointF correctionFrom, correctionTo, correctionAltTo;
65  // The celestial pole's position on the image.
66  QPointF celestialPolePoint;
67  // The mount's RA axis' position on the image.
68  QPointF raAxis;
69  QSharedPointer<FITSData> keptImagePointer;
70  // The position of a star being tracked in the polar-alignment routine.
71  QPointF starCircle;
72 
73  signals:
74  void newCorrectionVector(QLineF correctionVector);
75 };
Q_OBJECTQ_OBJECT
KGuiItem reset()
This file is part of the KDE documentation.
Documentation copyright © 1996-2022 The KDE developers.
Generated on Thu Aug 11 2022 03:59:55 by doxygen 1.8.17 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.