QGIS API Documentation
3.16.0-Hannover (43b64b13f3)
|
Go to the documentation of this file.
19 #include <Qt3DRender/QTexture>
20 #include <Qt3DRender/QParameter>
21 #include <Qt3DRender/QEffect>
27 return QStringLiteral(
"simpleline" );
34 case QgsMaterialSettingsRenderingTechnique::Lines:
37 case QgsMaterialSettingsRenderingTechnique::Triangles:
38 case QgsMaterialSettingsRenderingTechnique::InstancedPoints:
70 case QgsMaterialSettingsRenderingTechnique::Triangles:
71 case QgsMaterialSettingsRenderingTechnique::InstancedPoints:
76 case QgsMaterialSettingsRenderingTechnique::Lines:
78 QgsLineMaterial *mat =
new QgsLineMaterial;
79 mat->setLineColor( mAmbient );
93 QMap<QString, QString> parameters;
94 parameters[ QStringLiteral(
"Ka" ) ] = QStringLiteral(
"%1 %2 %3" ).arg( mAmbient.redF() ).arg( mAmbient.greenF() ).arg( mAmbient.blueF() );
100 Qt3DRender::QParameter *ambientParameter =
new Qt3DRender::QParameter( QStringLiteral(
"ka" ), QColor::fromRgbF( 0.05f, 0.05f, 0.05f, 1.0f ) );
101 ambientParameter->setValue( mAmbient );
102 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.
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.
3 Context settings for a material.
3 Abstract base class for material settings.
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)
QMap< QString, QString > toExportParameters() const override
Returns the parameters to be exported to .mtl file.
QgsMaterialSettingsRenderingTechnique
Material rendering techniques 3.
3 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.
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.