File indexing completed on 2024-04-28 03:44:26

0001 /*
0002     SPDX-FileCopyrightText: 2016 Artem Fedoskin <afedoskin3@gmail.com>
0003     SPDX-License-Identifier: GPL-2.0-or-later
0004 */
0005 
0006 #pragma once
0007 
0008 #include "skynode.h"
0009 
0010 class QSGFlatColorMaterial;
0011 class PointNode;
0012 class PolyNode;
0013 class Supernova;
0014 
0015 /**
0016  * @class SupernovaNode
0017  *
0018  * @short A SkyNode derived class that represents supernova
0019  * @author Artem Fedoskin
0020  * @version 1.0
0021  */
0022 class SupernovaNode : public SkyNode
0023 {
0024   public:
0025     /**
0026      * @short Constructor.
0027      * @param snova - pointer to supernova that needs to be represented by this node
0028      */
0029     explicit SupernovaNode(Supernova *snova);
0030 
0031     /**
0032      * @short Update position and visibility of supernova. Initialize m_lines if not already done
0033      */
0034     virtual void update() override;
0035 
0036     virtual void changePos(QPointF pos) override;
0037 
0038     inline Supernova *snova() { return m_snova; }
0039 
0040   private:
0041     Supernova *m_snova { nullptr };
0042 
0043     QSGGeometryNode *m_lines { nullptr };
0044 
0045     QSGFlatColorMaterial *m_material { nullptr };
0046     QSGGeometry *m_geometry { nullptr };
0047 };