16#ifndef QGSPHONGTEXTUREDMATERIAL_H
17#define QGSPHONGTEXTUREDMATERIAL_H
23#include <Qt3DRender/QMaterial>
24#include <Qt3DRender/QTexture>
41class _3D_EXPORT QgsPhongTexturedMaterial :
public Qt3DRender::QMaterial
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 )
56 explicit QgsPhongTexturedMaterial( Qt3DCore::QNode *parent =
nullptr );
57 ~QgsPhongTexturedMaterial()
override;
59 QColor ambient()
const;
60 Qt3DRender::QAbstractTexture *diffuseTexture()
const;
61 float diffuseTextureScale()
const;
62 QColor specular()
const;
63 float shininess()
const;
64 float opacity()
const;
67 void setAmbient(
const QColor &ambient );
73 void setDiffuseTexture( Qt3DRender::QAbstractTexture *texture );
75 void setDiffuseTextureScale(
float textureScale );
76 void setSpecular(
const QColor &specular );
77 void setShininess(
float shininess );
78 void setOpacity(
float opacity );
81 void ambientChanged(
const QColor &ambient );
82 void diffuseTextureChanged( Qt3DRender::QAbstractTexture *diffuseTexture );
83 void diffuseTextureScaleChanged(
float diffuseTextureScale );
84 void specularChanged(
const QColor &specular );
85 void shininessChanged(
float shininess );
86 void opacityChanged(
float opacity );
91 void handleAmbientChanged(
const QVariant &var );
92 void handleDiffuseTextureChanged(
const QVariant &var );
93 void handleDiffuseTextureScaleChanged(
const QVariant &var );
94 void handleSpecularChanged(
const QVariant &var );
95 void handleShininessChanged(
const QVariant &var );
96 void handleOpacityChanged(
const QVariant &var );
98 Qt3DRender::QParameter *mAmbientParameter =
nullptr;
99 Qt3DRender::QParameter *mDiffuseTextureParameter =
nullptr;
100 Qt3DRender::QParameter *mDiffuseTextureScaleParameter =
nullptr;
101 Qt3DRender::QParameter *mSpecularParameter =
nullptr;
102 Qt3DRender::QParameter *mShininessParameter =
nullptr;
103 Qt3DRender::QParameter *mOpacityParameter =
nullptr;