File indexing completed on 2024-12-01 06:35:36

0001 /*
0002     SPDX-FileCopyrightText: 2005 Jason Harris <kstars@30doradus.org>
0003 
0004     SPDX-License-Identifier: GPL-2.0-or-later
0005 */
0006 
0007 #pragma once
0008 
0009 #include "skycomponent.h"
0010 
0011 #include <QList>
0012 
0013 #include <memory>
0014 
0015 #define NCIRCLE 360 //number of points used to define equator, ecliptic and horizon
0016 
0017 class SkyPoint;
0018 
0019 /**
0020  * @class PointListComponent
0021  *
0022  * An abstract parent class, to be inherited by SkyComponents that store a QList of SkyPoints.
0023  *
0024  * @author Jason Harris
0025  * @version 0.1
0026  */
0027 class PointListComponent : public SkyComponent
0028 {
0029   public:
0030     explicit PointListComponent(SkyComposite *parent);
0031 
0032     virtual ~PointListComponent() override = default;
0033 
0034     /**
0035      * @short Update the sky positions of this component.
0036      *
0037      * This function usually just updates the Horizontal (Azimuth/Altitude)
0038      * coordinates of the objects in this component.  However, the precession
0039      * and nutation must also be recomputed periodically.  Requests to do
0040      * so are sent through the doPrecess parameter.
0041      * @p num Pointer to the KSNumbers object
0042      * @note By default, the num parameter is nullptr, indicating that
0043      * Precession/Nutation computation should be skipped; this computation
0044      * is only occasionally required.
0045      */
0046     void update(KSNumbers *num = nullptr) override;
0047 
0048     QList<std::shared_ptr<SkyPoint>> &pointList() { return m_PointList; }
0049 
0050   private:
0051     QList<std::shared_ptr<SkyPoint>> m_PointList;
0052 };