Kstars

linenode.h
1/*
2 SPDX-FileCopyrightText: 2016 Artem Fedoskin <afedoskin3@gmail.com>
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
16class SkyMapLite;
17class 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 */
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};
A simple data container used by LineListIndex.
Definition linelist.h:25
SkyOpacityNode derived class that draws lines from LineList.
Definition linenode.h:28
LineNode(LineList *lineList, SkipHashList *skipList, QColor color, int width, Qt::PenStyle drawStyle)
Constructor.
Definition linenode.cpp:15
void updateGeometry()
Update lines based on the visibility of line segments in m_lineList.
Definition linenode.cpp:65
This is the main item that displays all SkyItems.
Definition skymaplite.h:59
A wrapper for QSGOpacityNode that provides hide() and show() functions.
PenStyle
This file is part of the KDE documentation.
Documentation copyright © 1996-2024 The KDE developers.
Generated on Tue Mar 26 2024 11:19:03 by doxygen 1.10.0 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.