29 QDomDocument doc = elem.ownerDocument();
31 QDomElement elemDataProperties = doc.createElement( QStringLiteral(
"data" ) );
33 elemDataProperties.setAttribute( QStringLiteral(
"height" ), mHeight );
34 elemDataProperties.setAttribute( QStringLiteral(
"add-back-faces" ), mAddBackFaces ? QStringLiteral(
"1" ) : QStringLiteral(
"0" ) );
35 elem.appendChild( elemDataProperties );
37 QDomElement elemMaterial = doc.createElement( QStringLiteral(
"material" ) );
39 elem.appendChild( elemMaterial );
41 QDomElement elemDDP = doc.createElement( QStringLiteral(
"data-defined-properties" ) );
43 elem.appendChild( elemDDP );
50 QDomElement elemDataProperties = elem.firstChildElement( QStringLiteral(
"data" ) );
52 mHeight = elemDataProperties.attribute( QStringLiteral(
"height" ) ).toFloat();
53 mAddBackFaces = elemDataProperties.attribute( QStringLiteral(
"add-back-faces" ) ).toInt();
55 QDomElement elemMaterial = elem.firstChildElement( QStringLiteral(
"material" ) );
56 mMaterial.
readXml( elemMaterial );
58 QDomElement elemDDP = elem.firstChildElement( QStringLiteral(
"data-defined-properties" ) );
59 if ( !elemDDP.isNull() )
The class is used as a container of context for various read/write operations on other objects...
static QString altClampingToString(Qgs3DTypes::AltitudeClamping altClamp)
Converts a value from AltitudeClamping enum to a string.
QgsPropertyCollection mDataDefinedProperties
virtual bool readXml(const QDomElement &collectionElem, const QgsPropertiesDefinition &definitions)
Reads property collection state from an XML element.
QgsMesh3DSymbol()=default
Constructor for QgsMesh3DSymbol.
static Qgs3DTypes::AltitudeClamping altClampingFromString(const QString &str)
Converts a string to a value from AltitudeClamping enum.
3 Abstract base class for 3D symbols that are used by VectorLayer3DRenderer objects.
void readXml(const QDomElement &elem)
Reads settings from a DOM element.
static const QgsPropertiesDefinition & propertyDefinitions()
Returns the symbol layer property definitions.
QgsAbstract3DSymbol * clone() const override
Returns a new instance of the symbol with the same settings.
void writeXml(QDomElement &elem) const
Writes settings to a DOM element.
void writeXml(QDomElement &elem, const QgsReadWriteContext &context) const override
Writes symbol configuration to the given DOM element.
virtual bool writeXml(QDomElement &collectionElem, const QgsPropertiesDefinition &definitions) const
Writes the current state of the property collection into an XML element.
void readXml(const QDomElement &elem, const QgsReadWriteContext &context) override
Reads symbol configuration from the given DOM element.