[QGIS Commit] r12672 - trunk/qgis/python/core

svn_qgis at osgeo.org svn_qgis at osgeo.org
Tue Jan 5 09:09:34 EST 2010


Author: wonder
Date: 2010-01-05 09:09:31 -0500 (Tue, 05 Jan 2010)
New Revision: 12672

Modified:
   trunk/qgis/python/core/qgsrenderer.sip
   trunk/qgis/python/core/qgssinglesymbolrenderer.sip
Log:
PyQGIS: added missing conversion to QgsRenderer subclasses, added few missing methods


Modified: trunk/qgis/python/core/qgsrenderer.sip
===================================================================
--- trunk/qgis/python/core/qgsrenderer.sip	2010-01-05 13:32:37 UTC (rev 12671)
+++ trunk/qgis/python/core/qgsrenderer.sip	2010-01-05 14:09:31 UTC (rev 12672)
@@ -4,13 +4,34 @@
 {
 %TypeHeaderCode
 #include <qgsrenderer.h>
+#include <qgssinglesymbolrenderer.h>
+#include <qgsuniquevaluerenderer.h>
+#include <qgsgraduatedsymbolrenderer.h>
+#include <qgscontinuouscolorrenderer.h>
 %End
+
+%ConvertToSubClassCode
+  if (dynamic_cast<QgsSingleSymbolRenderer*>(sipCpp) != NULL)
+    sipClass = sipClass_QgsSingleSymbolRenderer;
+  else if (dynamic_cast<QgsUniqueValueRenderer*>(sipCpp) != NULL)
+    sipClass = sipClass_QgsUniqueValueRenderer;
+  else if (dynamic_cast<QgsGraduatedSymbolRenderer*>(sipCpp) != NULL)
+    sipClass = sipClass_QgsGraduatedSymbolRenderer;
+  else if (dynamic_cast<QgsContinuousColorRenderer*>(sipCpp) != NULL)
+    sipClass = sipClass_QgsContinuousColorRenderer;
+  else
+    sipClass = 0;
+%End
+
   
  public:
     /** Default ctor sets up selection color from project properties */
     QgsRenderer();
     /** Virtual destructor because we have virtual methods... */
     virtual ~QgsRenderer();
+    /** Determines if a feature will be rendered or not
+    @param f a pointer to the feature to determine if rendering will happen*/
+    virtual bool willRenderFeature( QgsFeature *f );
     /**A vector layer passes features to a renderer object to change the brush and pen of the qpainter
      @param p the painter storing brush and pen
      @param f a pointer to the feature to be rendered
@@ -59,6 +80,9 @@
     /**Returns true if this renderer uses its own transparency settings, e.g. differentiated by classification.
      This is a hint for QgsVectorLayer to not use the transparency setting on layer level in this cases*/
     virtual bool usesTransparency() const;
+
+    /**Scales a brush to a given raster scale factor (e.g. for printing)*/
+    static void scaleBrush( QBrush& b, double rasterScaleFactor );
    
 };
 

Modified: trunk/qgis/python/core/qgssinglesymbolrenderer.sip
===================================================================
--- trunk/qgis/python/core/qgssinglesymbolrenderer.sip	2010-01-05 13:32:37 UTC (rev 12671)
+++ trunk/qgis/python/core/qgssinglesymbolrenderer.sip	2010-01-05 14:09:31 UTC (rev 12672)
@@ -31,6 +31,7 @@
     bool needsAttributes() const;
     /**Returns an empty list, since no classification attributes are used*/
     QList<int> classificationAttributes() const;
+    void updateSymbolAttributes();
     /**Returns the renderers name*/
     virtual QString name() const;
     /**Returns a list containing mSymbol*/



More information about the QGIS-commit mailing list