QGIS API Documentation 4.1.0-Master (64dc32379c2)
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_3d.h"
20#include "qgsmaterial.h"
21
22#include <QColor>
23#include <QObject>
24
25#define SIP_NO_FILE
26
27namespace Qt3DRender
28{
29 class QParameter;
30 class QShaderProgram;
31} // namespace Qt3DRender
32
34
40class _3D_EXPORT QgsGoochMaterial : public QgsMaterial
41{
42 Q_OBJECT
43
44 public:
48 explicit QgsGoochMaterial( Qt3DCore::QNode *parent = nullptr );
49 ~QgsGoochMaterial() override;
50
51 public slots:
53 void setDiffuse( const QColor &diffuse );
55 void setSpecular( const QColor &specular );
57 void setWarm( const QColor &warm );
59 void setCool( const QColor &cool );
60 void setShininess( float shininess );
61 void setAlpha( float alpha );
62 void setBeta( float beta );
63
69 void setDataDefinedEnabled( bool enabled );
70
71 private:
72 void init();
73 void updateShaders();
74
75 Qt3DRender::QParameter *mDiffuseParameter = nullptr;
76 Qt3DRender::QParameter *mSpecularParameter = nullptr;
77 Qt3DRender::QParameter *mWarmParameter = nullptr;
78 Qt3DRender::QParameter *mCoolParameter = nullptr;
79 Qt3DRender::QParameter *mShininessParameter = nullptr;
80 Qt3DRender::QParameter *mAlphaParameter = nullptr;
81 Qt3DRender::QParameter *mBetaParameter = nullptr;
82 Qt3DRender::QShaderProgram *mShaderProgram = nullptr;
83 bool mDataDefinedEnabled = false;
84};
85
87
88#endif // QGSGOOCHMATERIAL_H
Base class for all materials used within QGIS 3D views.
Definition qgsmaterial.h:40