16#ifndef QGSPHONGTEXTUREDMATERIALSETTINGS_H
17#define QGSPHONGTEXTUREDMATERIALSETTINGS_H
41 QString
type()
const override;
56 QColor ambient()
const {
return mAmbient; }
87 float textureRotation()
const;
93 double opacity()
const {
return mOpacity; }
96 void setAmbient(
const QColor &ambient ) { mAmbient = ambient; }
99 void setSpecular(
const QColor &specular ) { mSpecular = specular; }
135 return mAmbient == other.mAmbient &&
136 mSpecular == other.mSpecular &&
137 mShininess == other.mShininess &&
138 mOpacity == other.mOpacity &&
139 mDiffuseTexturePath == other.mDiffuseTexturePath &&
140 mTextureScale == other.mTextureScale &&
141 mTextureRotation == other.mTextureRotation;
145 QColor mAmbient{ QColor::fromRgbF( 0.1f, 0.1f, 0.1f, 1.0f ) };
146 QColor mSpecular{ QColor::fromRgbF( 1.0f, 1.0f, 1.0f, 1.0f ) };
147 double mShininess = 0.0;
148 double mOpacity = 1.0;
149 QString mDiffuseTexturePath;
150 float mTextureScale{ 1.0f };
151 float mTextureRotation{ 0.0f };
virtual void writeXml(QDomElement &element, const QgsReadWriteContext &) const
Writes settings to a DOM element.
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 Qt3DRender::QMaterial * toMaterial(QgsMaterialSettingsRenderingTechnique technique, const QgsMaterialContext &context) const =0
Creates a new QMaterial object representing the material settings.
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.
void setShininess(double shininess)
Sets shininess of the surface.
QgsPhongTexturedMaterialSettings()=default
bool requiresTextureCoordinates() const
Returns true if the material requires texture coordinates to be generated during triangulation....
void setTextureScale(float scale)
Sets the texture scale The texture scale changes the size of the displayed texture in the 3D scene If...
void setSpecular(const QColor &specular)
Sets specular color component.
float textureScale() const
Returns the texture scale The texture scale changes the size of the displayed texture in the 3D scene...
void setDiffuseTexturePath(const QString &path)
Sets the path of the diffuse texture.
QString diffuseTexturePath() const
Returns the diffuse texture path.
QColor specular() const
Returns specular color component.
void setAmbient(const QColor &ambient)
Sets ambient color component.
void setOpacity(float opacity)
Sets opacity of the surface.
double shininess() const
Returns shininess of the surface.
double opacity() const
Returns the opacity of the surface.
void setTextureRotation(float rotation)
Sets the texture rotation in degrees.
bool operator==(const QgsPhongTexturedMaterialSettings &other) const
The class is used as a container of context for various read/write operations on other objects.
QgsMaterialSettingsRenderingTechnique
Material rendering techniques 3.