QGIS API Documentation 4.1.0-Master (376402f9aeb)
Loading...
Searching...
No Matches
qgsphongtexturedmaterial.h
Go to the documentation of this file.
1/***************************************************************************
2 qgsphongtexturedmaterial.h
3 --------------------------------------
4 Date : August 2024
5 Copyright : (C) 2024 by Jean Felder
6 Email : jean dot felder at oslandia dot com
7 ***************************************************************************
8 * *
9 * This program is free software; you can redistribute it and/or modify *
10 * it under the terms of the GNU General Public License as published by *
11 * the Free Software Foundation; either version 2 of the License, or *
12 * (at your option) any later version. *
13 * *
14 ***************************************************************************/
15
16#ifndef QGSPHONGTEXTUREDMATERIAL_H
17#define QGSPHONGTEXTUREDMATERIAL_H
18
19#include "qgis_3d.h"
20#include "qgsmaterial.h"
21
22#include <QColor>
23#include <QObject>
24#include <Qt3DRender/QTexture>
25
26#define SIP_NO_FILE
27
28namespace Qt3DRender
29{
30 class QParameter;
31
32} // namespace Qt3DRender
33
35
41class _3D_EXPORT QgsPhongTexturedMaterial : public QgsMaterial
42{
43 Q_OBJECT
44
45 public:
49 explicit QgsPhongTexturedMaterial( Qt3DCore::QNode *parent = nullptr );
50 ~QgsPhongTexturedMaterial() override;
51
52 public slots:
54 void setAmbient( const QColor &ambient );
55
62 void setDiffuseTexture( Qt3DRender::QAbstractTexture *texture );
63
64 void setDiffuseTextureScale( float textureScale );
65 void setDiffuseTextureRotation( float textureRotation );
67 void setSpecular( const QColor &specular );
68 void setShininess( float shininess );
69 void setOpacity( float opacity );
70
71 private:
72 void init();
73
74 Qt3DRender::QParameter *mAmbientParameter = nullptr;
75 Qt3DRender::QParameter *mDiffuseTextureParameter = nullptr;
76 Qt3DRender::QParameter *mDiffuseTextureScaleParameter = nullptr;
77 Qt3DRender::QParameter *mDiffuseTextureRotationParameter = nullptr;
78 Qt3DRender::QParameter *mSpecularParameter = nullptr;
79 Qt3DRender::QParameter *mShininessParameter = nullptr;
80 Qt3DRender::QParameter *mOpacityParameter = nullptr;
81};
82
84
85#endif // QGSPHONGTEXTUREDMATERIAL_H
Base class for all materials used within QGIS 3D views.
Definition qgsmaterial.h:40