Kstars

fitslabel.h
1 /*
2  SPDX-FileCopyrightText: 2003-2017 Jasem Mutlaq <[email protected]>
3  SPDX-FileCopyrightText: 2016-2017 Robert Lancaster <[email protected]>
4 
5  SPDX-License-Identifier: GPL-2.0-or-later
6 */
7 
8 #pragma once
9 
10 #include "dms.h"
11 #include "fitscommon.h"
12 
13 #include <qpoint.h>
14 #include <QLabel>
15 #include <QRubberBand>
16 
17 class FITSView;
18 
19 class QMouseEvent;
20 class QString;
21 
22 class FITSLabel : public QLabel
23 {
24  Q_OBJECT
25  public:
26  explicit FITSLabel(FITSView *img, QWidget *parent = nullptr);
27  virtual ~FITSLabel() override = default;
28 
29  void setSize(double w, double h);
30  void centerTelescope(double raJ2000, double decJ2000);
31  bool getMouseButtonDown();
32  void updateROIToolTip(const QPoint p);
33 
34  public slots:
35  void setRubberBand(QRect rect);
36  void showRubberBand(bool on);
37  void zoomRubberBand(double scale);
38 
39  protected:
40  virtual void mouseMoveEvent(QMouseEvent *e) override;
41  virtual void mousePressEvent(QMouseEvent *e) override;
42  virtual void mouseReleaseEvent(QMouseEvent *e) override;
43  virtual void mouseDoubleClickEvent(QMouseEvent *e) override;
44  virtual void leaveEvent(QEvent *e) override;
45 
46  private:
47  bool mouseButtonDown { false };
48  bool isRoiSelected { false };
49  QPoint lastMousePoint;
50  FITSView *view { nullptr };
51  dms m_RA;
52  dms m_DE;
53  float prevscale{ 1.0 };
54  double m_Width { 0 };
55  double m_Height { 0 };
56  double m_Size { 0 };
57 
58  QPoint m_p1;
59  QPoint m_p2;
60  QRect diffRect;
61  QRubberBand *roiRB;
62  QPoint prevPoint;
63 
64 
65  signals:
66  void newStatus(const QString &msg, FITSBar id);
67  void pointSelected(int x, int y);
68  void markerSelected(int x, int y);
69  void rectangleSelected(QPoint p1, QPoint p2,bool refreshCenter);
70 };
Q_OBJECTQ_OBJECT
virtual void leaveEvent(QEvent *event)
virtual void mouseMoveEvent(QMouseEvent *ev) override
virtual void mousePressEvent(QMouseEvent *ev) override
An angle, stored as degrees, but expressible in many ways.
Definition: dms.h:37
virtual void mouseDoubleClickEvent(QMouseEvent *event)
virtual void mouseReleaseEvent(QMouseEvent *ev) override
This file is part of the KDE documentation.
Documentation copyright © 1996-2022 The KDE developers.
Generated on Fri Aug 19 2022 03:57:50 by doxygen 1.8.17 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.