QGIS API Documentation 4.1.0-Master (3fcefe620d1)
Loading...
Searching...
No Matches
qgsnullmaterial3dhandler.cpp
Go to the documentation of this file.
1/***************************************************************************
2 qgsnullmaterial3dhandler.cpp
3 --------------------------------------
4 Date : November 2020
5 Copyright : (C) 2020 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
17
19#include "qgsmaterial.h"
20
21#include <QMap>
22#include <QString>
23
24using namespace Qt::StringLiterals;
25
26
28{
29 if ( context.isHighlighted() )
30 {
31 switch ( technique )
32 {
37 {
38 return new QgsHighlightMaterial();
39 }
41 {
42 Q_ASSERT( false );
43 return nullptr;
44 }
48 {
49 // Lines are single color and do not need the highlight material
50 // Billboards are not supported yet
51 break;
52 }
53 }
54 }
55
56 return nullptr;
57}
58
60{
61 QMap<QString, QString> parameters;
62 return parameters;
63}
64
66{
67 return true;
68}
MaterialRenderingTechnique
Material rendering techniques.
Definition qgis.h:4375
@ Points
Point based rendering, requires point data.
Definition qgis.h:4379
@ Triangles
Triangle based rendering (default).
Definition qgis.h:4376
@ TrianglesFromModel
Triangle based rendering, using a model object source.
Definition qgis.h:4381
@ Lines
Line based rendering, requires line data.
Definition qgis.h:4377
@ Billboards
Flat billboard rendering.
Definition qgis.h:4383
@ TrianglesDataDefined
Triangle based rendering with possibility of datadefined color.
Definition qgis.h:4382
@ InstancedPoints
Instanced based rendering, requiring triangles and point data.
Definition qgis.h:4378
@ TrianglesWithFixedTexture
Triangle based rendering, using a fixed, non-user-configurable texture (e.g. for terrain rendering).
Definition qgis.h:4380
Abstract base class for material settings.
Context settings for a material.
bool isHighlighted() const
Returns true if the material should represent a highlighted state.
Base class for all materials used within QGIS 3D views.
Definition qgsmaterial.h:40
QMap< QString, QString > toExportParameters(const QgsAbstractMaterialSettings *settings) const override
Returns the parameters to be exported to .mtl file.
QgsMaterial * toMaterial(const QgsAbstractMaterialSettings *settings, Qgis::MaterialRenderingTechnique technique, const QgsMaterialContext &context) const override
Creates a new QgsMaterial object representing the material settings.
bool updatePreviewScene(Qt3DCore::QEntity *sceneRoot, const QgsAbstractMaterialSettings *settings, const QgsMaterialContext &context) const override
Updates an existing material preview scene with new material settings.