QGIS API Documentation 4.1.0-Master (3b8ef1f72a3)
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 return new QgsHighlightMaterial( technique );
31
32 return nullptr;
33}
34
36{
37 QMap<QString, QString> parameters;
38 return parameters;
39}
40
43
45{
46 return true;
47}
MaterialRenderingTechnique
Material rendering techniques.
Definition qgis.h:4327
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.
void addParametersToEffect(Qt3DRender::QEffect *effect, const QgsAbstractMaterialSettings *settings, const QgsMaterialContext &materialContext) const override
Adds parameters from the material settings to a destination effect.
bool updatePreviewScene(Qt3DCore::QEntity *sceneRoot, const QgsAbstractMaterialSettings *settings, const QgsMaterialContext &context) const override
Updates an existing material preview scene with new material settings.