16#ifndef QGSPHONGMATERIALSETTINGS_H
17#define QGSPHONGMATERIALSETTINGS_H
41 QString
type()
const override;
57 QColor ambient()
const {
return mAmbient; }
59 QColor
diffuse()
const {
return mDiffuse; }
69 double opacity()
const {
return mOpacity; }
107 void setAmbient(
const QColor &ambient ) { mAmbient = ambient; }
109 void setDiffuse(
const QColor &diffuse ) { mDiffuse = diffuse; }
111 void setSpecular(
const QColor &specular ) { mSpecular = specular; }
163#if QT_VERSION < QT_VERSION_CHECK( 6, 0, 0 )
173 return mAmbient == other.mAmbient && mDiffuse == other.mDiffuse && mOpacity == other.mOpacity && mSpecular == other.mSpecular && mShininess == other.mShininess && mAmbientCoefficient == other.mAmbientCoefficient && mDiffuseCoefficient == other.mDiffuseCoefficient && mSpecularCoefficient == other.mSpecularCoefficient &&
dataDefinedProperties() == other.
dataDefinedProperties();
177 QColor mAmbient { QColor::fromRgbF( 0.1f, 0.1f, 0.1f, 1.0f ) };
178 QColor mDiffuse { QColor::fromRgbF( 0.7f, 0.7f, 0.7f, 1.0f ) };
179 QColor mSpecular { QColor::fromRgbF( 1.0f, 1.0f, 1.0f, 1.0f ) };
180 double mShininess = 0.0;
182 double mAmbientCoefficient = 1.0;
183 double mDiffuseCoefficient = 1.0;
184 double mSpecularCoefficient = 1.0;
186 double mOpacity = 1.0;
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.
QgsPropertyCollection dataDefinedProperties() const
Returns the symbol material property collection, used for data defined overrides.
Expression contexts are used to encapsulate the parameters around which a QgsExpression should be eva...
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.
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.
QColor specular() const
Returns specular 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...
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).
The class is used as a container of context for various read/write operations on other objects.
QgsMaterialSettingsRenderingTechnique
Material rendering techniques 3.