16#ifndef QGSGOOCHMATERIALSETTINGS_H
17#define QGSGOOCHMATERIALSETTINGS_H
43 QString
type()
const override;
58 QColor warm()
const {
return mWarm; }
61 QColor
cool()
const {
return mCool; }
64 QColor
diffuse()
const {
return mDiffuse; }
71 float alpha()
const {
return mAlpha; }
74 float beta()
const {
return mBeta; }
77 void setWarm(
const QColor &warm ) { mWarm = warm; }
80 void setCool(
const QColor &cool ) { mCool = cool; }
83 void setDiffuse(
const QColor &diffuse ) { mDiffuse = diffuse; }
85 void setSpecular(
const QColor &specular ) { mSpecular = specular; }
90 void setAlpha(
float alpha ) { mAlpha = alpha; }
93 void setBeta(
float beta ) { mBeta = beta; }
105#if QT_VERSION < QT_VERSION_CHECK(6, 0, 0)
116 return mDiffuse == other.mDiffuse &&
117 mSpecular == other.mSpecular &&
118 mWarm == other.mWarm &&
119 mCool == other.mCool &&
120 mShininess == other.mShininess &&
121 mAlpha == other.mAlpha &&
122 mBeta == other.mBeta;
126 QColor mDiffuse{ QColor::fromRgbF( 0.7f, 0.7f, 0.7f, 1.0f ) };
127 QColor mSpecular{ QColor::fromRgbF( 1.0f, 1.0f, 1.0f, 1.0f ) };
128 QColor mWarm {QColor( 107, 0, 107 ) };
129 QColor mCool {QColor( 255, 130, 0 )};
130 float mShininess = 100.0f;
131 float mAlpha = 0.25f;
virtual void writeXml(QDomElement &element, const QgsReadWriteContext &) const
Writes settings to a DOM element.
virtual QByteArray dataDefinedVertexColorsAsByte(const QgsExpressionContext &expressionContext) const
Returns byte array corresponding to the data defined colors depending of the expressionContext,...
virtual QMap< QString, QString > toExportParameters() const =0
Returns the parameters to be exported to .mtl file.
virtual void readXml(const QDomElement &element, const QgsReadWriteContext &)
Reads settings from a DOM element.
virtual int dataDefinedByteStride() const
Returns byte stride of the data defined colors,used to fill the vertex colors data defined buffer for...
virtual void addParametersToEffect(Qt3DRender::QEffect *effect, const QgsMaterialContext &materialContext) const =0
Adds parameters from the material to a destination effect.
virtual QString type() const =0
Returns the unique type name for the material.
virtual void applyDataDefinedToGeometry(Qt3DCore::QGeometry *geometry, int vertexCount, const QByteArray &dataDefinedBytes) const
Applies the data defined bytes, dataDefinedBytes, on the geometry by filling a specific vertex buffer...
virtual QgsMaterial * toMaterial(QgsMaterialSettingsRenderingTechnique technique, const QgsMaterialContext &context) const =0
Creates a new QgsMaterial object representing the material settings.
Expression contexts are used to encapsulate the parameters around which a QgsExpression should be eva...
QColor specular() const
Returns specular color component.
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 setShininess(float shininess)
Sets shininess of the surface.
float alpha() const
Returns the alpha value.
void setAlpha(float alpha)
Sets alpha value.
void setSpecular(const QColor &specular)
Sets specular color component.
QColor diffuse() const
Returns diffuse color component.
bool operator==(const QgsGoochMaterialSettings &other) const
QgsGoochMaterialSettings()=default
float shininess() const
Returns shininess of the surface.
float beta() const
Returns the beta value.
void setDiffuse(const QColor &diffuse)
Sets diffuse color component.
void setBeta(float beta)
Sets beta value.
The class is used as a container of context for various read/write operations on other objects.
QgsMaterialSettingsRenderingTechnique
Material rendering techniques 3.