[QGIS Commit] r8449 - in trunk/qgis/src/core: renderer symbology

svn_qgis at osgeo.org svn_qgis at osgeo.org
Sat May 17 08:24:16 EDT 2008


Author: mhugent
Date: 2008-05-17 08:24:15 -0400 (Sat, 17 May 2008)
New Revision: 8449

Modified:
   trunk/qgis/src/core/renderer/qgscontinuouscolorrenderer.cpp
   trunk/qgis/src/core/renderer/qgsgraduatedsymbolrenderer.cpp
   trunk/qgis/src/core/renderer/qgssinglesymbolrenderer.cpp
   trunk/qgis/src/core/renderer/qgsuniquevaluerenderer.cpp
   trunk/qgis/src/core/symbology/qgssymbol.cpp
   trunk/qgis/src/core/symbology/qgssymbol.h
Log:
Differentiate between field scale and raster scale factor such that field scaled point symbols all have the same outline width

Modified: trunk/qgis/src/core/renderer/qgscontinuouscolorrenderer.cpp
===================================================================
--- trunk/qgis/src/core/renderer/qgscontinuouscolorrenderer.cpp	2008-05-17 11:45:55 UTC (rev 8448)
+++ trunk/qgis/src/core/renderer/qgscontinuouscolorrenderer.cpp	2008-05-17 12:24:15 UTC (rev 8449)
@@ -140,8 +140,8 @@
       }
       brush.setStyle ( Qt::SolidPattern );
 
-      *img = QgsMarkerCatalogue::instance()->imageMarker ( mMinimumSymbol->pointSymbolName(), mMinimumSymbol->pointSize() *widthScale * rasterScaleFactor,
-          pen, brush);
+      *img = QgsMarkerCatalogue::instance()->imageMarker ( mMinimumSymbol->pointSymbolName(), \
+							   mMinimumSymbol->pointSize() * widthScale * rasterScaleFactor, pen, brush);
     } 
     else if ( mVectorType == QGis::Line )
     {

Modified: trunk/qgis/src/core/renderer/qgsgraduatedsymbolrenderer.cpp
===================================================================
--- trunk/qgis/src/core/renderer/qgsgraduatedsymbolrenderer.cpp	2008-05-17 11:45:55 UTC (rev 8448)
+++ trunk/qgis/src/core/renderer/qgsgraduatedsymbolrenderer.cpp	2008-05-17 12:24:15 UTC (rev 8449)
@@ -130,8 +130,7 @@
       rotation = attrs[theSymbol->rotationClassificationField()].toDouble();
       QgsDebugMsg(QString("Feature has rotation factor %1").arg(rotation));
     }
-    *img = theSymbol->getPointSymbolAsImage( widthScale, selected, mSelectionColor,
-                                            rasterScaleFactor * fieldScale, rotation);
+    *img = theSymbol->getPointSymbolAsImage( widthScale, selected, mSelectionColor, fieldScale, rotation, rasterScaleFactor);
   } 
 
   // Line, polygon

Modified: trunk/qgis/src/core/renderer/qgssinglesymbolrenderer.cpp
===================================================================
--- trunk/qgis/src/core/renderer/qgssinglesymbolrenderer.cpp	2008-05-17 11:45:55 UTC (rev 8448)
+++ trunk/qgis/src/core/renderer/qgssinglesymbolrenderer.cpp	2008-05-17 12:24:15 UTC (rev 8449)
@@ -112,8 +112,7 @@
       QgsDebugMsg(QString("Feature has rotation factor %1").arg(rotation));
     }
 
-    *img = mSymbol->getPointSymbolAsImage( widthScale, selected, mSelectionColor,
-                                            rasterScaleFactor * fieldScale, rotation);
+    *img = mSymbol->getPointSymbolAsImage( widthScale, selected, mSelectionColor, fieldScale, rotation, rasterScaleFactor);
   }
 
 

Modified: trunk/qgis/src/core/renderer/qgsuniquevaluerenderer.cpp
===================================================================
--- trunk/qgis/src/core/renderer/qgsuniquevaluerenderer.cpp	2008-05-17 11:45:55 UTC (rev 8448)
+++ trunk/qgis/src/core/renderer/qgsuniquevaluerenderer.cpp	2008-05-17 12:24:15 UTC (rev 8449)
@@ -140,7 +140,7 @@
       QgsDebugMsg(QString("Feature has rotation factor %1").arg(rotation));
     }
     *img = symbol->getPointSymbolAsImage( widthScale, selected, mSelectionColor,
-                                            rasterScaleFactor * fieldScale, rotation);
+					  fieldScale, rotation, rasterScaleFactor);
 }  
   // Line, polygon
   else if ( mVectorType != QGis::Point )

Modified: trunk/qgis/src/core/symbology/qgssymbol.cpp
===================================================================
--- trunk/qgis/src/core/symbology/qgssymbol.cpp	2008-05-17 11:45:55 UTC (rev 8448)
+++ trunk/qgis/src/core/symbology/qgssymbol.cpp	2008-05-17 12:24:15 UTC (rev 8449)
@@ -324,11 +324,11 @@
   }
 }
 
-QImage QgsSymbol::getPointSymbolAsImage(  double widthScale,
-               bool selected, QColor selectionColor, double scale, double rotation )
+QImage QgsSymbol::getPointSymbolAsImage(  double widthScale, bool selected, QColor selectionColor, double scale, \
+					  double rotation, double rasterScaleFactor)
 {
   //QgsDebugMsg(QString("Symbol scale = %1, and rotation = %2").arg(scale).arg(rotation));
-  if ( 1.0 == scale && 0 == rotation )
+  if ( 1.0 == (scale * rasterScaleFactor) && 0 == rotation )
   {
     // If scale is 1.0 and rotation 0.0, use cached image.
     return getCachedPointSymbolAsImage( widthScale, selected, selectionColor );
@@ -336,19 +336,19 @@
 
   QImage preRotateImage;
   QPen pen = mPen;
-  double newWidth = mPen.widthF() * widthScale * scale;
+  double newWidth = mPen.widthF() * widthScale * rasterScaleFactor;
   pen.setWidth(newWidth);
 
   if ( selected )
   {
     pen.setColor ( selectionColor ); 
     QBrush brush = mBrush;
-    preRotateImage = QgsMarkerCatalogue::instance()->imageMarker ( mPointSymbolName, (int)(mPointSize * scale * widthScale),
+    preRotateImage = QgsMarkerCatalogue::instance()->imageMarker ( mPointSymbolName, (int)(mPointSize * scale * widthScale * rasterScaleFactor),
                                                                    pen, mBrush );
   }
   else 
   {
-    preRotateImage = QgsMarkerCatalogue::instance()->imageMarker ( mPointSymbolName, (int)(mPointSize * scale * widthScale),
+    preRotateImage = QgsMarkerCatalogue::instance()->imageMarker ( mPointSymbolName, (int)(mPointSize * scale * widthScale * rasterScaleFactor),
                                                                    pen, mBrush );
   }
 

Modified: trunk/qgis/src/core/symbology/qgssymbol.h
===================================================================
--- trunk/qgis/src/core/symbology/qgssymbol.h	2008-05-17 11:45:55 UTC (rev 8448)
+++ trunk/qgis/src/core/symbology/qgssymbol.h	2008-05-17 12:24:15 UTC (rev 8449)
@@ -105,9 +105,10 @@
      */
     virtual QImage getPointSymbolAsImage( double widthScale = 1., 
         bool selected = false,
-        QColor selectionColor = Qt::yellow,
+        QColor selectionColor = Qt::yellow,				  
         double scale = 1.0,
-        double rotation = 0.0);
+	double rotation = 0.0,
+	double rasterScaleFactor = 1.0);
 
     /**Writes the contents of the symbol to a configuration file
       @ return true in case of success*/



More information about the QGIS-commit mailing list