QGroundControl
Ground Control Station for MAVLink Drones
Loading...
Searching...
No Matches
CheckerboardTextureData.h
Go to the documentation of this file.
1/****************************************************************************
2 *
3 * (c) 2009-2024 QGROUNDCONTROL PROJECT <http://www.qgroundcontrol.org>
4 *
5 * QGroundControl is licensed according to the terms in the file
6 * COPYING.md in the root of the source code directory.
7 *
8 ****************************************************************************/
9
10#pragma once
11
12#include <QtGui/QColor>
13#include <QtQuick3D/QQuick3DTextureData>
14
18class CheckerboardTextureData : public QQuick3DTextureData
19{
20 Q_OBJECT
21 QML_ELEMENT
22 Q_PROPERTY(int sizePixels READ sizePixels WRITE setSizePixels NOTIFY sizePixelsChanged)
23 Q_PROPERTY(int cells READ cells WRITE setCells NOTIFY cellsChanged)
24 Q_PROPERTY(QColor color1 READ color1 WRITE setColor1 NOTIFY color1Changed)
25 Q_PROPERTY(QColor color2 READ color2 WRITE setColor2 NOTIFY color2Changed)
26
27public:
28 explicit CheckerboardTextureData(QQuick3DObject* parent = nullptr);
29
30 int sizePixels() const { return _sizePixels; }
31
32 void setSizePixels(int sizePixels);
33
34 int cells() const { return _cells; }
35
36 void setCells(int cells);
37
38 QColor color1() const { return _color1; }
39
40 void setColor1(const QColor& color);
41
42 QColor color2() const { return _color2; }
43
44 void setColor2(const QColor& color);
45
46signals:
51
52private:
53 void _rebuild();
54
55 int _sizePixels = 256;
56 int _cells = 8;
57 QColor _color1{0x40, 0x80, 0x40};
58 QColor _color2{0xd0, 0xd0, 0xd0};
59};
void setSizePixels(int sizePixels)
void setColor1(const QColor &color)
void setColor2(const QColor &color)