QGIS API Documentation 4.1.0-Master (3b8ef1f72a3)
Loading...
Searching...
No Matches
qgssimplelinematerialsettings.h
Go to the documentation of this file.
1/***************************************************************************
2 qgssimplelinematerialsettings.h
3 --------------------------------------
4 Date : August 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
16
17#ifndef QGSSIMPLELINEMATERIALSETTINGS_H
18#define QGSSIMPLELINEMATERIALSETTINGS_H
19
20#include "qgis_core.h"
22
23#include <QColor>
24
25class QgsMaterial;
26class QDomElement;
27
38{
39 public:
41
42 QString type() const override;
43
48
53
55 bool equals( const QgsAbstractMaterialSettings *other ) const override;
56
62 QColor ambient() const { return mAmbient; }
63
69 void setAmbient( const QColor &ambient ) { mAmbient = ambient; }
70
71 void readXml( const QDomElement &elem, const QgsReadWriteContext &context ) override;
72 void writeXml( QDomElement &elem, const QgsReadWriteContext &context ) const override;
73
74 // TODO c++20 - replace with = default
75 bool operator==( const QgsSimpleLineMaterialSettings &other ) const { return mAmbient == other.mAmbient && dataDefinedProperties() == other.dataDefinedProperties(); }
76
77 private:
78 QColor mAmbient { QColor::fromRgbF( 0.1f, 0.1f, 0.1f, 1.0f ) };
79};
80
81
82#endif // QGSSIMPLELINEMATERIALSETTINGS_H
MaterialRenderingTechnique
Material rendering techniques.
Definition qgis.h:4327
Abstract base class for material settings.
virtual void writeXml(QDomElement &element, const QgsReadWriteContext &) const
Writes settings to a DOM element.
virtual void readXml(const QDomElement &element, const QgsReadWriteContext &)
Reads settings from a DOM element.
virtual QString type() const =0
Returns the unique type name for the material.
QgsPropertyCollection dataDefinedProperties() const
Returns the symbol material property collection, used for data defined overrides.
Base class for all materials used within QGIS 3D views.
Definition qgsmaterial.h:40
A container for the context for various read/write operations on objects.
static bool supportsTechnique(Qgis::MaterialRenderingTechnique technique)
Returns true if the specified technique is supported by the material.
QgsSimpleLineMaterialSettings * clone() const override
Clones the material settings.
static QgsAbstractMaterialSettings * create()
Returns a new instance of QgsSimpleLineMaterialSettings.
bool operator==(const QgsSimpleLineMaterialSettings &other) const
void setAmbient(const QColor &ambient)
Sets the ambient color component.
QColor ambient() const
Returns the ambient color component.
bool equals(const QgsAbstractMaterialSettings *other) const override
Returns true if this settings exactly matches an other settings.
#define SIP_FACTORY
Definition qgis_sip.h:83