16#ifndef QGSPHONGMATERIALSETTINGS_H
17#define QGSPHONGMATERIALSETTINGS_H
41 QString
type()
const override;
58 QColor
ambient()
const {
return mAmbient; }
60 QColor
diffuse()
const {
return mDiffuse; }
70 double opacity()
const {
return mOpacity; }
208 return mAmbient == other.mAmbient
209 && mDiffuse == other.mDiffuse
210 && mOpacity == other.mOpacity
211 && mSpecular == other.mSpecular
212 && mShininess == other.mShininess
213 && mAmbientCoefficient == other.mAmbientCoefficient
214 && mDiffuseCoefficient == other.mDiffuseCoefficient
215 && mSpecularCoefficient == other.mSpecularCoefficient
220 QColor mAmbient { QColor::fromRgbF( 0.1f, 0.1f, 0.1f, 1.0f ) };
221 QColor mDiffuse { QColor::fromRgbF( 0.7f, 0.7f, 0.7f, 1.0f ) };
222 QColor mSpecular { QColor::fromRgbF( 1.0f, 1.0f, 1.0f, 1.0f ) };
223 double mShininess = 0.0;
225 double mAmbientCoefficient = 1.0;
226 double mDiffuseCoefficient = 1.0;
227 double mSpecularCoefficient = 1.0;
229 double mOpacity = 1.0;
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.
Property
Data definable properties.
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.
Base class for all materials used within QGIS 3D views.
QSet< QgsAbstractMaterialSettings::Property > supportedProperties() const override
Returns the set of data-defined properties supported by this material.
double ambientCoefficient() const
Returns the coefficient for the ambient color contribution (ie strength factor of the ambient color).
void setOpacity(double opacity)
Sets opacity of the surface.
bool operator==(const QgsPhongMaterialSettings &other) const
void setDiffuse(const QColor &diffuse)
Sets diffuse color component.
bool equals(const QgsAbstractMaterialSettings *other) const override
Returns true if this settings exactly matches an other settings.
void setDiffuseCoefficient(double coefficient)
Sets the coefficient for the diffuse color contribution (ie strength factor of the diffuse color).
void setShininess(double shininess)
Sets shininess of the surface.
QColor diffuse() const
Returns diffuse color component.
double opacity() const
Returns the opacity of the surface.
static bool supportsTechnique(Qgis::MaterialRenderingTechnique technique)
Returns true if the specified technique is supported by the Phong material.
QColor specular() const
Returns specular color component.
QColor ambient() const
Returns ambient color component.
void setAmbient(const QColor &ambient)
Sets ambient color component.
void setSpecularCoefficient(double coefficient)
Sets the coefficient for the specular color contribution (ie strength factor of the specular color).
double specularCoefficient() const
Returns the coefficient for the specular color contribution (ie strength factor of the specular color...
static QgsAbstractMaterialSettings * create()
Returns a new instance of QgsPhongMaterialSettings.
QgsPhongMaterialSettings * clone() const override
Clones the material settings.
double shininess() const
Returns shininess of the surface.
QgsPhongMaterialSettings()=default
double diffuseCoefficient() const
Returns the coefficient for the diffuse color contribution (ie strength factor of the diffuse color).
void setSpecular(const QColor &specular)
Sets specular color component.
void setAmbientCoefficient(double coefficient)
Sets the coefficient for the ambient color contribution (ie strength factor of the ambient color).
A container for the context for various read/write operations on objects.