24using namespace Qt::StringLiterals;
28 return u
"phongtextured"_s;
66 return *
this == *otherPhong;
71 return !mDiffuseTexturePath.isEmpty();
76 return mTextureRotation;
83 mShininess = elem.attribute( u
"shininess"_s ).toDouble();
84 mOpacity = elem.attribute( u
"opacity"_s, u
"1.0"_s ).toDouble();
85 mDiffuseTexturePath = elem.attribute( u
"diffuse_texture_path"_s, QString() );
86 mTextureScale = elem.attribute( u
"texture_scale"_s, QString(
"1.0" ) ).toDouble();
87 mTextureRotation = elem.attribute( u
"texture-rotation"_s, QString(
"0.0" ) ).toDouble();
96 elem.setAttribute( u
"shininess"_s, mShininess );
97 elem.setAttribute( u
"opacity"_s, mOpacity );
98 elem.setAttribute( u
"diffuse_texture_path"_s, mDiffuseTexturePath );
99 elem.setAttribute( u
"texture_scale"_s, mTextureScale );
100 elem.setAttribute( u
"texture-rotation"_s, mTextureRotation );
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 requiresTextureCoordinates() const override
Returns true if the material requires texture coordinates to be generated during triangulation.
QgsPhongTexturedMaterialSettings()=default
static bool supportsTechnique(Qgis::MaterialRenderingTechnique technique)
Returns true if the specified technique is supported by the Phong material.
bool equals(const QgsAbstractMaterialSettings *other) const override
Returns true if this settings exactly matches an other settings.
void writeXml(QDomElement &elem, const QgsReadWriteContext &context) const override
Writes settings to a DOM element.
double textureRotation() const
Returns the texture rotation, in degrees.
QString type() const override
Returns the unique type name for the material.
void readXml(const QDomElement &elem, const QgsReadWriteContext &context) override
Reads settings from a DOM element.
QgsPhongTexturedMaterialSettings * clone() const override
Clones the material settings.
static QgsAbstractMaterialSettings * create()
Returns a new instance of QgsPhongTexturedMaterialSettings.
A container for the context for various read/write operations on objects.