QGIS API Documentation
3.26.3-Buenos Aires (65e4edfdad)
|
Go to the documentation of this file.
16 #ifndef QGSGOOCHMATERIALSETTINGS_H
17 #define QGSGOOCHMATERIALSETTINGS_H
45 QString
type()
const override;
60 QColor
warm()
const {
return mWarm; }
63 QColor
cool()
const {
return mCool; }
66 QColor
diffuse()
const {
return mDiffuse; }
73 float alpha()
const {
return mAlpha; }
76 float beta()
const {
return mBeta; }
79 void setWarm(
const QColor &warm ) { mWarm = warm; }
82 void setCool(
const QColor &cool ) { mCool = cool; }
85 void setDiffuse(
const QColor &diffuse ) { mDiffuse = diffuse; }
87 void setSpecular(
const QColor &specular ) { mSpecular = specular; }
92 void setAlpha(
float alpha ) { mAlpha = alpha; }
95 void setBeta(
float beta ) { mBeta = beta; }
114 return mDiffuse == other.mDiffuse &&
115 mSpecular == other.mSpecular &&
116 mWarm == other.mWarm &&
117 mCool == other.mCool &&
118 mShininess == other.mShininess &&
119 mAlpha == other.mAlpha &&
120 mBeta == other.mBeta;
124 QColor mDiffuse{ QColor::fromRgbF( 0.7f, 0.7f, 0.7f, 1.0f ) };
125 QColor mSpecular{ QColor::fromRgbF( 1.0f, 1.0f, 1.0f, 1.0f ) };
126 QColor mWarm {QColor( 107, 0, 107 ) };
127 QColor mCool {QColor( 255, 130, 0 )};
128 float mShininess = 100.0f;
129 float mAlpha = 0.25f;
133 Qt3DRender::QMaterial *dataDefinedMaterial()
const;
137 #endif // QGSGOOCHMATERIALSETTINGS_H
QColor specular() const
Returns specular color component.
Expression contexts are used to encapsulate the parameters around which a QgsExpression should be eva...
virtual QString type() const =0
Returns the unique type name for the material.
virtual void applyDataDefinedToGeometry(Qt3DRender::QGeometry *geometry, int vertexCount, const QByteArray &dataDefinedBytes) const
Applies the data defined bytes, dataDefinedBytes, on the geometry by filling a specific vertex buffer...
void setShininess(float shininess)
Sets shininess of the surface.
QColor cool() const
Returns cool color component.
The class is used as a container of context for various read/write operations on other objects.
void setAlpha(float alpha)
Sets alpha value.
virtual QMap< QString, QString > toExportParameters() const =0
Returns the parameters to be exported to .mtl file.
void setCool(const QColor &cool)
Sets cool color component.
void setSpecular(const QColor &specular)
Sets specular color component.
float shininess() const
Returns shininess of the surface.
virtual QByteArray dataDefinedVertexColorsAsByte(const QgsExpressionContext &expressionContext) const
Returns byte array corresponding to the data defined colors depending of the expressionContext,...
void setDiffuse(const QColor &diffuse)
Sets diffuse color component.
Context settings for a material.
float beta() const
Returns the beta value.
bool operator==(const QgsGoochMaterialSettings &other) const
Abstract base class for material settings.
virtual int dataDefinedByteStride() const
Returns byte stride of the data defined colors,used to fill the vertex colors data defined buffer for...
void setBeta(float beta)
Sets beta value.
virtual void addParametersToEffect(Qt3DRender::QEffect *effect) const =0
Adds parameters from the material to a destination effect.
virtual void writeXml(QDomElement &element, const QgsReadWriteContext &) const
Writes settings to a DOM element.
QgsMaterialSettingsRenderingTechnique
Material rendering techniques.
void setWarm(const QColor &warm)
Sets warm color component.
virtual Qt3DRender::QMaterial * toMaterial(QgsMaterialSettingsRenderingTechnique technique, const QgsMaterialContext &context) const =0
Creates a new QMaterial object representing the material settings.
virtual void readXml(const QDomElement &element, const QgsReadWriteContext &)
Reads settings from a DOM element.
Basic shading material used for rendering based on the Phong shading model with three color component...
float alpha() const
Returns the alpha value.
virtual QgsAbstractMaterialSettings * clone() const =0
Clones the material settings.
QColor diffuse() const
Returns diffuse color component.
QColor warm() const
Returns warm color component.