22 const QDomElement elemDataDefinedProperties = element.firstChildElement( QStringLiteral(
"data-defined-properties" ) );
23 if ( !elemDataDefinedProperties.isNull() )
29 QDomElement elemDataDefinedProperties = element.ownerDocument().createElement( QStringLiteral(
"data-defined-properties" ) );
31 element.appendChild( elemDataDefinedProperties );
36 mDataDefinedProperties = collection;
43 if ( sPropertyDefinitions.isEmpty() )
44 initPropertyDefinitions();
45 return sPropertyDefinitions;
50 Q_UNUSED( expressionContext )
54#if QT_VERSION < QT_VERSION_CHECK(6, 0, 0)
61 Q_UNUSED( vertexCount )
62 Q_UNUSED( dataDefinedBytes )
65void QgsAbstractMaterialSettings::initPropertyDefinitions()
const
67 if ( !sPropertyDefinitions.isEmpty() )
70 const QString origin = QStringLiteral(
"material3d" );
virtual void writeXml(QDomElement &element, const QgsReadWriteContext &) const
Writes settings to a DOM element.
virtual QByteArray dataDefinedVertexColorsAsByte(const QgsExpressionContext &expressionContext) const
Returns byte array corresponding to the data defined colors depending of the expressionContext,...
virtual void readXml(const QDomElement &element, const QgsReadWriteContext &)
Reads settings from a DOM element.
void setDataDefinedProperties(const QgsPropertyCollection &collection)
Sets the material property collection, used for data defined overrides.
virtual void applyDataDefinedToGeometry(Qt3DCore::QGeometry *geometry, int vertexCount, const QByteArray &dataDefinedBytes) const
Applies the data defined bytes, dataDefinedBytes, on the geometry by filling a specific vertex buffer...
const QgsPropertiesDefinition & propertyDefinitions() const
Returns a reference to the material properties definition, used for data defined overrides.
@ Ambient
Ambient color (phong material)
@ Specular
Specular color.
@ Warm
Warm color (gooch material)
@ Cool
Cool color (gooch material)
QgsPropertyCollection dataDefinedProperties() const
Returns the symbol material property collection, used for data defined overrides.
virtual bool readXml(const QDomElement &collectionElem, const QgsPropertiesDefinition &definitions)
Reads property collection state from an XML element.
virtual bool writeXml(QDomElement &collectionElem, const QgsPropertiesDefinition &definitions) const
Writes the current state of the property collection into an XML element.
Expression contexts are used to encapsulate the parameters around which a QgsExpression should be eva...
A grouped map of multiple QgsProperty objects, each referenced by a integer key value.
Definition for a property.
@ ColorNoAlpha
Color with no alpha channel.
The class is used as a container of context for various read/write operations on other objects.
QMap< int, QgsPropertyDefinition > QgsPropertiesDefinition
Definition of available properties.