[QGIS Commit] r8323 - in branches/rendercontext-branch: python/core
python/gui src/core
svn_qgis at osgeo.org
svn_qgis at osgeo.org
Mon Apr 7 04:31:54 EDT 2008
Author: mhugent
Date: 2008-04-07 04:31:54 -0400 (Mon, 07 Apr 2008)
New Revision: 8323
Modified:
branches/rendercontext-branch/python/core/core.sip
branches/rendercontext-branch/python/core/qgscontinuouscolorrenderer.sip
branches/rendercontext-branch/python/core/qgsgraduatedsymbolrenderer.sip
branches/rendercontext-branch/python/core/qgsmaplayer.sip
branches/rendercontext-branch/python/core/qgsmaprender.sip
branches/rendercontext-branch/python/core/qgsrasterlayer.sip
branches/rendercontext-branch/python/core/qgsrenderer.sip
branches/rendercontext-branch/python/core/qgssinglesymbolrenderer.sip
branches/rendercontext-branch/python/core/qgsuniquevaluerenderer.sip
branches/rendercontext-branch/python/core/qgsvectorlayer.sip
branches/rendercontext-branch/python/gui/qgsmapcanvas.sip
branches/rendercontext-branch/src/core/qgsrendercontext.h
branches/rendercontext-branch/src/core/qgsvectorlayer.cpp
Log:
Updated python bindings for the render context branch
Modified: branches/rendercontext-branch/python/core/core.sip
===================================================================
--- branches/rendercontext-branch/python/core/core.sip 2008-04-07 07:10:32 UTC (rev 8322)
+++ branches/rendercontext-branch/python/core/core.sip 2008-04-07 08:31:54 UTC (rev 8323)
@@ -46,6 +46,7 @@
%Include qgsrastertransparency.sip
%Include qgsrasterviewport.sip
%Include qgsrect.sip
+%Include qgsrendercontext.sip
%Include qgsrenderer.sip
%Include qgsscalecalculator.sip
%Include qgssinglesymbolrenderer.sip
Modified: branches/rendercontext-branch/python/core/qgscontinuouscolorrenderer.sip
===================================================================
--- branches/rendercontext-branch/python/core/qgscontinuouscolorrenderer.sip 2008-04-07 07:10:32 UTC (rev 8322)
+++ branches/rendercontext-branch/python/core/qgscontinuouscolorrenderer.sip 2008-04-07 08:31:54 UTC (rev 8323)
@@ -11,7 +11,7 @@
QgsContinuousColorRenderer(const QgsContinuousColorRenderer& other);
virtual ~QgsContinuousColorRenderer();
/**Renders the feature using the minimum and maximum value of the classification field*/
- void renderFeature(QPainter* p, QgsFeature& f, QImage* img, double* scalefactor, bool selected, double widthScale = 1);
+ void renderFeature(QPainter* p, QgsFeature& f, QImage* img, bool selected, double widthScale = 1.0, double rasterScaleFactor = 1.0);
/**Returns the number of the classification field*/
int classificationField() const;
/**Sets the id of the classification field*/
Modified: branches/rendercontext-branch/python/core/qgsgraduatedsymbolrenderer.sip
===================================================================
--- branches/rendercontext-branch/python/core/qgsgraduatedsymbolrenderer.sip 2008-04-07 07:10:32 UTC (rev 8322)
+++ branches/rendercontext-branch/python/core/qgsgraduatedsymbolrenderer.sip 2008-04-07 08:31:54 UTC (rev 8323)
@@ -23,7 +23,7 @@
\param p a painter (usually the one from the current map canvas)
\param f a pointer to a feature to render
\param t the transform object containing the information how to transform the map coordinates to screen coordinates*/
- void renderFeature(QPainter* p, QgsFeature& f, QImage* img, double* scalefactor, bool selected, double widthScale = 1);
+ void renderFeature(QPainter* p, QgsFeature& f, QImage* img, bool selected, double widthScale = 1.0, double rasterScaleFactor = 1.0);
/**Sets the number of the classicifation field
\param field the number of the field to classify*/
void setClassificationField(int field);
Modified: branches/rendercontext-branch/python/core/qgsmaplayer.sip
===================================================================
--- branches/rendercontext-branch/python/core/qgsmaplayer.sip 2008-04-07 07:10:32 UTC (rev 8322)
+++ branches/rendercontext-branch/python/core/qgsmaplayer.sip 2008-04-07 08:31:54 UTC (rev 8323)
@@ -57,12 +57,12 @@
/** Render the layer, to be overridden in child classes
*/
- virtual bool draw(QPainter* painter, const QgsRenderContext& renderContext);
+ virtual bool draw(QgsRenderContext& renderContext);
/** Draw labels
* @TODO to be removed: used only in vector layers
*/
- virtual void drawLabels(QPainter* painter, QgsRect& rect, QgsMapToPixel* mtp, QgsCoordinateTransform* ct);
+ virtual void drawLabels(QgsRenderContext& renderContext);
/** Return the extent of the layer as a QRect */
const QgsRect extent();
Modified: branches/rendercontext-branch/python/core/qgsmaprender.sip
===================================================================
--- branches/rendercontext-branch/python/core/qgsmaprender.sip 2008-04-07 07:10:32 UTC (rev 8322)
+++ branches/rendercontext-branch/python/core/qgsmaprender.sip 2008-04-07 08:31:54 UTC (rev 8323)
@@ -28,7 +28,7 @@
//! returns current extent
QgsRect extent();
- QgsMapToPixel* coordXForm();
+ const QgsMapToPixel* coordXForm();
double scale() const;
double mupp() const;
Modified: branches/rendercontext-branch/python/core/qgsrasterlayer.sip
===================================================================
--- branches/rendercontext-branch/python/core/qgsrasterlayer.sip 2008-04-07 07:10:32 UTC (rev 8322)
+++ branches/rendercontext-branch/python/core/qgsrasterlayer.sip 2008-04-07 08:31:54 UTC (rev 8323)
@@ -106,7 +106,7 @@
/** \brief This is called when the view on the rasterlayer needs to be refreshed (redrawn).
*/
- bool draw(QPainter* painter, const QgsRenderContext& renderContext);
+ bool draw(QgsRenderContext& renderContext);
/** \brief This is an overloaded version of the above function that is called by both draw above and drawThumbnail */
void draw(QPainter * theQPainter, QgsRasterViewPort * myRasterViewPort,
Modified: branches/rendercontext-branch/python/core/qgsrenderer.sip
===================================================================
--- branches/rendercontext-branch/python/core/qgsrenderer.sip 2008-04-07 07:10:32 UTC (rev 8322)
+++ branches/rendercontext-branch/python/core/qgsrenderer.sip 2008-04-07 08:31:54 UTC (rev 8323)
@@ -16,7 +16,7 @@
@param f a pointer to the feature to be rendered
@param pic pointer to a marker from SVG (is only used by marker renderers)
@param scalefactor pointer to the scale factor for the marker image*/
- virtual void renderFeature(QPainter* p, QgsFeature& f,QImage* pic, double* scalefactor, bool selected, double widthScale = 1)=0;
+ virtual void renderFeature(QPainter* p, QgsFeature& f,QImage* pic, bool selected, double widthScale = 1.0, double rasterScaleFactor = 1.0)=0;
/**Reads the renderer configuration from an XML file
@param rnode the DOM node to read
@param vl the vector layer which will be associated with the renderer*/
Modified: branches/rendercontext-branch/python/core/qgssinglesymbolrenderer.sip
===================================================================
--- branches/rendercontext-branch/python/core/qgssinglesymbolrenderer.sip 2008-04-07 07:10:32 UTC (rev 8322)
+++ branches/rendercontext-branch/python/core/qgssinglesymbolrenderer.sip 2008-04-07 08:31:54 UTC (rev 8323)
@@ -14,7 +14,7 @@
/*Returns a pointer to mSymbol*/
const QgsSymbol* symbol() const;
/**Renders an OGRFeature*/
- void renderFeature(QPainter* p, QgsFeature& f, QImage* img, double* scalefactor, bool selected, double widthScale = 1);
+ void renderFeature(QPainter* p, QgsFeature& f, QImage* img, bool selected, double widthScale = 1.0, double rasterScaleFactor = 1.0);
/**Reads the renderer configuration from an XML file
@param rnode the DOM node to read
@param vl the vector layer which will be associated with the renderer*/
Modified: branches/rendercontext-branch/python/core/qgsuniquevaluerenderer.sip
===================================================================
--- branches/rendercontext-branch/python/core/qgsuniquevaluerenderer.sip 2008-04-07 07:10:32 UTC (rev 8322)
+++ branches/rendercontext-branch/python/core/qgsuniquevaluerenderer.sip 2008-04-07 08:31:54 UTC (rev 8323)
@@ -11,7 +11,7 @@
/** Determines if a feature will be rendered or not
@param f a pointer to the feature to determine if rendering will happen*/
bool willRenderFeature(QgsFeature *f);
- void renderFeature(QPainter* p, QgsFeature& f,QImage* img, double* scalefactor, bool selected, double widthScale = 1);
+ void renderFeature(QPainter* p, QgsFeature& f, QImage* img, bool selected, double widthScale = 1.0, double rasterScaleFactor = 1.0);
/**Reads the renderer configuration from an XML file
@param rnode the DOM node to read
@param vl the vector layer which will be associated with the renderer*/
Modified: branches/rendercontext-branch/python/core/qgsvectorlayer.sip
===================================================================
--- branches/rendercontext-branch/python/core/qgsvectorlayer.sip 2008-04-07 07:10:32 UTC (rev 8322)
+++ branches/rendercontext-branch/python/core/qgsvectorlayer.sip 2008-04-07 08:31:54 UTC (rev 8323)
@@ -273,22 +273,15 @@
/** Draws the layer using coordinate transformation
* @return FALSE if an error occurred during drawing
*/
- bool draw(QPainter* painter, const QgsRenderContext& renderContext);
+ bool draw(QgsRenderContext& renderContext);
/** Draws the layer labels using coordinate transformation */
- void drawLabels(QPainter* painter, const QgsRenderContext& renderContext);
+ void drawLabels(QgsRenderContext& renderContext);
- /** \brief Draws the layer using coordinate transformation
- * \param widthScale line width scale
- * \param symbolScale symbol scale
+ /** \brief Draws the layer labels using coordinate transformation
+ * \param scale size scale, applied to all values in pixels
*/
- void draw(QPainter * p,
- QgsRect & viewExtent,
- QgsMapToPixel * cXf,
- QgsCoordinateTransform* ct,
- bool drawingToEditingCanvas,
- double widthScale,
- double symbolScale);
+ void drawLabels(QPainter * p, const QgsRect& viewExtent, const QgsMapToPixel* cXf, const QgsCoordinateTransform* ct, double scale);
/** returns array of added features */
QList<QgsFeature>& addedFeatures();
Modified: branches/rendercontext-branch/python/gui/qgsmapcanvas.sip
===================================================================
--- branches/rendercontext-branch/python/gui/qgsmapcanvas.sip 2008-04-07 07:10:32 UTC (rev 8322)
+++ branches/rendercontext-branch/python/gui/qgsmapcanvas.sip 2008-04-07 08:31:54 UTC (rev 8323)
@@ -144,7 +144,7 @@
QGis::units mapUnits() const;
//! Get the current coordinate transform
- QgsMapToPixel * getCoordinateTransform();
+ const QgsMapToPixel * getCoordinateTransform();
//! true if canvas currently drawing
bool isDrawing();
Modified: branches/rendercontext-branch/src/core/qgsrendercontext.h
===================================================================
--- branches/rendercontext-branch/src/core/qgsrendercontext.h 2008-04-07 07:10:32 UTC (rev 8322)
+++ branches/rendercontext-branch/src/core/qgsrendercontext.h 2008-04-07 08:31:54 UTC (rev 8323)
@@ -65,10 +65,6 @@
private:
- //Copy constructor and assignement operator forbidden
- QgsRenderContext(const QgsRenderContext& other){}
- QgsRenderContext& operator=(const QgsRenderContext&){}
-
/**Painter for rendering operations*/
QPainter* mPainter;
Modified: branches/rendercontext-branch/src/core/qgsvectorlayer.cpp
===================================================================
--- branches/rendercontext-branch/src/core/qgsvectorlayer.cpp 2008-04-07 07:10:32 UTC (rev 8322)
+++ branches/rendercontext-branch/src/core/qgsvectorlayer.cpp 2008-04-07 08:31:54 UTC (rev 8323)
@@ -276,7 +276,6 @@
}
}
-//void QgsVectorLayer::drawLabels(QPainter * p, QgsRect & viewExtent, QgsMapToPixel * theMapToPixelTransform, QgsCoordinateTransform* ct)
void QgsVectorLayer::drawLabels(QgsRenderContext& renderContext)
{
QPainter* thePainter = renderContext.painter();
More information about the QGIS-commit
mailing list