Kstars

polynode.h
1 /*
2  SPDX-FileCopyrightText: 2016 Artem Fedoskin <[email protected]>
3  SPDX-License-Identifier: GPL-2.0-or-later
4 */
5 
6 #pragma once
7 
8 #include "../../skyopacitynode.h"
9 
10 class QSGGeometryNode;
11 class QSGGeometry;
13 
14 /**
15  * @class PolyNode
16  *
17  * @short A SkyOpacityNode derived class used for drawing of polygons (both filled and non-filled)
18  *
19  * @author Artem Fedoskin
20  * @version 1.0
21  */
22 class PolyNode : public SkyOpacityNode
23 {
24  public:
25  /** @short Initialize geometry and material */
26  PolyNode();
27 
28  void setColor(QColor color);
29 
30  /** @short Set thickness of border line */
31  void setLineWidth(int width);
32 
33  /**
34  * @short Update the geometry of polygon
35  * @param polygon - polygon that needs to be drawn
36  * @param filled - true if it should be filled
37  */
38  void updateGeometry(const QPolygonF &polygon, bool filled);
39 
40  private:
41  QSGGeometryNode *m_geometryNode { nullptr };
42  QSGGeometry *m_geometry { nullptr };
43  QSGFlatColorMaterial *m_material { nullptr };
44 };
PolyNode()
Initialize geometry and material.
Definition: polynode.cpp:17
A wrapper for QSGOpacityNode that provides hide() and show() functions. If node is invisible (opacity...
A SkyOpacityNode derived class used for drawing of polygons (both filled and non-filled)
Definition: polynode.h:22
void setLineWidth(int width)
Set thickness of border line.
Definition: polynode.cpp:38
void updateGeometry(const QPolygonF &polygon, bool filled)
Update the geometry of polygon.
Definition: polynode.cpp:47
This file is part of the KDE documentation.
Documentation copyright © 1996-2022 The KDE developers.
Generated on Sun Aug 14 2022 04:13:59 by doxygen 1.8.17 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.