23using namespace Qt::StringLiterals;
65 return *
this == *otherPhong;
73 mShininess = elem.attribute( u
"shininess"_s ).toDouble();
74 mOpacity = elem.attribute( u
"opacity"_s, u
"1.0"_s ).toDouble();
75 mAmbientCoefficient = elem.attribute( u
"ka"_s, u
"1.0"_s ).toDouble();
76 mDiffuseCoefficient = elem.attribute( u
"kd"_s, u
"1.0"_s ).toDouble();
77 mSpecularCoefficient = elem.attribute( u
"ks"_s, u
"1.0"_s ).toDouble();
87 elem.setAttribute( u
"shininess"_s, mShininess );
88 elem.setAttribute( u
"opacity"_s, mOpacity );
89 elem.setAttribute( u
"ka"_s, mAmbientCoefficient );
90 elem.setAttribute( u
"kd"_s, mDiffuseCoefficient );
91 elem.setAttribute( u
"ks"_s, mSpecularCoefficient );
MaterialRenderingTechnique
Material rendering techniques.
@ Points
Point based rendering, requires point data.
@ Triangles
Triangle based rendering (default).
@ TrianglesFromModel
Triangle based rendering, using a model object source.
@ Lines
Line based rendering, requires line data.
@ Billboards
Flat billboard rendering.
@ TrianglesDataDefined
Triangle based rendering with possibility of datadefined color.
@ InstancedPoints
Instanced based rendering, requiring triangles and point data.
@ TrianglesWithFixedTexture
Triangle based rendering, using a fixed, non-user-configurable texture (e.g. for terrain rendering).
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.
static QColor colorFromString(const QString &string)
Decodes a string into a color value.
static QString colorToString(const QColor &color)
Encodes a color into a string value.
bool equals(const QgsAbstractMaterialSettings *other) const override
Returns true if this settings exactly matches an other settings.
QString type() const override
Returns the unique type name for the material.
static bool supportsTechnique(Qgis::MaterialRenderingTechnique technique)
Returns true if the specified technique is supported by the Phong material.
static QgsAbstractMaterialSettings * create()
Returns a new instance of QgsPhongMaterialSettings.
void writeXml(QDomElement &elem, const QgsReadWriteContext &context) const override
Writes settings to a DOM element.
QgsPhongMaterialSettings * clone() const override
Clones the material settings.
QgsPhongMaterialSettings()=default
void readXml(const QDomElement &elem, const QgsReadWriteContext &context) override
Reads settings from a DOM element.
A container for the context for various read/write operations on objects.