16#ifndef QGSMETALROUGHTEXTUREDMATERIALSETTINGS_H
17#define QGSMETALROUGHTEXTUREDMATERIALSETTINGS_H
40 QString
type()
const override;
272 return mBaseColorTexturePath == other.mBaseColorTexturePath
273 && mMetalnessTexturePath == other.mMetalnessTexturePath
274 && mRoughnessTexturePath == other.mRoughnessTexturePath
275 && mNormalTexturePath == other.mNormalTexturePath
276 && mAmbientOcclusionTexturePath == other.mAmbientOcclusionTexturePath
277 && mHeightTexturePath == other.mHeightTexturePath
278 && mEmissionTexturePath == other.mEmissionTexturePath
288 QColor textureAverageColor(
const QString &texturePath )
const;
291 QString mBaseColorTexturePath;
292 QString mMetalnessTexturePath;
293 QString mRoughnessTexturePath;
294 QString mNormalTexturePath;
295 QString mHeightTexturePath;
296 double mParallaxScale { 0.1 };
298 QString mAmbientOcclusionTexturePath;
300 QString mEmissionTexturePath;
301 double mEmissionFactor { 1.0 };
303 double mTextureScale { 1.0 };
304 double mTextureRotation { 0.0 };
305 double mOpacity { 1.0 };
307 mutable std::optional<QColor> mAverageColor;
MaterialRenderingTechnique
Material rendering techniques.
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 bool requiresTangents() const
Returns true if the material requires tangents generated during triangulation.
virtual QColor averageColor() const =0
Returns an approximate color representing the blended material color.
virtual QString type() const =0
Returns the unique type name for the material.
virtual void setColorsFromBase(const QColor &baseColor)=0
Decomposes a base color into the material's color components, and sets the material's colors accordin...
QgsPropertyCollection dataDefinedProperties() const
Returns the symbol material property collection, used for data defined overrides.
virtual bool requiresTextureCoordinates() const
Returns true if the material requires texture coordinates to be generated during triangulation.
double emissionFactor() const
Returns the emission factor, which dictates the strength of the emission effect.
void setTextureScale(double scale)
Sets the texture scale.
QgsMetalRoughTexturedMaterialSettings * clone() const override
Clones the material settings.
static QgsAbstractMaterialSettings * create()
Returns a new instance of QgsMetalRoughTexturedMaterialSettings.
QString roughnessTexturePath() const
Returns the path to the roughness texture map.
double textureRotation() const
Returns the texture rotation, in degrees.
double textureScale() const
Returns the texture scale.
double opacity() const
Returns the opacity of the surface.
void setTextureRotation(double rotation)
Sets the texture rotation, in degrees.
void setMetalnessTexturePath(const QString &path)
Sets the path to the metalness texture map.
void setEmissionTexturePath(const QString &path)
Sets the path to the emission/luminosity texture map.
QString normalTexturePath() const
Returns the path to the normal texture map.
QString ambientOcclusionTexturePath() const
Returns the path to the ambient occlusion texture map.
void setHeightTexturePath(const QString &path)
Sets the path to the height texture map.
void setAmbientOcclusionTexturePath(const QString &path)
Sets the path to the ambient occlusion texture map.
QString metalnessTexturePath() const
Returns the path to the metalness texture map.
void setNormalTexturePath(const QString &path)
Sets the path to the normal texture map.
bool equals(const QgsAbstractMaterialSettings *other) const override
Returns true if this settings exactly matches an other settings.
QString baseColorTexturePath() const
Returns the path to the base color texture map.
void setEmissionFactor(double factor)
Sets the emission factor, which dictates the strength of the emission effect.
static bool supportsTechnique(Qgis::MaterialRenderingTechnique technique)
Returns true if the specified technique is supported by the metal rough material.
QString heightTexturePath() const
Returns the path to the height texture map.
QString emissionTexturePath() const
Returns the path to the emission/luminosity texture map.
void setBaseColorTexturePath(const QString &path)
Sets the path to the base color texture map.
void setOpacity(double opacity)
Sets the opacity of the surface.
bool operator==(const QgsMetalRoughTexturedMaterialSettings &other) const
void setRoughnessTexturePath(const QString &path)
Sets the path to the roughness texture map.
QgsMetalRoughTexturedMaterialSettings()=default
void setParallaxScale(double scale)
Sets the parallax scale, which dictates the strength of the height displacement effect.
double parallaxScale() const
Returns the parallax scale, which dictates the strength of the height displacement effect.
A container for the context for various read/write operations on objects.
bool qgsDoubleNear(double a, double b, double epsilon=4 *std::numeric_limits< double >::epsilon())
Compare two doubles (but allow some difference).