QGIS API Documentation 4.1.0-Master (0cdd3ae6384)
Loading...
Searching...
No Matches
qgsunlitmaterial.h
Go to the documentation of this file.
1/***************************************************************************
2 qgsunlitmaterial.h
3 ---------------------
4 begin : June 2026
5 copyright : (C) 2026 by Nyall Dawson
6 email : nyall dot dawson at gmail 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 QGSUNLITMATERIAL_H
17#define QGSUNLITMATERIAL_H
18
19#include "qgis.h"
20#include "qgis_3d.h"
21#include "qgsmaterial.h"
22
23#define SIP_NO_FILE
24
25class QMatrix4x4;
26
27
28namespace Qt3DRender
29{
30 class QParameter;
31 class QShaderProgram;
32} // namespace Qt3DRender
33
34
36
44class _3D_EXPORT QgsUnlitMaterial : public QgsMaterial
45{
46 Q_OBJECT
47
48 public:
52 explicit QgsUnlitMaterial( Qt3DCore::QNode *parent = nullptr );
53 ~QgsUnlitMaterial() override;
54
60 void setColor( const QColor &color );
61
65 void setInstancingEnabled( bool enabled, Qgis::InstancedMaterialFlags flags );
66
72 void setInstancingMeshTransform( const QMatrix4x4 &transform );
73
74 private:
75 void init();
76 void updateShaders();
77
78 Qt3DRender::QShaderProgram *mShaderProgram = nullptr;
79 Qgis::MaterialRenderingTechnique mRenderingTechnique;
80 bool mInstanced = false;
81 Qgis::InstancedMaterialFlags mInstanceFlags;
82 Qt3DRender::QParameter *mTransformParameter = nullptr;
83 Qt3DRender::QParameter *mNormalTransformParameter = nullptr;
84 Qt3DRender::QParameter *mColorParameter = nullptr;
85};
86
88
89#endif // QGSUNLITMATERIAL_H
MaterialRenderingTechnique
Material rendering techniques.
Definition qgis.h:4375
QFlags< InstancedMaterialFlag > InstancedMaterialFlags
Definition qgis.h:4398
Base class for all materials used within QGIS 3D views.
Definition qgsmaterial.h:40