1 /* 2 SPDX-FileCopyrightText: 2014 Utkarsh Simha <utkarshsimha@gmail.com> 3 4 SPDX-License-Identifier: GPL-2.0-or-later 5 */ 6 7 #pragma once 8 9 #include "ui_starhopperdialog.h" 10 11 #include "starobject.h" 12 13 #include <QDialog> 14 15 #include <memory> 16 17 class SkyObject; 18 class SkyPoint; 19 class StarHopper; 20 class StarObject; 21 class TargetListComponent; 22 Q_DECLARE_METATYPE(StarObject *)23Q_DECLARE_METATYPE(StarObject *) 24 25 class StarHopperDialog : public QDialog, public Ui::StarHopperDialog 26 { 27 Q_OBJECT; 28 29 public: 30 explicit StarHopperDialog(QWidget *parent = nullptr); 31 ~StarHopperDialog() override; 32 33 /** 34 * @short Forms a Star Hop route from source to destination and displays on skymap 35 * @param startHop SkyPoint to the start of Star Hop 36 * @param stopHop SkyPoint to destination of StarHop 37 * @param fov Field of view under consideration 38 * @param maglim Magnitude limit of star to search for 39 * @note In turn calls StarHopper to perform computations 40 */ 41 void starHop(const SkyPoint &startHop, const SkyPoint &stopHop, float fov, float maglim); 42 43 private slots: 44 void slotNext(); 45 void slotGoto(); 46 void slotDetails(); 47 void slotRefreshMetadata(); 48 49 private: 50 SkyObject *getStarData(QListWidgetItem *); 51 void setData(StarObject *); 52 TargetListComponent *getTargetListComponent(); 53 54 QList<SkyObject *> *m_skyObjList { nullptr }; 55 std::unique_ptr<StarHopper> m_sh; 56 Ui::StarHopperDialog *ui { nullptr }; 57 QListWidget *m_lw { nullptr }; 58 QStringList *m_Metadata { nullptr }; 59 }; 60