File indexing completed on 2024-04-21 14:46:31

0001 /*
0002     SPDX-FileCopyrightText: 2011 Rafał Kułaga <rl.kulaga@gmail.com>
0003 
0004     SPDX-License-Identifier: GPL-2.0-or-later
0005 */
0006 
0007 #pragma once
0008 
0009 #include "skypoint.h"
0010 #include "starhopper.h"
0011 
0012 class PrintingWizard;
0013 class SkyMap;
0014 
0015 /**
0016  * \class ShFovExporter
0017  * \brief Helper class used as a wrapper for StarHopper when capturing FOV snapshots.
0018  *
0019  * \author Rafał Kułaga
0020  */
0021 class ShFovExporter
0022 {
0023   public:
0024     /** Constructor */
0025     ShFovExporter(PrintingWizard *wizard, SkyMap *map);
0026 
0027     /**
0028      * \brief Calculate path between source and destination SkyPoints.
0029      * \param src SkyPoint at which StarHopper will begin.
0030      * \param dest SkyPoint at which StarHopper will end.
0031      * \param fov Star hopping field of view angle (in deg).
0032      * \param maglim Magnitude limit.
0033      * \return True if path has been found.
0034      */
0035     bool calculatePath(const SkyPoint &src, const SkyPoint &dest, double fov, double maglim);
0036 
0037     /**
0038      * \brief Export FOV snapshots across calculated path.
0039      * \return False if path is empty.
0040      * \note You should call ShFovExporter::calculatePath() before calling this method.
0041      */
0042     bool exportPath();
0043 
0044   private:
0045     /**
0046      * \brief Private method: center SkyMap between two SkyPoints and capture FOV snapshot.
0047      * \param ptA Beginning point.
0048      * \param ptB Ending point.
0049      */
0050     void centerBetweenAndCapture(const SkyPoint &ptA, const SkyPoint &ptB);
0051 
0052     SkyMap *m_Map { nullptr };
0053     StarHopper m_StarHopper;
0054     SkyPoint m_Src;
0055     SkyPoint m_Dest;
0056     PrintingWizard *m_ParentWizard { nullptr };
0057     QList<SkyObject *> m_Path;
0058     QList<SkyObject *> *m_skyObjList { nullptr };
0059 };