File indexing completed on 2024-05-12 03:45:46
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 "../../skyopacitynode.h" 0009 0010 class QSGSimpleTextureNode; 0011 0012 class RootNode; 0013 0014 /** 0015 * @class PointNode 0016 * @short SkyOpacityNode derived class that represents stars and planets using cached QSGTexture 0017 * 0018 * A SkyOpacityNode derived class used for representing stars and planets as stars. Upon 0019 * construction loads the texture of star cached in parentNode 0020 * 0021 * @author Artem Fedoskin 0022 * @version 1.0 0023 */ 0024 class PointNode : public SkyOpacityNode 0025 { 0026 public: 0027 /** 0028 * @short Constructor 0029 * @param p pointer to the top parent RootNode which holds texture cache 0030 * @param sp spectral type 0031 * @param size initial size of PointNode 0032 */ 0033 explicit PointNode(RootNode *p, char sp = 'A', float size = 1); 0034 0035 /** 0036 * @short setSize update size of PointNode with the given parameter 0037 * @param size new size of PointNode 0038 */ 0039 void setSize(float size); 0040 0041 QSizeF size() const; 0042 0043 private: 0044 char spType { 0 }; 0045 QSGSimpleTextureNode *texture { nullptr }; 0046 //parentNode holds texture cache 0047 RootNode *m_rootNode { nullptr }; 0048 float m_size { -1 }; 0049 uint starColorMode { 0 }; 0050 };