16#ifndef QGSPHONGTEXTUREDMATERIALSETTINGS_H
17#define QGSPHONGTEXTUREDMATERIALSETTINGS_H
43 QString
type()
const override;
59 QColor
ambient()
const {
return mAmbient; }
84 double textureRotation()
const;
90 double opacity()
const {
return mOpacity; }
106 mDiffuseTexturePath = path;
107 mTextureAverageColor.reset();
179 return mAmbient == other.mAmbient
180 && mSpecular == other.mSpecular
181 && mShininess == other.mShininess
182 && mOpacity == other.mOpacity
183 && mDiffuseTexturePath == other.mDiffuseTexturePath
184 && mTextureScale == other.mTextureScale
185 && mTextureRotation == other.mTextureRotation
190 QColor textureAverageColor()
const;
193 QColor mAmbient { QColor::fromRgbF( 0.1f, 0.1f, 0.1f, 1.0f ) };
194 QColor mSpecular { QColor::fromRgbF( 1.0f, 1.0f, 1.0f, 1.0f ) };
195 double mShininess = 0.0;
196 double mOpacity = 1.0;
197 QString mDiffuseTexturePath;
198 double mTextureScale { 1.0f };
199 double mTextureRotation { 0.0f };
200 mutable std::optional<QColor> mTextureAverageColor;
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 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.
Base class for all materials used within QGIS 3D views.
void setShininess(double shininess)
Sets shininess of the surface.
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 setTextureRotation(double rotation)
Sets the texture rotation in degrees.
void setSpecular(const QColor &specular)
Sets specular color component.
void setDiffuseTexturePath(const QString &path)
Sets the path of the diffuse texture.
QString diffuseTexturePath() const
Returns the diffuse texture path.
QColor specular() const
Returns specular color component.
void setTextureScale(double scale)
Sets the texture scale The texture scale changes the size of the displayed texture in the 3D scene If...
void setAmbient(const QColor &ambient)
Sets ambient color component.
double shininess() const
Returns shininess of the surface.
double opacity() const
Returns the opacity of the surface.
QgsPhongTexturedMaterialSettings * clone() const override
Clones the material settings.
void setOpacity(double opacity)
Sets opacity of the surface.
static QgsAbstractMaterialSettings * create()
Returns a new instance of QgsPhongTexturedMaterialSettings.
bool operator==(const QgsPhongTexturedMaterialSettings &other) const
double textureScale() const
Returns the texture scale The texture scale changes the size of the displayed texture in the 3D scene...
QColor ambient() const
Returns ambient color component.
A container for the context for various read/write operations on objects.