29 #include <QDomDocument>
30 #include <QDomElement>
49 const double rotation =
mRotation.data() ?
mRotation->evaluate( feature ).toDouble() : 0;
83 mSymbol->startRender( context, &fields );
118 mSymbol->stopRender( context );
130 QSet<QString> attributes;
131 if (
mSymbol.data() ) attributes.unite(
mSymbol->usedAttributes() );
134 return attributes.toList();
176 return mSymbol.data() ? QString(
"SINGLE: %1" ).arg(
mSymbol->dump() ) :
"";
194 props[
"angle" ] =
mRotation->expression();
198 QDomElement ruleElem = doc.createElement(
"se:Rule" );
199 element.appendChild( ruleElem );
201 QDomElement nameElem = doc.createElement(
"se:Name" );
202 nameElem.appendChild( doc.createTextNode(
"Single symbol" ) );
203 ruleElem.appendChild( nameElem );
217 QDomElement symbolsElem = element.firstChildElement(
"symbols" );
218 if ( symbolsElem.isNull() )
223 if ( !symbolMap.contains(
"0" ) )
231 QDomElement rotationElem = element.firstChildElement(
"rotation" );
232 if ( !rotationElem.isNull() )
235 QDomElement sizeScaleElem = element.firstChildElement(
"sizescale" );
236 if ( !sizeScaleElem.isNull() )
251 QDomElement ruleElem = element.firstChildElement(
"Rule" );
252 if ( ruleElem.isNull() )
258 QString label, description;
262 QDomElement childElem = ruleElem.firstChildElement();
263 while ( !childElem.isNull() )
265 if ( childElem.localName() ==
"Name" )
269 if ( label.isEmpty() )
270 label = childElem.firstChild().nodeValue();
272 else if ( childElem.localName() ==
"Description" )
275 QDomElement titleElem = childElem.firstChildElement(
"Title" );
276 if ( !titleElem.isNull() )
278 label = titleElem.firstChild().nodeValue();
281 QDomElement abstractElem = childElem.firstChildElement(
"Abstract" );
282 if ( !abstractElem.isNull() )
284 description = abstractElem.firstChild().nodeValue();
287 else if ( childElem.localName() ==
"Abstract" )
290 description = childElem.firstChild().nodeValue();
292 else if ( childElem.localName() ==
"Title" )
295 label = childElem.firstChild().nodeValue();
297 else if ( childElem.localName().endsWith(
"Symbolizer" ) )
303 childElem = childElem.nextSiblingElement();
306 if ( layers.size() == 0 )
326 QgsDebugMsg( QString(
"invalid geometry type: found %1" ).arg( geomType ) );
337 rendererElem.setAttribute(
"type",
"singleSymbol" );
343 rendererElem.appendChild( symbolsElem );
345 QDomElement rotationElem = doc.createElement(
"rotation" );
348 rendererElem.appendChild( rotationElem );
350 QDomElement sizeScaleElem = doc.createElement(
"sizescale" );
354 rendererElem.appendChild( sizeScaleElem );
365 lst << qMakePair( QString(), pix );
372 Q_UNUSED( scaleDenominator );
375 lst << qMakePair( QString(),
mSymbol.data() );
388 if ( renderer->
type() ==
"singleSymbol" )
392 if ( renderer->
type() ==
"pointDisplacement" )
395 if ( pointDisplacementRenderer )
398 if ( renderer->
type() ==
"invertedPolygonRenderer" )
401 if ( invertedPolygonRenderer )
406 if ( symbols.size() > 0 )