QGIS API Documentation 4.1.0-Master (31622b25bb0)
Loading...
Searching...
No Matches
qgsmaterial.h
Go to the documentation of this file.
1/***************************************************************************
2 qgsmaterial.h
3 --------------------------------------
4 Date : July 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 QGSMATERIAL_H
17#define QGSMATERIAL_H
18
19
20#include "qgis_3d.h"
21
22#include <QList>
23#include <QVector4D>
24#include <Qt3DRender/QMaterial>
25
26#define SIP_NO_FILE
27
28namespace Qt3DRender
29{
30 class QEffect;
31}
32
39class _3D_EXPORT QgsMaterial : public Qt3DRender::QMaterial
40{
41 Q_OBJECT
42 public:
46 explicit QgsMaterial( Qt3DCore::QNode *parent = nullptr );
47 ~QgsMaterial() override;
48
55 void enableClipping( const QList<QVector4D> &clipPlanesEquations );
56
64 void disableClipping();
65
74 bool castsShadows() const;
75
82 void setCastsShadows( bool enabled );
83
84 private:
86 static const QString CLIP_PLANE_ARRAY_PARAMETER_NAME;
88 static const QString CLIP_PLANE_MAX_PLANE_PARAMETER_NAME;
90 static const QString CLIP_PLANE_DEFINE;
91
92 bool mClippingEnabled = false;
93 bool mCastsShadows = true;
94
95 friend class TestQgs3DMaterial;
96};
97
98#endif // QGSMATERIAL_H
void enableClipping(const QList< QVector4D > &clipPlanesEquations)
Adds two uniform parameters to define OpenGL clipping from clipPlanesEquations.
void disableClipping()
Removes the uniform parameters used to define OpenGL clipping.
bool castsShadows() const
Returns true if the material should cast shadows.
void setCastsShadows(bool enabled)
Sets whether the material should cast shadows.
friend class TestQgs3DMaterial
Definition qgsmaterial.h:95
QgsMaterial(Qt3DCore::QNode *parent=nullptr)
Constructor for QgsMaterial, with the specified parent node.
~QgsMaterial() override