[QGIS Commit] r13354 - trunk/qgis/src/plugins/point_displacement_renderer

svn_qgis at osgeo.org svn_qgis at osgeo.org
Fri Apr 23 11:35:17 EDT 2010


Author: mhugent
Date: 2010-04-23 11:35:17 -0400 (Fri, 23 Apr 2010)
New Revision: 13354

Modified:
   trunk/qgis/src/plugins/point_displacement_renderer/qgspointdisplacementrenderer.cpp
   trunk/qgis/src/plugins/point_displacement_renderer/qgspointdisplacementrenderer.h
Log:
Fix point displacement renderer to work with the new selection parameter

Modified: trunk/qgis/src/plugins/point_displacement_renderer/qgspointdisplacementrenderer.cpp
===================================================================
--- trunk/qgis/src/plugins/point_displacement_renderer/qgspointdisplacementrenderer.cpp	2010-04-23 15:20:24 UTC (rev 13353)
+++ trunk/qgis/src/plugins/point_displacement_renderer/qgspointdisplacementrenderer.cpp	2010-04-23 15:35:17 UTC (rev 13354)
@@ -66,7 +66,7 @@
   return r;
 }
 
-void QgsPointDisplacementRenderer::renderFeature( QgsFeature& feature, QgsRenderContext& context, int layer, bool drawVertexMarker )
+void QgsPointDisplacementRenderer::renderFeature( QgsFeature& feature, QgsRenderContext& context, int layer, bool selected, bool drawVertexMarker )
 {
   //point position in screen coords
   QgsGeometry* geom = feature.geometry();
@@ -147,7 +147,7 @@
   }
 
 
-  QgsSymbolV2RenderContext symbolContext( context, QgsSymbolV2::MM );
+  QgsSymbolV2RenderContext symbolContext( context, QgsSymbolV2::MM, 1.0, selected );
   double circleAdditionPainterUnits = symbolContext.outputLineWidth( mCircleRadiusAddition );
   double radius = std::max(( diagonal / 2 ), labelAttributeList.size() * diagonal / 2 / M_PI ) + circleAdditionPainterUnits;
 
@@ -163,7 +163,7 @@
   {
     if ( mCenterSymbol )
     {
-      mCenterSymbol->renderPoint( pt, context );
+      mCenterSymbol->renderPoint( pt, context, layer, selected );
     }
     else
     {
@@ -172,7 +172,7 @@
   }
 
   //draw symbols on the circle
-  drawSymbols( context, symbolList, symbolPositions );
+  drawSymbols( context, symbolList, symbolPositions, selected );
   //and also the labels
   drawLabels( pt, symbolContext, labelPositions, labelAttributeList );
 }
@@ -508,7 +508,7 @@
   p->drawArc( QRectF( centerPoint.x() - radiusPainterUnits, centerPoint.y() - radiusPainterUnits, 2 * radiusPainterUnits, 2 * radiusPainterUnits ), 0, 5760 );
 }
 
-void QgsPointDisplacementRenderer::drawSymbols( QgsRenderContext& context, const QList<QgsMarkerSymbolV2*>& symbolList, const QList<QPointF>& symbolPositions )
+void QgsPointDisplacementRenderer::drawSymbols( QgsRenderContext& context, const QList<QgsMarkerSymbolV2*>& symbolList, const QList<QPointF>& symbolPositions, bool selected )
 {
   QList<QPointF>::const_iterator symbolPosIt = symbolPositions.constBegin();
   QList<QgsMarkerSymbolV2*>::const_iterator symbolIt = symbolList.constBegin();
@@ -516,7 +516,7 @@
   {
     if ( *symbolIt )
     {
-      ( *symbolIt )->renderPoint( *symbolPosIt, context );
+      ( *symbolIt )->renderPoint( *symbolPosIt, context, -1, selected );
     }
   }
 }

Modified: trunk/qgis/src/plugins/point_displacement_renderer/qgspointdisplacementrenderer.h
===================================================================
--- trunk/qgis/src/plugins/point_displacement_renderer/qgspointdisplacementrenderer.h	2010-04-23 15:20:24 UTC (rev 13353)
+++ trunk/qgis/src/plugins/point_displacement_renderer/qgspointdisplacementrenderer.h	2010-04-23 15:35:17 UTC (rev 13354)
@@ -37,7 +37,7 @@
     QgsFeatureRendererV2* clone();
 
     /**Reimplemented from QgsFeatureRendererV2*/
-    void renderFeature( QgsFeature& feature, QgsRenderContext& context, int layer = -1, bool drawVertexMarker = false );
+    void renderFeature( QgsFeature& feature, QgsRenderContext& context, int layer = -1, bool selected = false, bool drawVertexMarker = false );
 
     QgsSymbolV2* symbolForFeature( QgsFeature& feature );
 
@@ -143,7 +143,7 @@
     //helper functions
     void calculateSymbolAndLabelPositions( const QPointF& centerPoint, int nPosition, double radius, double symbolDiagonal, QList<QPointF>& symbolPositions, QList<QPointF>& labelShifts ) const;
     void drawCircle( double radiusPainterUnits, QgsSymbolV2RenderContext& context, const QPointF& centerPoint, int nSymbols );
-    void drawSymbols( QgsRenderContext& context, const QList<QgsMarkerSymbolV2*>& symbolList, const QList<QPointF>& symbolPositions );
+    void drawSymbols( QgsRenderContext& context, const QList<QgsMarkerSymbolV2*>& symbolList, const QList<QPointF>& symbolPositions, bool selected = false );
     void drawLabels( const QPointF& centerPoint, QgsSymbolV2RenderContext& context, const QList<QPointF>& labelShifts, const QStringList& labelList );
 };
 



More information about the QGIS-commit mailing list