Kstars

fitslabel.h
1/*
2 SPDX-FileCopyrightText: 2003-2017 Jasem Mutlaq <mutlaqja@ikarustech.com>
3 SPDX-FileCopyrightText: 2016-2017 Robert Lancaster <rlancaste@gmail.com>
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
17class FITSView;
18
19class QMouseEvent;
20class QString;
21
22class FITSLabel : public QLabel
23{
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 highlightSelected(int x, int y);
69 void markerSelected(int x, int y);
70 void rectangleSelected(QPoint p1, QPoint p2,bool refreshCenter);
71 void circleSelected(QPoint p1, QPoint p2);
72 void mouseOverPixel(int x, int y);
73};
An angle, stored as degrees, but expressible in many ways.
Definition dms.h:38
Q_OBJECTQ_OBJECT
QObject * parent() const const
This file is part of the KDE documentation.
Documentation copyright © 1996-2024 The KDE developers.
Generated on Sat Dec 21 2024 17:04:46 by doxygen 1.12.0 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.