16#ifndef QGSPHONGTEXTUREDMATERIAL_H
17#define QGSPHONGTEXTUREDMATERIAL_H
24#include <Qt3DRender/QTexture>
41class _3D_EXPORT QgsPhongTexturedMaterial :
public QgsMaterial
44 Q_PROPERTY( QColor ambient READ ambient WRITE setAmbient NOTIFY ambientChanged )
45 Q_PROPERTY( Qt3DRender::QAbstractTexture *diffuseTexture READ diffuseTexture WRITE setDiffuseTexture NOTIFY diffuseTextureChanged )
46 Q_PROPERTY(
float diffuseTextureScale READ diffuseTextureScale WRITE setDiffuseTextureScale NOTIFY diffuseTextureScaleChanged )
47 Q_PROPERTY( QColor specular READ specular WRITE setSpecular NOTIFY specularChanged )
48 Q_PROPERTY(
float shininess READ shininess WRITE setShininess NOTIFY shininessChanged )
49 Q_PROPERTY(
float opacity READ opacity WRITE setOpacity NOTIFY opacityChanged )
55 explicit QgsPhongTexturedMaterial( Qt3DCore::QNode *parent =
nullptr );
56 ~QgsPhongTexturedMaterial()
override;
58 QColor ambient()
const;
59 Qt3DRender::QAbstractTexture *diffuseTexture()
const;
60 float diffuseTextureScale()
const;
61 QColor specular()
const;
62 float shininess()
const;
63 float opacity()
const;
66 void setAmbient(
const QColor &ambient );
72 void setDiffuseTexture( Qt3DRender::QAbstractTexture *texture );
74 void setDiffuseTextureScale(
float textureScale );
75 void setSpecular(
const QColor &specular );
76 void setShininess(
float shininess );
77 void setOpacity(
float opacity );
80 void ambientChanged(
const QColor &ambient );
81 void diffuseTextureChanged( Qt3DRender::QAbstractTexture *diffuseTexture );
82 void diffuseTextureScaleChanged(
float diffuseTextureScale );
83 void specularChanged(
const QColor &specular );
84 void shininessChanged(
float shininess );
85 void opacityChanged(
float opacity );
90 void handleAmbientChanged(
const QVariant &var );
91 void handleDiffuseTextureChanged(
const QVariant &var );
92 void handleDiffuseTextureScaleChanged(
const QVariant &var );
93 void handleSpecularChanged(
const QVariant &var );
94 void handleShininessChanged(
const QVariant &var );
95 void handleOpacityChanged(
const QVariant &var );
97 Qt3DRender::QParameter *mAmbientParameter =
nullptr;
98 Qt3DRender::QParameter *mDiffuseTextureParameter =
nullptr;
99 Qt3DRender::QParameter *mDiffuseTextureScaleParameter =
nullptr;
100 Qt3DRender::QParameter *mSpecularParameter =
nullptr;
101 Qt3DRender::QParameter *mShininessParameter =
nullptr;
102 Qt3DRender::QParameter *mOpacityParameter =
nullptr;