27 #include <QDomDocument>
28 #include <QDomElement>
46 const double rotation =
mRotation.data() ?
mRotation->evaluate( feature ).toDouble() : 0;
74 mSymbol->startRender( context, vlayer );
109 mSymbol->stopRender( context );
121 QSet<QString> attributes;
122 if (
mSymbol.data() ) attributes.unite(
mSymbol->usedAttributes() );
125 return attributes.toList();
167 return mSymbol.data() ? QString(
"SINGLE: %1" ).arg(
mSymbol->dump() ) :
"" ;
185 props[
"angle" ] =
mRotation->expression();
189 QDomElement ruleElem = doc.createElement(
"se:Rule" );
190 element.appendChild( ruleElem );
192 QDomElement nameElem = doc.createElement(
"se:Name" );
193 nameElem.appendChild( doc.createTextNode(
"Single symbol" ) );
194 ruleElem.appendChild( nameElem );
208 QDomElement symbolsElem = element.firstChildElement(
"symbols" );
209 if ( symbolsElem.isNull() )
214 if ( !symbolMap.contains(
"0" ) )
222 QDomElement rotationElem = element.firstChildElement(
"rotation" );
223 if ( !rotationElem.isNull() )
226 QDomElement sizeScaleElem = element.firstChildElement(
"sizescale" );
227 if ( !sizeScaleElem.isNull() )
242 QDomElement ruleElem = element.firstChildElement(
"Rule" );
243 if ( ruleElem.isNull() )
249 QString label, description;
253 QDomElement childElem = ruleElem.firstChildElement();
254 while ( !childElem.isNull() )
256 if ( childElem.localName() ==
"Name" )
260 if ( label.isEmpty() )
261 label = childElem.firstChild().nodeValue();
263 else if ( childElem.localName() ==
"Description" )
266 QDomElement titleElem = childElem.firstChildElement(
"Title" );
267 if ( !titleElem.isNull() )
269 label = titleElem.firstChild().nodeValue();
272 QDomElement abstractElem = childElem.firstChildElement(
"Abstract" );
273 if ( !abstractElem.isNull() )
275 description = abstractElem.firstChild().nodeValue();
278 else if ( childElem.localName() ==
"Abstract" )
281 description = childElem.firstChild().nodeValue();
283 else if ( childElem.localName() ==
"Title" )
286 label = childElem.firstChild().nodeValue();
288 else if ( childElem.localName().endsWith(
"Symbolizer" ) )
294 childElem = childElem.nextSiblingElement();
297 if ( layers.size() == 0 )
317 QgsDebugMsg( QString(
"invalid geometry type: found %1" ).arg( geomType ) );
328 rendererElem.setAttribute(
"type",
"singleSymbol" );
334 rendererElem.appendChild( symbolsElem );
336 QDomElement rotationElem = doc.createElement(
"rotation" );
339 rendererElem.appendChild( rotationElem );
341 QDomElement sizeScaleElem = doc.createElement(
"sizescale" );
345 rendererElem.appendChild( sizeScaleElem );
356 lst << qMakePair( QString(), pix );
363 Q_UNUSED( scaleDenominator );
366 lst << qMakePair( QString(),
mSymbol.data() );