| 1 |
|
| 2 |
|
| 3 |
|
| 4 |
#ifndef BOXENTITY_H |
| 5 |
#define BOXENTITY_H |
| 6 |
|
| 7 |
#include <Qt3DCore/QEntity> |
| 8 |
#include <Qt3DCore/QTransform> |
| 9 |
#include <Qt3DExtras/QCuboidMesh> |
| 10 |
#include <Qt3DExtras/QPhongMaterial> |
| 11 |
|
| 12 |
class BoxEntity : public Qt3DCore::QEntity |
| 13 |
{ |
| 14 |
Q_OBJECT |
| 15 |
|
| 16 |
Q_PROPERTY(QColor diffuseColor READ diffuseColor WRITE setDiffuseColor NOTIFY diffuseColorChanged) |
| 17 |
Q_PROPERTY(float angle READ angle WRITE setAngle NOTIFY angleChanged) |
| 18 |
Q_PROPERTY(float radius READ radius WRITE setRadius NOTIFY radiusChanged) |
| 19 |
|
| 20 |
public: |
| 21 |
BoxEntity(QNode *parent = 0); |
| 22 |
|
| 23 |
QColor diffuseColor(); |
| 24 |
float angle() const; |
| 25 |
float radius() const; |
| 26 |
|
| 27 |
public Q_SLOTS: |
| 28 |
void setDiffuseColor(const QColor &diffuseColor); |
| 29 |
void setAngle(float arg); |
| 30 |
void setRadius(float arg); |
| 31 |
|
| 32 |
Q_SIGNALS: |
| 33 |
void diffuseColorChanged(const QColor &); |
| 34 |
void angleChanged(); |
| 35 |
void radiusChanged(); |
| 36 |
|
| 37 |
private: |
| 38 |
void updateTransformation(); |
| 39 |
|
| 40 |
Qt3DCore::QTransform *m_transform; |
| 41 |
Qt3DExtras::QCuboidMesh *m_mesh; |
| 42 |
Qt3DExtras::QPhongMaterial *m_material; |
| 43 |
float m_angle; |
| 44 |
float m_radius; |
| 45 |
}; |
| 46 |
|
| 47 |
#endif |