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 QSGGeometryNode; 0011 class QSGGeometry; 0012 class QSGFlatColorMaterial; 0013 0014 /** 0015 * @class PolyNode 0016 * 0017 * @short A SkyOpacityNode derived class used for drawing of polygons (both filled and non-filled) 0018 * 0019 * @author Artem Fedoskin 0020 * @version 1.0 0021 */ 0022 class PolyNode : public SkyOpacityNode 0023 { 0024 public: 0025 /** @short Initialize geometry and material */ 0026 PolyNode(); 0027 0028 void setColor(QColor color); 0029 0030 /** @short Set thickness of border line */ 0031 void setLineWidth(int width); 0032 0033 /** 0034 * @short Update the geometry of polygon 0035 * @param polygon - polygon that needs to be drawn 0036 * @param filled - true if it should be filled 0037 */ 0038 void updateGeometry(const QPolygonF &polygon, bool filled); 0039 0040 private: 0041 QSGGeometryNode *m_geometryNode { nullptr }; 0042 QSGGeometry *m_geometry { nullptr }; 0043 QSGFlatColorMaterial *m_material { nullptr }; 0044 };