QGIS API Documentation 3.39.0-Master (bca3cdb6021)
Loading...
Searching...
No Matches
qgstexturematerial.h
Go to the documentation of this file.
1/***************************************************************************
2 qgstexturematerial.h
3 --------------------------------------
4 Date : March 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 QGSTEXTUREMATERIAL_H
17#define QGSTEXTUREMATERIAL_H
18
19#include "qgis_3d.h"
20
21#include <Qt3DRender/QMaterial>
22#include <QObject>
23
24#define SIP_NO_FILE
25
26// adapted from Qt's qtexturematerial.h
27namespace Qt3DRender
28{
29
30 class QFilterKey;
31 class QAbstractTexture;
32 class QTechnique;
33 class QParameter;
34 class QShaderProgram;
35 class QRenderPass;
36
37} // namespace Qt3DRender
38
40
46class _3D_EXPORT QgsTextureMaterial : public Qt3DRender::QMaterial
47{
48 Q_OBJECT
49 Q_PROPERTY( Qt3DRender::QAbstractTexture *texture READ texture WRITE setTexture NOTIFY textureChanged )
50
51 public:
52
56 explicit QgsTextureMaterial( Qt3DCore::QNode *parent = nullptr );
57 ~QgsTextureMaterial() override;
58
59 Qt3DRender::QAbstractTexture *texture() const;
60
61 public Q_SLOTS:
62
67 void setTexture( Qt3DRender::QAbstractTexture *texture );
68
69 Q_SIGNALS:
70 void textureChanged( Qt3DRender::QAbstractTexture *texture );
71
72 private:
73 void init();
74
75 void handleTextureChanged( const QVariant &var );
76
77 Qt3DRender::QParameter *mTextureParameter = nullptr;
78 Qt3DRender::QTechnique *mGL3Technique = nullptr;
79 Qt3DRender::QRenderPass *mGL3RenderPass = nullptr;
80 Qt3DRender::QShaderProgram *mGL3Shader = nullptr;
81 Qt3DRender::QFilterKey *mFilterKey = nullptr;
82
83};
84
86
87#endif // QGSTEXTUREMATERIAL_H