QGIS API Documentation 4.1.0-Master (ca2ac17535b)
Loading...
Searching...
No Matches
qgs3d.h
Go to the documentation of this file.
1/***************************************************************************
2 qgs3d.h
3 --------
4 begin : July 2020
5 copyright : (C) 2020 by Nyall Dawson
6 email : nyall dot dawson at gmail dot com
7 ***************************************************************************/
8
9/***************************************************************************
10 * *
11 * This program is free software; you can redistribute it and/or modify *
12 * it under the terms of the GNU General Public License as published by *
13 * the Free Software Foundation; either version 2 of the License, or *
14 * (at your option) any later version. *
15 * *
16 ***************************************************************************/
17
18#ifndef QGS3D_H
19#define QGS3D_H
20
21#include <memory>
22
23#include "qgis.h"
24#include "qgis_3d.h"
25#include "qgis_sip.h"
26
31class QgsMaterial;
35template<class T> class QgsSettingsEntryEnumFlag;
36
37#ifndef SIP_RUN
38namespace Qt3DCore
39{
40 class QGeometry;
41}
42
43namespace Qt3DRender
44{
45 class QEffect;
46}
47#endif
48
55class _3D_EXPORT Qgs3D
56{
57 public:
61
62 Qgs3D( const Qgs3D &other ) = delete;
63 Qgs3D &operator=( const Qgs3D &other ) = delete;
64
68 static Qgs3D *instance();
69
70 ~Qgs3D();
71
75 static void initialize();
76
81
86
87#ifndef SIP_RUN
96
101
102 // if you change this, also update the corresponding constant in shadows.inc.frag!
104 static constexpr int NUM_SHADOW_CASCADES = 4;
105
106#endif
107
108 private:
109 Qgs3D();
110
111#ifdef SIP_RUN
112 Qgs3D( const Qgs3D &other );
113#endif
114
115 bool mInitialized = false;
116
117 Qgs3DTerrainRegistry *mTerrainRegistry = nullptr;
118 std::unique_ptr< QgsAbstractMaterial3DHandler > mNullMaterialHandler;
119 std::unique_ptr< QgsAbstractMaterial3DHandler > mPhongMaterialHandler;
120 std::unique_ptr< QgsAbstractMaterial3DHandler > mPhongTexturedMaterialHandler;
121 std::unique_ptr< QgsAbstractMaterial3DHandler > mSimpleLineMaterialHandler;
122 std::unique_ptr< QgsAbstractMaterial3DHandler > mGoochMaterialHandler;
123 std::unique_ptr< QgsAbstractMaterial3DHandler > mMetalRoughMaterialHandler;
124 std::unique_ptr< QgsAbstractMaterial3DHandler > mMetalRoughTexturedMaterialHandler;
125};
126
127#endif // QGS3D_H
MaterialRenderingTechnique
Material rendering techniques.
Definition qgis.h:4342
Registry of available 3d terrain classes.
static void initialize()
Initializes the 3D framework.
Definition qgs3d.cpp:77
static Qgs3DTerrainRegistry * terrainRegistry()
Returns the terrain registry, used for managing 3D terrains.
Definition qgs3d.cpp:130
static const QgsSettingsEntryEnumFlag< Qgis::TextureFilterQuality > * settingTextureFilterQuality
Definition qgs3d.h:59
static QgsMaterial * toMaterial(const QgsAbstractMaterialSettings *settings, Qgis::MaterialRenderingTechnique technique, const QgsMaterialContext &context)
Creates a new QgsMaterial object representing the material settings.
Definition qgs3d.cpp:152
static const QgsSettingsEntryBool * settingMsaaEnabled
Definition qgs3d.h:58
static QgsMaterialRegistry * materialRegistry()
Returns the material registry, used for managing 3D materials.
Definition qgs3d.cpp:125
static Qgs3D * instance()
Returns a pointer to the singleton instance.
Definition qgs3d.cpp:60
static const QgsAbstractMaterial3DHandler * handlerForMaterialSettings(const QgsAbstractMaterialSettings *settings)
Returns the handler to use for a material settings.
Definition qgs3d.cpp:135
Qgs3D & operator=(const Qgs3D &other)=delete
static constexpr int NUM_SHADOW_CASCADES
Number of shadow map cascades.
Definition qgs3d.h:104
Qgs3D(const Qgs3D &other)=delete
static const QgsSettingsEntryEnumFlag< Qgis::ShadowQuality > * settingShadowQuality
Definition qgs3d.h:60
Abstract base class for material 3D handlers.
Abstract base class for material settings.
Expression contexts are used to encapsulate the parameters around which a QgsExpression should be eva...
Context settings for a material.
Registry of available 3d material settings classes.
Base class for all materials used within QGIS 3D views.
Definition qgsmaterial.h:40
A boolean settings entry.
A template class for enum and flag settings entry.
#define SIP_SKIP
Definition qgis_sip.h:133