22using namespace Qt::StringLiterals;
26 return u
"metalroughtextured"_s;
64 return *
this == *otherMetal;
74 mBaseColorTexturePath = elem.attribute( u
"base_color_texture_path"_s, QString() );
75 mMetalnessTexturePath = elem.attribute( u
"metalness_texture_path"_s, QString() );
76 mRoughnessTexturePath = elem.attribute( u
"roughness_texture_path"_s, QString() );
77 mAmbientOcclusionTexturePath = elem.attribute( u
"ambient_occlusion_texture_path"_s, QString() );
78 mTextureScale = elem.attribute( u
"texture_scale"_s, QString(
"1.0" ) ).toDouble();
79 mTextureRotation = elem.attribute( u
"texture_rotation"_s, QString(
"0.0" ) ).toDouble();
86 elem.setAttribute( u
"base_color_texture_path"_s, mBaseColorTexturePath );
87 elem.setAttribute( u
"metalness_texture_path"_s, mMetalnessTexturePath );
88 elem.setAttribute( u
"roughness_texture_path"_s, mRoughnessTexturePath );
89 elem.setAttribute( u
"ambient_occlusion_texture_path"_s, mAmbientOcclusionTexturePath );
90 elem.setAttribute( u
"texture_scale"_s, mTextureScale );
91 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.
QString type() const override
Returns the unique type name for the material.
QgsMetalRoughTexturedMaterialSettings * clone() const override
Clones the material settings.
static QgsAbstractMaterialSettings * create()
Returns a new instance of QgsMetalRoughTexturedMaterialSettings.
void writeXml(QDomElement &elem, const QgsReadWriteContext &context) const override
Writes settings to a DOM element.
void readXml(const QDomElement &elem, const QgsReadWriteContext &context) override
Reads settings from a DOM element.
bool equals(const QgsAbstractMaterialSettings *other) const override
Returns true if this settings exactly matches an other settings.
bool requiresTextureCoordinates() const override
Returns true if the material requires texture coordinates to be generated during triangulation.
static bool supportsTechnique(Qgis::MaterialRenderingTechnique technique)
Returns true if the specified technique is supported by the metal rough material.
QgsMetalRoughTexturedMaterialSettings()=default
A container for the context for various read/write operations on objects.