ff4ff35918
Red Bear OS is a full fork. All sources must be available from git clone with zero network access. Removed gitignore rules that excluded fetched source trees under recipes/*/source/, local/recipes/kde/*/source/, local/recipes/qt/*/source/, and vendor source trees. Build artifacts (target/, build/, source.tar, *.o, *.so) remain excluded. 127291 files added — kernel, relibc, base, bootloader, pkgar, all KDE/Qt frameworks, mesa, wayland, DRM drivers, and every other recipe source.
45 lines
1.2 KiB
C++
45 lines
1.2 KiB
C++
// Copyright (C) 2020 The Qt Company Ltd.
|
|
// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR BSD-3-Clause
|
|
|
|
#include <QtQuick3D/qquick3dinstancing.h>
|
|
QT_FORWARD_DECLARE_CLASS(QRandomGenerator)
|
|
//! [properties]
|
|
class CppInstanceTable : public QQuick3DInstancing
|
|
{
|
|
Q_OBJECT
|
|
QML_ELEMENT
|
|
|
|
Q_PROPERTY(int gridSize READ gridSize WRITE setGridSize NOTIFY gridSizeChanged)
|
|
Q_PROPERTY(float gridSpacing READ gridSpacing WRITE setGridSpacing NOTIFY gridSpacingChanged)
|
|
Q_PROPERTY(int randomSeed READ randomSeed WRITE setRandomSeed NOTIFY randomSeedChanged)
|
|
//! [properties]
|
|
public:
|
|
explicit CppInstanceTable(QQuick3DObject *parent = nullptr);
|
|
~CppInstanceTable() override;
|
|
|
|
int gridSize() const;
|
|
float gridSpacing() const;
|
|
int randomSeed() const;
|
|
|
|
public slots:
|
|
void setGridSize(int gridSize);
|
|
void setGridSpacing(float gridSpacing);
|
|
void setRandomSeed(int randomSeed);
|
|
|
|
signals:
|
|
void gridSizeChanged();
|
|
void gridSpacingChanged();
|
|
void randomSeedChanged();
|
|
|
|
protected:
|
|
QByteArray getInstanceBuffer(int *instanceCount) override;
|
|
|
|
private:
|
|
int m_instanceCount = 0;
|
|
QByteArray m_instanceData;
|
|
bool m_dirty = true;
|
|
int m_gridSize = 0;
|
|
float m_gridSpacing = 100;
|
|
int m_randomSeed;
|
|
};
|