16#ifndef QGSGOOCHMATERIALSETTINGS_H
17#define QGSGOOCHMATERIALSETTINGS_H
42 QString
type()
const override;
47 static std::unique_ptr<QgsAbstractMaterialSettings>
create();
59 QColor
warm()
const {
return mWarm; }
62 QColor
cool()
const {
return mCool; }
65 QColor
diffuse()
const {
return mDiffuse; }
72 double alpha()
const {
return mAlpha; }
75 double beta()
const {
return mBeta; }
155 return mDiffuse == other.mDiffuse
156 && mSpecular == other.mSpecular
157 && mWarm == other.mWarm
158 && mCool == other.mCool
166 QColor mDiffuse { QColor::fromRgbF( 0.7f, 0.7f, 0.7f, 1.0f ) };
167 QColor mSpecular { QColor::fromRgbF( 1.0f, 1.0f, 1.0f, 1.0f ) };
168 QColor mWarm { QColor( 107, 0, 107 ) };
169 QColor mCool { QColor( 255, 130, 0 ) };
170 double mShininess = 100.0;
171 double mAlpha = 0.25;
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 QgsAbstractMaterialSettings * clone() const =0
Clones the material settings.
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.
QColor specular() const
Returns specular color component.
double alpha() const
Returns the alpha value.
void setCool(const QColor &cool)
Sets cool color component.
void setWarm(const QColor &warm)
Sets warm color component.
QColor cool() const
Returns cool color component.
void setSpecular(const QColor &specular)
Sets specular color component.
QColor warm() const
Returns warm color component.
bool equals(const QgsAbstractMaterialSettings *other) const override
Returns true if this settings exactly matches an other settings.
QColor diffuse() const
Returns diffuse color component.
double beta() const
Returns the beta value.
bool operator==(const QgsGoochMaterialSettings &other) const
QgsGoochMaterialSettings()=default
static bool supportsTechnique(Qgis::MaterialRenderingTechnique technique)
Returns true if the specified technique is supported by the Gooch material.
void setBeta(double beta)
Sets beta value.
static std::unique_ptr< QgsAbstractMaterialSettings > create()
Returns a new instance of QgsGoochMaterialSettings.
void setShininess(double shininess)
Sets shininess of the surface.
void setAlpha(double alpha)
Sets alpha value.
void setDiffuse(const QColor &diffuse)
Sets diffuse color component.
double shininess() const
Returns shininess of the surface.
QSet< QgsAbstractMaterialSettings::Property > supportedProperties() const override
Returns the set of data-defined properties supported by this material.
Base class for all materials used within QGIS 3D views.
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).