QGIS API Documentation 4.1.0-Master (3b8ef1f72a3)
Loading...
Searching...
No Matches
qgsmetalroughtexturedmaterialsettings.h
Go to the documentation of this file.
1/***************************************************************************
2 qgsmetalroughtexturedmaterialsettings.h
3 --------------------------------------
4 Date : April 2026
5 Copyright : (C) 2026 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#ifndef QGSMETALROUGHTEXTUREDMATERIALSETTINGS_H
17#define QGSMETALROUGHTEXTUREDMATERIALSETTINGS_H
18
19#include "qgis_core.h"
21
22#include <QColor>
23
24class QDomElement;
25
36{
37 public:
39
40 QString type() const override;
41
46
51
53 bool equals( const QgsAbstractMaterialSettings *other ) const override;
54
60 QString baseColorTexturePath() const { return mBaseColorTexturePath; }
61
67 QString metalnessTexturePath() const { return mMetalnessTexturePath; }
68
74 QString roughnessTexturePath() const { return mRoughnessTexturePath; }
75
81 QString ambientOcclusionTexturePath() const { return mAmbientOcclusionTexturePath; }
82
91 double textureScale() const { return mTextureScale; }
92
98 double textureRotation() const { return mTextureRotation; }
99
105 void setBaseColorTexturePath( const QString &path ) { mBaseColorTexturePath = path; }
106
112 void setMetalnessTexturePath( const QString &path ) { mMetalnessTexturePath = path; }
113
119 void setRoughnessTexturePath( const QString &path ) { mRoughnessTexturePath = path; }
120
126 void setAmbientOcclusionTexturePath( const QString &path ) { mAmbientOcclusionTexturePath = path; }
127
136 void setTextureScale( double scale ) { mTextureScale = scale; }
137
143 void setTextureRotation( double rotation ) { mTextureRotation = rotation; }
144
145 bool requiresTextureCoordinates() const override;
146 void readXml( const QDomElement &elem, const QgsReadWriteContext &context ) override;
147 void writeXml( QDomElement &elem, const QgsReadWriteContext &context ) const override;
148
150 {
151 return mBaseColorTexturePath == other.mBaseColorTexturePath
152 && mMetalnessTexturePath == other.mMetalnessTexturePath
153 && mRoughnessTexturePath == other.mRoughnessTexturePath
154 && mAmbientOcclusionTexturePath == other.mAmbientOcclusionTexturePath
155 && qgsDoubleNear( mTextureScale, other.mTextureScale )
156 && qgsDoubleNear( mTextureRotation, other.mTextureRotation )
158 }
159
160 private:
161 QString mBaseColorTexturePath;
162 QString mMetalnessTexturePath;
163 QString mRoughnessTexturePath;
164 QString mAmbientOcclusionTexturePath;
165
166 double mTextureScale { 1.0 };
167 double mTextureRotation { 0.0 };
168};
169
170
171#endif // QGSMETALROUGHTEXTUREDMATERIALSETTINGS_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.
virtual bool requiresTextureCoordinates() const
Returns true if the material requires texture coordinates to be generated during triangulation.
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.
void setTextureRotation(double rotation)
Sets the texture rotation, in degrees.
void setMetalnessTexturePath(const QString &path)
Sets the path to the metalness texture map.
QString ambientOcclusionTexturePath() const
Returns the path to the ambient occlusion 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.
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.
static bool supportsTechnique(Qgis::MaterialRenderingTechnique technique)
Returns true if the specified technique is supported by the metal rough material.
void setBaseColorTexturePath(const QString &path)
Sets the path to the base color texture map.
bool operator==(const QgsMetalRoughTexturedMaterialSettings &other) const
void setRoughnessTexturePath(const QString &path)
Sets the path to the roughness texture map.
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).
Definition qgis.h:7077
#define SIP_FACTORY
Definition qgis_sip.h:83