26 #include <QDomDocument>
27 #include <QDomElement>
31 mSizeScaleFieldIdx( -1 ), mTempSymbol( NULL )
142 QSet<QString> attributes;
155 return attributes.toList();
180 return QString(
"SINGLE: %1" ).arg(
mSymbol->
dump() );
202 props[
"angle" ] = QString(
mRotationField ).append(
"\"" ).prepend(
"\"" );
204 props[
"scale" ] = QString(
mSizeScaleField ).append(
"\"" ).prepend(
"\"" );
206 QDomElement ruleElem = doc.createElement(
"se:Rule" );
207 element.appendChild( ruleElem );
209 QDomElement nameElem = doc.createElement(
"se:Name" );
210 nameElem.appendChild( doc.createTextNode(
"Single symbol" ) );
211 ruleElem.appendChild( nameElem );
225 QDomElement symbolsElem = element.firstChildElement(
"symbols" );
226 if ( symbolsElem.isNull() )
231 if ( !symbolMap.contains(
"0" ) )
239 QDomElement rotationElem = element.firstChildElement(
"rotation" );
240 if ( !rotationElem.isNull() )
243 QDomElement sizeScaleElem = element.firstChildElement(
"sizescale" );
244 if ( !sizeScaleElem.isNull() )
259 QDomElement ruleElem = element.firstChildElement(
"Rule" );
260 if ( ruleElem.isNull() )
266 QString label, description;
270 QDomElement childElem = ruleElem.firstChildElement();
271 while ( !childElem.isNull() )
273 if ( childElem.localName() ==
"Name" )
277 if ( label.isEmpty() )
278 label = childElem.firstChild().nodeValue();
280 else if ( childElem.localName() ==
"Description" )
283 QDomElement titleElem = childElem.firstChildElement(
"Title" );
284 if ( !titleElem.isNull() )
286 label = titleElem.firstChild().nodeValue();
289 QDomElement abstractElem = childElem.firstChildElement(
"Abstract" );
290 if ( !abstractElem.isNull() )
292 description = abstractElem.firstChild().nodeValue();
295 else if ( childElem.localName() ==
"Abstract" )
298 description = childElem.firstChild().nodeValue();
300 else if ( childElem.localName() ==
"Title" )
303 label = childElem.firstChild().nodeValue();
305 else if ( childElem.localName().endsWith(
"Symbolizer" ) )
311 childElem = childElem.nextSiblingElement();
314 if ( layers.size() == 0 )
334 QgsDebugMsg( QString(
"invalid geometry type: found %1" ).arg( geomType ) );
345 rendererElem.setAttribute(
"type",
"singleSymbol" );
351 rendererElem.appendChild( symbolsElem );
353 QDomElement rotationElem = doc.createElement(
"rotation" );
355 rendererElem.appendChild( rotationElem );
357 QDomElement sizeScaleElem = doc.createElement(
"sizescale" );
360 rendererElem.appendChild( sizeScaleElem );
371 lst << qMakePair( QString(), pix );
379 lst << qMakePair( QString(),
mSymbol );