2022-06-08 12:47:24 +00:00
|
|
|
// Copyright (C) 2015 Klaralvdalens Datakonsult AB (KDAB).
|
2024-02-23 14:41:04 +00:00
|
|
|
// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only
|
2015-01-05 11:22:57 +00:00
|
|
|
|
|
|
|
#ifndef BOXENTITY_H
|
|
|
|
#define BOXENTITY_H
|
|
|
|
|
|
|
|
#include <Qt3DCore/QEntity>
|
|
|
|
#include <Qt3DCore/QTransform>
|
2016-04-11 12:58:17 +00:00
|
|
|
#include <Qt3DExtras/QCuboidMesh>
|
|
|
|
#include <Qt3DExtras/QPhongMaterial>
|
2015-01-05 11:22:57 +00:00
|
|
|
|
2015-10-12 19:45:19 +00:00
|
|
|
class BoxEntity : public Qt3DCore::QEntity
|
2015-01-05 11:22:57 +00:00
|
|
|
{
|
|
|
|
Q_OBJECT
|
|
|
|
|
|
|
|
Q_PROPERTY(QColor diffuseColor READ diffuseColor WRITE setDiffuseColor NOTIFY diffuseColorChanged)
|
|
|
|
Q_PROPERTY(float angle READ angle WRITE setAngle NOTIFY angleChanged)
|
|
|
|
Q_PROPERTY(float radius READ radius WRITE setRadius NOTIFY radiusChanged)
|
|
|
|
|
|
|
|
public:
|
|
|
|
BoxEntity(QNode *parent = 0);
|
|
|
|
|
|
|
|
QColor diffuseColor();
|
|
|
|
float angle() const;
|
|
|
|
float radius() const;
|
|
|
|
|
|
|
|
public Q_SLOTS:
|
|
|
|
void setDiffuseColor(const QColor &diffuseColor);
|
|
|
|
void setAngle(float arg);
|
|
|
|
void setRadius(float arg);
|
|
|
|
|
|
|
|
Q_SIGNALS:
|
2015-12-08 09:50:37 +00:00
|
|
|
void diffuseColorChanged(const QColor &);
|
2015-01-05 11:22:57 +00:00
|
|
|
void angleChanged();
|
|
|
|
void radiusChanged();
|
|
|
|
|
|
|
|
private:
|
|
|
|
void updateTransformation();
|
|
|
|
|
2015-10-12 19:45:19 +00:00
|
|
|
Qt3DCore::QTransform *m_transform;
|
2016-04-11 12:58:17 +00:00
|
|
|
Qt3DExtras::QCuboidMesh *m_mesh;
|
|
|
|
Qt3DExtras::QPhongMaterial *m_material;
|
2015-01-05 11:22:57 +00:00
|
|
|
float m_angle;
|
|
|
|
float m_radius;
|
|
|
|
};
|
|
|
|
|
|
|
|
#endif // BOXENTITY_H
|