QGIS API Documentation 4.1.0-Master (31622b25bb0)
Loading...
Searching...
No Matches
qgsgoochmaterial.h
Go to the documentation of this file.
1/***************************************************************************
2 qgsgoochmaterial.h
3 --------------------------------------
4 Date : April 2026
5 Copyright : (C) 2026 by Dominik Cindrić
6 Email : viper dot miniq 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 QGSGOOCHMATERIAL_H
17#define QGSGOOCHMATERIAL_H
18
19#include "qgis.h"
20#include "qgis_3d.h"
21#include "qgsmaterial.h"
22
23#include <QColor>
24#include <QObject>
25
26#define SIP_NO_FILE
27
28namespace Qt3DRender
29{
30 class QParameter;
31 class QShaderProgram;
32} // namespace Qt3DRender
33
35
41class _3D_EXPORT QgsGoochMaterial : public QgsMaterial
42{
43 Q_OBJECT
44
45 public:
49 explicit QgsGoochMaterial( Qt3DCore::QNode *parent = nullptr );
50 ~QgsGoochMaterial() override;
51
57 void setInstancingEnabled( bool enabled, Qgis::InstancedMaterialFlags flags );
58
59 public slots:
61 void setDiffuse( const QColor &diffuse );
63 void setSpecular( const QColor &specular );
65 void setWarm( const QColor &warm );
67 void setCool( const QColor &cool );
68 void setShininess( float shininess );
69 void setAlpha( float alpha );
70 void setBeta( float beta );
71
77 void setDataDefinedEnabled( bool enabled );
78
79 private:
80 void init();
81 void updateShaders();
82
83 Qt3DRender::QParameter *mDiffuseParameter = nullptr;
84 Qt3DRender::QParameter *mSpecularParameter = nullptr;
85 Qt3DRender::QParameter *mWarmParameter = nullptr;
86 Qt3DRender::QParameter *mCoolParameter = nullptr;
87 Qt3DRender::QParameter *mShininessParameter = nullptr;
88 Qt3DRender::QParameter *mAlphaParameter = nullptr;
89 Qt3DRender::QParameter *mBetaParameter = nullptr;
90 Qt3DRender::QShaderProgram *mShaderProgram = nullptr;
91 bool mDataDefinedEnabled = false;
92 bool mInstanced = false;
93 Qgis::InstancedMaterialFlags mInstanceFlags;
94};
95
97
98#endif // QGSGOOCHMATERIAL_H
QFlags< InstancedMaterialFlag > InstancedMaterialFlags
Definition qgis.h:4365
Base class for all materials used within QGIS 3D views.
Definition qgsmaterial.h:40