QGIS API Documentation
3.16.0-Hannover (43b64b13f3)
|
Go to the documentation of this file.
16 #ifndef QGSPHONGMATERIALSETTINGS_H
17 #define QGSPHONGMATERIALSETTINGS_H
45 QString
type()
const override;
60 QColor ambient()
const {
return mAmbient; }
62 QColor
diffuse()
const {
return mDiffuse; }
71 void setAmbient(
const QColor &ambient ) { mAmbient = ambient; }
73 void setDiffuse(
const QColor &diffuse ) { mDiffuse = diffuse; }
75 void setSpecular(
const QColor &specular ) { mSpecular = specular; }
88 return mAmbient == other.mAmbient &&
89 mDiffuse == other.mDiffuse &&
90 mSpecular == other.mSpecular &&
91 mShininess == other.mShininess;
95 QColor mAmbient{ QColor::fromRgbF( 0.1f, 0.1f, 0.1f, 1.0f ) };
96 QColor mDiffuse{ QColor::fromRgbF( 0.7f, 0.7f, 0.7f, 1.0f ) };
97 QColor mSpecular{ QColor::fromRgbF( 1.0f, 1.0f, 1.0f, 1.0f ) };
98 float mShininess = 0.0f;
102 #endif // QGSPHONGMATERIALSETTINGS_H
virtual QString type() const =0
Returns the unique type name for the material.
QColor diffuse() const
Returns diffuse color component.
QColor specular() const
Returns specular color component.
QgsPhongMaterialSettings()=default
Constructor for QgsPhongMaterialSettings.
The class is used as a container of context for various read/write operations on other objects.
virtual QMap< QString, QString > toExportParameters() const =0
Returns the parameters to be exported to .mtl file.
virtual void readXml(const QDomElement &element, const QgsReadWriteContext &context)=0
Reads settings from a DOM element.
void setSpecular(const QColor &specular)
Sets specular color component.
3 Context settings for a material.
3 Basic shading material used for rendering based on the Phong shading model with three color compone...
3 Abstract base class for material settings.
bool operator==(const QgsPhongMaterialSettings &other) const
void setShininess(float shininess)
Sets shininess of the surface.
virtual void addParametersToEffect(Qt3DRender::QEffect *effect) const =0
Adds parameters from the material to a destination effect.
void setDiffuse(const QColor &diffuse)
Sets diffuse color component.
virtual void writeXml(QDomElement &element, const QgsReadWriteContext &context) const =0
Writes settings to a DOM element.
QgsMaterialSettingsRenderingTechnique
Material rendering techniques 3.
virtual Qt3DRender::QMaterial * toMaterial(QgsMaterialSettingsRenderingTechnique technique, const QgsMaterialContext &context) const =0
Creates a new QMaterial object representing the material settings.
void setAmbient(const QColor &ambient)
Sets ambient color component.
float shininess() const
Returns shininess of the surface.