27 QDomDocument doc = elem.ownerDocument();
29 QDomElement elemDataProperties = doc.createElement( QStringLiteral(
"data" ) );
32 elemDataProperties.setAttribute( QStringLiteral(
"height" ), mHeight );
33 elemDataProperties.setAttribute( QStringLiteral(
"extrusion-height" ), mExtrusionHeight );
35 elemDataProperties.setAttribute( QStringLiteral(
"invert-normals" ), mInvertNormals ?
"1" :
"0" );
36 elemDataProperties.setAttribute( QStringLiteral(
"add-back-faces" ), mAddBackFaces ?
"1" :
"0" );
37 elem.appendChild( elemDataProperties );
39 QDomElement elemMaterial = doc.createElement( QStringLiteral(
"material" ) );
41 elem.appendChild( elemMaterial );
43 QDomElement elemDDP = doc.createElement( QStringLiteral(
"data-defined-properties" ) );
45 elem.appendChild( elemDDP );
52 QDomElement elemDataProperties = elem.firstChildElement( QStringLiteral(
"data" ) );
55 mHeight = elemDataProperties.attribute( QStringLiteral(
"height" ) ).toFloat();
56 mExtrusionHeight = elemDataProperties.attribute( QStringLiteral(
"extrusion-height" ) ).toFloat();
58 mInvertNormals = elemDataProperties.attribute( QStringLiteral(
"invert-normals" ) ).toInt();
59 mAddBackFaces = elemDataProperties.attribute( QStringLiteral(
"add-back-faces" ) ).toInt();
61 QDomElement elemMaterial = elem.firstChildElement( QStringLiteral(
"material" ) );
62 mMaterial.
readXml( elemMaterial );
64 QDomElement elemDDP = elem.firstChildElement( QStringLiteral(
"data-defined-properties" ) );
65 if ( !elemDDP.isNull() )
static QString cullingModeToString(Qt3DRender::QCullFace::CullingMode mode)
Converts a value from CullingMode enum to a string.
The class is used as a container of context for various read/write operations on other objects...
static AltitudeBinding altBindingFromString(const QString &str)
Converts a string to a value from AltitudeBinding enum.
void writeXml(QDomElement &elem, const QgsReadWriteContext &context) const override
Writes symbol configuration to the given DOM element.
QgsPropertyCollection mDataDefinedProperties
virtual bool readXml(const QDomElement &collectionElem, const QgsPropertiesDefinition &definitions)
Reads property collection state from an XML element.
QgsPolygon3DSymbol()=default
Constructor for QgsPolygon3DSymbol.
static Qt3DRender::QCullFace::CullingMode cullingModeFromString(const QString &str)
Converts a string to a value from CullingMode 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.
void readXml(const QDomElement &elem, const QgsReadWriteContext &context) override
Reads symbol configuration from the given DOM element.
static const QgsPropertiesDefinition & propertyDefinitions()
Returns the symbol layer property definitions.
static QString altBindingToString(AltitudeBinding altBind)
Converts a value from AltitudeBinding enum to a string.
void writeXml(QDomElement &elem) const
Writes settings to a DOM element.
static AltitudeClamping altClampingFromString(const QString &str)
Converts a string to a value from AltitudeClamping enum.
QgsAbstract3DSymbol * clone() const override
Returns a new instance of the symbol with the same settings.
static QString altClampingToString(AltitudeClamping altClamp)
Converts a value from AltitudeClamping enum to a string.
virtual bool writeXml(QDomElement &collectionElem, const QgsPropertiesDefinition &definitions) const
Writes the current state of the property collection into an XML element.