16#ifndef QGSGOOCHMATERIALSETTINGS_H
17#define QGSGOOCHMATERIALSETTINGS_H
42 QString
type()
const override;
58 QColor
warm()
const {
return mWarm; }
61 QColor
cool()
const {
return mCool; }
64 QColor
diffuse()
const {
return mDiffuse; }
71 double alpha()
const {
return mAlpha; }
74 double beta()
const {
return mBeta; }
100 return mDiffuse == other.mDiffuse
101 && mSpecular == other.mSpecular
102 && mWarm == other.mWarm
103 && mCool == other.mCool
111 QColor mDiffuse { QColor::fromRgbF( 0.7f, 0.7f, 0.7f, 1.0f ) };
112 QColor mSpecular { QColor::fromRgbF( 1.0f, 1.0f, 1.0f, 1.0f ) };
113 QColor mWarm { QColor( 107, 0, 107 ) };
114 QColor mCool { QColor( 255, 130, 0 ) };
115 double mShininess = 100.0;
116 double mAlpha = 0.25;
Provides global constants and enumerations for use throughout the application.
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.
QgsGoochMaterialSettings * clone() const override
Clones the material settings.
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 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.
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).