28 #include <QDomElement>
79 QPainter *p = renderContext.
painter();
96 QColor mincolor, maxcolor;
110 int red, green, blue;
112 if (( maxvalue - minvalue ) != 0 )
114 red = int ( maxcolor.red() * ( fvalue - minvalue ) / ( maxvalue - minvalue ) + mincolor.red() * ( maxvalue - fvalue ) / ( maxvalue - minvalue ) );
115 green = int ( maxcolor.green() * ( fvalue - minvalue ) / ( maxvalue - minvalue ) + mincolor.green() * ( maxvalue - fvalue ) / ( maxvalue - minvalue ) );
116 blue = int ( maxcolor.blue() * ( fvalue - minvalue ) / ( maxvalue - minvalue ) + mincolor.blue() * ( maxvalue - fvalue ) / ( maxvalue - minvalue ) );
120 red = int ( mincolor.red() );
121 green = int ( mincolor.green() );
122 blue = int ( mincolor.blue() );
134 pen.setColor( QColor( red, green, blue ) );
135 pen.setWidthF( renderContext.
scaleFactor() * pen.widthF() );
146 brush.setColor( QColor( red, green, blue ) );
148 brush.setStyle( Qt::SolidPattern );
152 pen, brush, opacity );
158 linePen.setColor( QColor( red, green, blue ) );
160 p->setPen( linePen );
164 p->setBrush( QColor( red, green, blue ) );
168 pen.setColor( QColor( 0, 0, 0 ) );
174 p->setPen( Qt::NoPen );
189 p->setBrush( brush );
197 QDomNode classnode = rnode.namedItem(
"classificationfield" );
205 int classificationId = theProvider->
fieldNameIndex( classificationField );
206 if ( classificationId == -1 )
213 QDomNode polyoutlinenode = rnode.namedItem(
"polygonoutline" );
214 QString polyoutline = polyoutlinenode.toElement().text();
215 if ( polyoutline ==
"0" )
219 else if ( polyoutline ==
"1" )
225 QDomNode lowernode = rnode.namedItem(
"lowestsymbol" );
226 QDomNode lsymbolnode = lowernode.namedItem(
"symbol" );
227 if ( ! lsymbolnode.isNull() )
230 lsy->
readXML( lsymbolnode, &vl );
233 QDomNode uppernode = rnode.namedItem(
"highestsymbol" );
234 QDomNode usymbolnode = uppernode.namedItem(
"symbol" );
235 if ( ! usymbolnode.isNull() )
238 usy->
readXML( usymbolnode, &vl );
254 return "Continuous Color";
265 QString classificationFieldName;
267 if ( field_it != theProvider->
fields().constEnd() )
269 classificationFieldName = field_it.value().name();
271 bool returnval =
true;
273 QDomElement continuoussymbol = document.createElement(
"continuoussymbol" );
274 layer_node.appendChild( continuoussymbol );
275 QDomElement classificationfield = document.createElement(
"classificationfield" );
276 QDomText classificationfieldtxt = document.createTextNode( classificationFieldName );
277 classificationfield.appendChild( classificationfieldtxt );
278 continuoussymbol.appendChild( classificationfield );
281 QDomElement drawPolygonOutlines = document.createElement(
"polygonoutline" );
283 QDomText drawPolygonText = document.createTextNode( QString::number( drawPolyInt ) );
284 drawPolygonOutlines.appendChild( drawPolygonText );
285 continuoussymbol.appendChild( drawPolygonOutlines );
287 QDomElement lowestsymbol = document.createElement(
"lowestsymbol" );
288 continuoussymbol.appendChild( lowestsymbol );
293 QDomElement highestsymbol = document.createElement(
"highestsymbol" );
294 continuoussymbol.appendChild( highestsymbol );
305 QList<QgsSymbol*> list;