33 std::unique_ptr< QgsLine3DSymbol > result = qgis::make_unique< QgsLine3DSymbol >();
34 result->mAltClamping = mAltClamping;
35 result->mAltBinding = mAltBinding;
36 result->mWidth = mWidth;
37 result->mHeight = mHeight;
38 result->mExtrusionHeight = mExtrusionHeight;
39 result->mRenderAsSimpleLines = mRenderAsSimpleLines;
40 result->mMaterial.reset( mMaterial->clone() );
41 copyBaseSettings( result.get() );
42 return result.release();
49 QDomDocument doc = elem.ownerDocument();
51 QDomElement elemDataProperties = doc.createElement( QStringLiteral(
"data" ) );
54 elemDataProperties.setAttribute( QStringLiteral(
"height" ), mHeight );
55 elemDataProperties.setAttribute( QStringLiteral(
"extrusion-height" ), mExtrusionHeight );
56 elemDataProperties.setAttribute( QStringLiteral(
"simple-lines" ), mRenderAsSimpleLines ? QStringLiteral(
"1" ) : QStringLiteral(
"0" ) );
57 elemDataProperties.setAttribute( QStringLiteral(
"width" ), mWidth );
58 elem.appendChild( elemDataProperties );
60 elem.setAttribute( QStringLiteral(
"material_type" ), mMaterial->type() );
61 QDomElement elemMaterial = doc.createElement( QStringLiteral(
"material" ) );
62 mMaterial->writeXml( elemMaterial, context );
63 elem.appendChild( elemMaterial );
70 QDomElement elemDataProperties = elem.firstChildElement( QStringLiteral(
"data" ) );
73 mHeight = elemDataProperties.attribute( QStringLiteral(
"height" ) ).toFloat();
74 mExtrusionHeight = elemDataProperties.attribute( QStringLiteral(
"extrusion-height" ) ).toFloat();
75 mWidth = elemDataProperties.attribute( QStringLiteral(
"width" ) ).toFloat();
76 mRenderAsSimpleLines = elemDataProperties.attribute( QStringLiteral(
"simple-lines" ), QStringLiteral(
"0" ) ).toInt();
78 const QDomElement elemMaterial = elem.firstChildElement( QStringLiteral(
"material" ) );
79 const QString materialType = elem.attribute( QStringLiteral(
"material_type" ), QStringLiteral(
"phong" ) );
83 mMaterial->readXml( elemMaterial, context );
88 return mMaterial.get();
113 QVector<Qgs3DExportObject *> objs = exporter->processLines( entity, objectNamePrefix );
114 exporter->mObjects << objs;
115 return objs.size() != 0;
119 QList<Qt3DRender::QGeometryRenderer *> renderers = entity->findChildren<Qt3DRender::QGeometryRenderer *>();
120 for ( Qt3DRender::QGeometryRenderer *r : renderers )
122 Qgs3DExportObject *
object = exporter->processGeometryRenderer( r, objectNamePrefix );
123 if (
object ==
nullptr )
continue;
125 exporter->mObjects.push_back(
object );
127 return renderers.size() != 0;