Kstars

starprofileviewer.h
1/*
2 SPDX-FileCopyrightText: 2017 Robert Lancaster <rlancaste@gmail.com>
3
4 Based on the QT Surface Example https://doc.qt.io/qt-5.9/qtdatavisualization-surface-example.html
5 and the QT Bars Example https://doc-snapshots.qt.io/qt5-5.9/qtdatavisualization-bars-example.html
6
7 SPDX-License-Identifier: GPL-2.0-or-later
8*/
9
10#pragma once
11
12#include "fitsdata.h"
13
14#include <QtDataVisualization/qbar3dseries.h>
15#include <QtDataVisualization/qbardataproxy.h>
16#include <QtDataVisualization/q3dbars.h>
17#include <QtDataVisualization/QCustom3DLabel>
18
19#include <QCheckBox>
20#include <QComboBox>
21#include <QDial>
22#include <QDialog>
23#include <QGroupBox>
24#include <QHBoxLayout>
25#include <QImage>
26#include <QLabel>
27#include <QMessageBox>
28#include <QPainter>
29#include <QPushButton>
30#include <QRadioButton>
31#include <QScreen>
32#include <QSlider>
33#include <QVBoxLayout>
34#include <QWidget>
35
36#include <QtDataVisualization/QValue3DAxis>
37#include <QtDataVisualization/Q3DTheme>
38#include <QtDataVisualization/qabstract3dseries.h>
39#include <qmath.h>
40
41#if QT_VERSION < QT_VERSION_CHECK(6, 0, 0)
42using namespace QtDataVisualization;
43#endif
44
45class StarProfileViewer : public QDialog
46{
48public:
49 explicit StarProfileViewer(QWidget *parent);
50 ~StarProfileViewer();
51
52 void setBlackToYellowGradient();
53 void setGreenToRedGradient();
54
55 void loadData(QSharedPointer<FITSData> imageData, QRect sub, QList<Edge *> starCenters);
56 template <typename T> void loadDataPrivate();
57 float getImageDataValue(int x, int y);
58 void toggleSlice();
59 void updateVerticalAxis();
60 void updateHFRandPeakSelection();
61 void updateDisplayData();
62 void updateScale();
63 void enableTrackingBox(bool enable);
64 void changeSelection();
65 void updateSelectorBars(QPoint position);
66 void toggleCutoffEnabled(bool enable);
67
68public slots:
69 void changeSelectionType(int type);
70 void zoomViewTo(int where);
71 void updateSampleSize(const QString &text);
72 void updateColor(int selection);
73 void updateBarSpacing(int value);
74
75signals:
76 void sampleSizeUpdated(int size);
77private:
78 Q3DBars *m_graph { nullptr };
79 QValue3DAxis *m_pixelValueAxis { nullptr };
80 QCategory3DAxis *m_xPixelAxis { nullptr };
81 QCategory3DAxis *m_yPixelAxis { nullptr };
82 QBar3DSeries *m_3DPixelSeries { nullptr };
83
84 QBarDataArray *dataSet { nullptr };
85
86 template <typename T>
87 float getImageDataValue(int x, int y);
88 void getSubFrameMinMax(float *subFrameMin, float *subFrameMax, double *dataMin, double *dataMax);
89
90 template <typename T>
91 void getSubFrameMinMax(float *subFrameMin, float *subFrameMax);
92
93 QPushButton *HFRReport { nullptr };
94 QLabel *reportBox { nullptr };
95 QPushButton *showPeakValues { nullptr };
96 QPushButton *showCoordinates { nullptr };
97 QCheckBox *autoScale { nullptr };
98 QPushButton *showScaling { nullptr };
99 QComboBox *sampleSize { nullptr };
100 QComboBox *selectionType { nullptr };
101 QComboBox *zoomView { nullptr };
102 QComboBox *selectStar { nullptr };
103 QPushButton *exploreMode { nullptr };
104 QLabel *pixelReport { nullptr };
105 QLabel *maxValue { nullptr };
106 QLabel *minValue { nullptr };
107 QLabel *cutoffValue { nullptr };
108 QPushButton *sliceB { nullptr };
109 QSharedPointer<FITSData> imageData { nullptr };
110 QRect subFrame;
111
112 QSlider *blackPointSlider { nullptr };
113 QSlider *whitePointSlider { nullptr };
114 QSlider *cutoffSlider { nullptr };
115 QSlider *verticalSelector { nullptr };
116 QSlider *horizontalSelector { nullptr };
117 QList<Edge *> starCenters;
118
119 bool cutOffEnabled { false };
120
121 int convertToSliderValue(float value);
122 float convertFromSliderValue(int value);
123 void updatePixelReport();
124
125};
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.