29 QDomDocument doc = elem.ownerDocument();
31 QDomElement elemDataProperties = doc.createElement( QStringLiteral(
"data" ) );
34 elemDataProperties.setAttribute( QStringLiteral(
"height" ), mHeight );
35 elemDataProperties.setAttribute( QStringLiteral(
"extrusion-height" ), mExtrusionHeight );
36 elemDataProperties.setAttribute( QStringLiteral(
"simple-lines" ), mRenderAsSimpleLines ? QStringLiteral(
"1" ) : QStringLiteral(
"0" ) );
37 elemDataProperties.setAttribute( QStringLiteral(
"width" ), mWidth );
38 elem.appendChild( elemDataProperties );
40 QDomElement elemMaterial = doc.createElement( QStringLiteral(
"material" ) );
42 elem.appendChild( elemMaterial );
49 QDomElement elemDataProperties = elem.firstChildElement( QStringLiteral(
"data" ) );
52 mHeight = elemDataProperties.attribute( QStringLiteral(
"height" ) ).toFloat();
53 mExtrusionHeight = elemDataProperties.attribute( QStringLiteral(
"extrusion-height" ) ).toFloat();
54 mWidth = elemDataProperties.attribute( QStringLiteral(
"width" ) ).toFloat();
55 mRenderAsSimpleLines = elemDataProperties.attribute( QStringLiteral(
"simple-lines" ), QStringLiteral(
"0" ) ).toInt();
57 QDomElement elemMaterial = elem.firstChildElement( QStringLiteral(
"material" ) );
58 mMaterial.
readXml( elemMaterial );
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.
QgsLine3DSymbol()=default
Constructor for QgsLine3DSymbol.
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.
QgsAbstract3DSymbol * clone() const override
Returns a new instance of the symbol with the same settings.
void writeXml(QDomElement &elem, const QgsReadWriteContext &context) const override
Writes symbol configuration to the given DOM element.
void writeXml(QDomElement &elem) const
Writes settings to a DOM element.
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 Qgs3DTypes::AltitudeBinding altBindingFromString(const QString &str)
Converts a string to a value from AltitudeBinding enum.
static QString altBindingToString(Qgs3DTypes::AltitudeBinding altBind)
Converts a value from AltitudeBinding enum to a string.