QGIS API Documentation
3.26.3-Buenos Aires (65e4edfdad)
|
Go to the documentation of this file.
16 #ifndef QGSPHONGTEXTUREDMATERIALSETTINGS_H
17 #define QGSPHONGTEXTUREDMATERIALSETTINGS_H
44 QString
type()
const override;
59 QColor
ambient()
const {
return mAmbient; }
90 float textureRotation()
const;
93 void setAmbient(
const QColor &ambient ) { mAmbient = ambient; }
96 void setSpecular(
const QColor &specular ) { mSpecular = specular; }
126 return mAmbient == other.mAmbient &&
127 mSpecular == other.mSpecular &&
128 mShininess == other.mShininess &&
129 mDiffuseTexturePath == other.mDiffuseTexturePath &&
130 mTextureScale == other.mTextureScale &&
131 mTextureRotation == other.mTextureRotation;
135 QColor mAmbient{ QColor::fromRgbF( 0.1f, 0.1f, 0.1f, 1.0f ) };
136 QColor mSpecular{ QColor::fromRgbF( 1.0f, 1.0f, 1.0f, 1.0f ) };
137 float mShininess = 0.0f;
138 QString mDiffuseTexturePath;
139 float mTextureScale{ 1.0f };
140 float mTextureRotation{ 0.0f };
144 #endif // QGSPHONGTEXTUREDMATERIALSETTINGS_H
virtual QString type() const =0
Returns the unique type name for the material.
The class is used as a container of context for various read/write operations on other objects.
QColor specular() const
Returns specular color component.
virtual QMap< QString, QString > toExportParameters() const =0
Returns the parameters to be exported to .mtl file.
void setTextureRotation(float rotation)
Sets the texture rotation in degrees.
Context settings for a material.
QString diffuseTexturePath() const
Returns the diffuse texture path.
float textureScale() const
Returns the texture scale The texture scale changes the size of the displayed texture in the 3D scene...
Abstract base class for material settings.
float shininess() const
Returns shininess of the surface.
void setSpecular(const QColor &specular)
Sets specular color component.
virtual void addParametersToEffect(Qt3DRender::QEffect *effect) const =0
Adds parameters from the material to a destination effect.
void setTextureScale(float scale)
Sets the texture scale The texture scale changes the size of the displayed texture in the 3D scene If...
virtual void writeXml(QDomElement &element, const QgsReadWriteContext &) const
Writes settings to a DOM element.
QgsMaterialSettingsRenderingTechnique
Material rendering techniques.
A phong shading model with diffuse texture map.
virtual Qt3DRender::QMaterial * toMaterial(QgsMaterialSettingsRenderingTechnique technique, const QgsMaterialContext &context) const =0
Creates a new QMaterial object representing the material settings.
void setShininess(float shininess)
Sets shininess of the surface.
virtual void readXml(const QDomElement &element, const QgsReadWriteContext &)
Reads settings from a DOM element.
bool operator==(const QgsPhongTexturedMaterialSettings &other) const
QColor ambient() const
Returns ambient color component.
void setAmbient(const QColor &ambient)
Sets ambient color component.
virtual QgsAbstractMaterialSettings * clone() const =0
Clones the material settings.
bool requiresTextureCoordinates() const
Returns true if the material requires texture coordinates to be generated during triangulation....
void setDiffuseTexturePath(const QString &path)
Sets the path of the diffuse texture.