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 )
57 Q_UNUSED( vertexCount )
58 Q_UNUSED( dataDefinedBytes )
61 void QgsAbstractMaterialSettings::initPropertyDefinitions()
const
63 if ( !sPropertyDefinitions.isEmpty() )
66 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.
const QgsPropertiesDefinition & propertyDefinitions() const
Returns a reference to the material properties definition, used for data defined overrides.
virtual void applyDataDefinedToGeometry(Qt3DRender::QGeometry *geometry, int vertexCount, const QByteArray &dataDefinedBytes) const
Applies the data defined bytes, dataDefinedBytes, on the geometry by filling a specific vertex buffer...
@ 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.