QGIS API Documentation 4.1.0-Master (ca2ac17535b)
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.h"
20#include "qgis_3d.h"
21#include "qgsmaterial.h"
22
23#include <QObject>
24
25#define SIP_NO_FILE
26
27// adapted from Qt's qtexturematerial.h
28namespace Qt3DRender
29{
30
31 class QFilterKey;
32 class QAbstractTexture;
33 class QTechnique;
34 class QParameter;
35 class QShaderProgram;
36 class QRenderPass;
37
38} // namespace Qt3DRender
39
41
47class _3D_EXPORT QgsTextureMaterial : public QgsMaterial
48{
49 Q_OBJECT
50
51 public:
55 explicit QgsTextureMaterial( Qt3DCore::QNode *parent = nullptr );
56 ~QgsTextureMaterial() override;
57
58 Qt3DRender::QAbstractTexture *texture() const;
59
65 void setInstancingEnabled( bool enabled, Qgis::InstancedMaterialFlags flags );
66
67 public slots:
68
75 void setTexture( Qt3DRender::QAbstractTexture *texture );
76
77 private:
78 void init();
79
80 Qt3DRender::QParameter *mTextureParameter = nullptr;
81 Qt3DRender::QTechnique *mGL3Technique = nullptr;
82 Qt3DRender::QRenderPass *mGL3RenderPass = nullptr;
83 Qt3DRender::QShaderProgram *mGL3Shader = nullptr;
84 Qt3DRender::QFilterKey *mFilterKey = nullptr;
85 bool mInstanced = false;
86 Qgis::InstancedMaterialFlags mInstanceFlags;
87};
88
90
91#endif // QGSTEXTUREMATERIAL_H
QFlags< InstancedMaterialFlag > InstancedMaterialFlags
Definition qgis.h:4365
Base class for all materials used within QGIS 3D views.
Definition qgsmaterial.h:40