File indexing completed on 2024-03-24 15:18:13

0001 /*
0002     SPDX-FileCopyrightText: 2014 Utkarsh Simha <utkarshsimha@gmail.com>
0003 
0004     SPDX-License-Identifier: GPL-2.0-or-later
0005 */
0006 
0007 #pragma once
0008 
0009 #include "ui_starhopperdialog.h"
0010 
0011 #include "starobject.h"
0012 
0013 #include <QDialog>
0014 
0015 #include <memory>
0016 
0017 class SkyObject;
0018 class SkyPoint;
0019 class StarHopper;
0020 class StarObject;
0021 class TargetListComponent;
0022 
0023 Q_DECLARE_METATYPE(StarObject *)
0024 
0025 class StarHopperDialog : public QDialog, public Ui::StarHopperDialog
0026 {
0027     Q_OBJECT;
0028 
0029   public:
0030     explicit StarHopperDialog(QWidget *parent = nullptr);
0031     ~StarHopperDialog() override;
0032 
0033     /**
0034      * @short Forms a Star Hop route from source to destination and displays on skymap
0035      * @param startHop SkyPoint to the start of Star Hop
0036      * @param stopHop SkyPoint to destination of StarHop
0037      * @param fov Field of view under consideration
0038      * @param maglim Magnitude limit of star to search for
0039      * @note In turn calls StarHopper to perform computations
0040      */
0041     void starHop(const SkyPoint &startHop, const SkyPoint &stopHop, float fov, float maglim);
0042 
0043   private slots:
0044     void slotNext();
0045     void slotGoto();
0046     void slotDetails();
0047     void slotRefreshMetadata();
0048 
0049   private:
0050     SkyObject *getStarData(QListWidgetItem *);
0051     void setData(StarObject *);
0052     TargetListComponent *getTargetListComponent();
0053 
0054     QList<SkyObject *> *m_skyObjList { nullptr };
0055     std::unique_ptr<StarHopper> m_sh;
0056     Ui::StarHopperDialog *ui { nullptr };
0057     QListWidget *m_lw { nullptr };
0058     QStringList *m_Metadata { nullptr };
0059 };