QGIS API Documentation
3.26.3-Buenos Aires (65e4edfdad)
|
Go to the documentation of this file.
19 #include <Qt3DRender/QTexture>
20 #include <Qt3DRender/QParameter>
21 #include <Qt3DRender/QEffect>
27 return QStringLiteral(
"simpleline" );
82 QgsLineMaterial *mat =
new QgsLineMaterial;
83 mat->setLineColor( mAmbient );
97 QMap<QString, QString> parameters;
98 parameters[ QStringLiteral(
"Ka" ) ] = QStringLiteral(
"%1 %2 %3" ).arg( mAmbient.redF() ).arg( mAmbient.greenF() ).arg( mAmbient.blueF() );
104 Qt3DRender::QParameter *ambientParameter =
new Qt3DRender::QParameter( QStringLiteral(
"ka" ), QColor::fromRgbF( 0.05f, 0.05f, 0.05f, 1.0f ) );
105 ambientParameter->setValue( mAmbient );
106 effect->addParameter( ambientParameter );
static QString encodeColor(const QColor &color)
The class is used as a container of context for various read/write operations on other objects.
static QgsAbstractMaterialSettings * create()
Returns a new instance of QgsSimpleLineMaterialSettings.
@ InstancedPoints
Instanced based rendering, requiring triangles and point data.
static QColor decodeColor(const QString &str)
QgsSimpleLineMaterialSettings()=default
Constructor for QgsSimpleLineMaterialSettings.
static bool supportsTechnique(QgsMaterialSettingsRenderingTechnique technique)
Returns true if the specified technique is supported by the material.
QColor selectionColor() const
Returns the color for representing materials in a selected state.
Context settings for a material.
Abstract base class for material settings.
@ Lines
Line based rendering, requires line data.
QgsSimpleLineMaterialSettings * clone() const override
Clones the material settings.
void readXml(const QDomElement &elem, const QgsReadWriteContext &context) override
Reads settings from a DOM element.
@ Triangles
Triangle based rendering (default)
@ TrianglesWithFixedTexture
Triangle based rendering, using a fixed, non-user-configurable texture (e.g. for terrain rendering)
QMap< QString, QString > toExportParameters() const override
Returns the parameters to be exported to .mtl file.
QgsMaterialSettingsRenderingTechnique
Material rendering techniques.
Basic shading material used for rendering simple lines as solid line components.
void addParametersToEffect(Qt3DRender::QEffect *effect) const override
Adds parameters from the material to a destination effect.
@ TrianglesDataDefined
Triangle based rendering with possibility of datadefined color.
@ TrianglesFromModel
Triangle based rendering, using a model object source.
void writeXml(QDomElement &elem, const QgsReadWriteContext &context) const override
Writes settings to a DOM element.
@ Points
Point based rendering, requires point data.
QString type() const override
Returns the unique type name for the material.
Qt3DRender::QMaterial * toMaterial(QgsMaterialSettingsRenderingTechnique technique, const QgsMaterialContext &context) const override
Creates a new QMaterial object representing the material settings.
bool isSelected() const
Returns true if the material should represent a selected state.