Kstars

rectnode.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 <QColor>
9#include <QSGGeometryNode>
10
11class QSGGeometry;
13
14/**
15 * @class RectNode
16 * @short QSGGeometryNode derived class that draws filled and non-filled rectangles
17 *
18 * @author Artem Fedoskin
19 * @version 1.0
20 */
22{
23 public:
24 explicit RectNode(bool filled = false);
25
26 /**
27 * @brief setRect sets rectangle to display
28 * @param x - x coordinate of left-top corner
29 * @param y - y coordinate of left-top corner
30 * @param w - width
31 * @param h - height
32 */
33 void setRect(int x, int y, int w, int h);
34
35 /** setColor sets the color of rectangle */
36 void setColor(const QColor &color);
37
38 /**
39 * @brief setFilled sets whether the rectangle should be filled or no
40 * @param filled true to be filled, false otherwise
41 */
42 void setFilled(bool filled);
43
44 private:
45 QSGGeometry *m_geometry { nullptr };
46 QSGFlatColorMaterial *m_material { nullptr };
47 bool m_filled { false };
48};
QSGGeometryNode derived class that draws filled and non-filled rectangles.
Definition rectnode.h:22
void setRect(int x, int y, int w, int h)
setRect sets rectangle to display
Definition rectnode.cpp:25
void setFilled(bool filled)
setFilled sets whether the rectangle should be filled or no
Definition rectnode.cpp:44
void setColor(const QColor &color)
setColor sets the color of rectangle
Definition rectnode.cpp:35
This file is part of the KDE documentation.
Documentation copyright © 1996-2024 The KDE developers.
Generated on Mon Nov 18 2024 12:16:41 by doxygen 1.12.0 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.