46 const QDomElement providerElement = element.firstChildElement( QStringLiteral(
"terrainProvider" ) );
47 if ( !providerElement.isNull() )
49 const QString type = providerElement.attribute( QStringLiteral(
"type" ) );
50 if ( type.compare( QLatin1String(
"flat" ) ) == 0 )
51 mTerrainProvider = std::make_unique< QgsFlatTerrainProvider >();
52 else if ( type.compare( QLatin1String(
"raster" ) ) == 0 )
53 mTerrainProvider = std::make_unique< QgsRasterDemTerrainProvider >();
54 else if ( type.compare( QLatin1String(
"mesh" ) ) == 0 )
55 mTerrainProvider = std::make_unique< QgsMeshTerrainProvider >();
57 mTerrainProvider = std::make_unique< QgsFlatTerrainProvider >();
59 mTerrainProvider->readXml( providerElement, context );
63 mTerrainProvider = std::make_unique< QgsFlatTerrainProvider >();
72 QDomElement element = document.createElement( QStringLiteral(
"ElevationProperties" ) );
74 if ( mTerrainProvider )
76 QDomElement providerElement = document.createElement( QStringLiteral(
"terrainProvider" ) );
77 providerElement.setAttribute( QStringLiteral(
"type" ), mTerrainProvider->type() );
78 providerElement.appendChild( mTerrainProvider->writeXml( document, context ) );
79 element.appendChild( providerElement );
The class is used as a container of context for various read/write operations on other objects.