Kstars

linenode.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 "linelist.h"
9 #include "../../skyopacitynode.h"
10 
11 #include <QColor>
12 #include <QSGGeometryNode>
13 
15 
16 class SkyMapLite;
17 class SkipHashList;
18 
19 /**
20  * @class LineNode
21  *
22  * @short SkyOpacityNode derived class that draws lines from LineList
23  *
24  * @author Artem Fedoskin
25  * @version 1.0
26  */
27 class LineNode : public SkyOpacityNode
28 {
29  public:
30  /**
31  * @short Constructor
32  * @param lineList - lines that have to be drawn
33  * @param skipList - lines that have to be skipped
34  * @param color - line color
35  * @param width - line width
36  * @param drawStyle - not used currently
37  */
38  LineNode(LineList *lineList, SkipHashList *skipList, QColor color, int width, Qt::PenStyle drawStyle);
39  virtual ~LineNode();
40 
41  void setColor(QColor color);
42  void setWidth(int width);
43  void setDrawStyle(Qt::PenStyle drawStyle);
44 
45  void setStyle(QColor color, int width, Qt::PenStyle drawStyle);
46 
47  /**
48  * @short Update lines based on the visibility of line segments in m_lineList
49  */
50  void updateGeometry();
51 
52  inline LineList *lineList() { return m_lineList; }
53 
54  private:
55  QSGGeometryNode *m_geometryNode { nullptr };
56  LineList *m_lineList { nullptr };
57  SkipHashList *m_skipList { nullptr };
58 
59  QSGGeometry *m_geometry { nullptr };
60  QSGFlatColorMaterial *m_material { nullptr };
61 
62  Qt::PenStyle m_drawStyle;
63  QColor m_color;
64 };
void updateGeometry()
Update lines based on the visibility of line segments in m_lineList.
Definition: linenode.cpp:65
SkyOpacityNode derived class that draws lines from LineList.
Definition: linenode.h:27
A wrapper for QSGOpacityNode that provides hide() and show() functions. If node is invisible (opacity...
Item for displaying sky objects; also handles user interaction events.
Definition: skymaplite.h:58
LineNode(LineList *lineList, SkipHashList *skipList, QColor color, int width, Qt::PenStyle drawStyle)
Constructor.
Definition: linenode.cpp:15
PenStyle
This file is part of the KDE documentation.
Documentation copyright © 1996-2022 The KDE developers.
Generated on Thu Aug 11 2022 04:00:01 by doxygen 1.8.17 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.