Skip to content
Permalink
Browse files
Use mapRenderer() instead of mapRender() for the QgsMapCanvas map ren…
…derer accessor.

git-svn-id: http://svn.osgeo.org/qgis/trunk/qgis@9002 c8812cc2-4d05-0410-92ff-de0c093fc19c
  • Loading branch information
timlinux committed Aug 6, 2008
1 parent 5befedc commit 64bf591c8d0e5e1cb3f7963aad440258b66f68e1
@@ -62,7 +62,7 @@ class QgsMapCanvas : QGraphicsView

QgsMapCanvasMap* map();

QgsMapRenderer* mapRender();
QgsMapRenderer* mapRenderer();

//! Accessor for the canvas pixmap
QPixmap& canvasPixmap();
@@ -167,7 +167,7 @@ QgsMapCanvasMap* QgsMapCanvas::map()
return mMap;
}

QgsMapRenderer* QgsMapCanvas::mapRender()
QgsMapRenderer* QgsMapCanvas::mapRenderer()
{
return mMapRenderer;
}
@@ -113,7 +113,7 @@ class GUI_EXPORT QgsMapCanvas : public QGraphicsView

QgsMapCanvasMap* map();

QgsMapRenderer* mapRender();
QgsMapRenderer* mapRenderer();

//! Accessor for the canvas pixmap
QPixmap& canvasPixmap();
@@ -49,7 +49,7 @@ QRectF QgsMapCanvasMap::boundingRect() const
void QgsMapCanvasMap::resize(QSize size)
{
mPixmap = QPixmap(size);
mCanvas->mapRender()->setOutputSize(size, mPixmap.logicalDpiX());
mCanvas->mapRenderer()->setOutputSize(size, mPixmap.logicalDpiX());
}

void QgsMapCanvasMap::setPanningOffset(const QPoint& point)
@@ -81,7 +81,7 @@ void QgsMapCanvasMap::render()
if (mAntiAliasing)
paint.setRenderHint(QPainter::Antialiasing);

mCanvas->mapRender()->render(&paint);
mCanvas->mapRenderer()->render(&paint);

paint.end();

@@ -95,7 +95,7 @@ void QgsMapCanvasMap::render()
paint.begin(&mPixmap);
// Clip our drawing to the QPixmap
paint.setClipRect(mPixmap.rect());
mCanvas->mapRender()->render(&paint);
mCanvas->mapRenderer()->render(&paint);
paint.end();
}
update();
@@ -27,7 +27,7 @@ QgsMapCanvasSnapper::QgsMapCanvasSnapper(QgsMapCanvas* canvas): mMapCanvas(canva
{
if(canvas)
{
QgsMapRenderer* canvasRender = canvas->mapRender();
QgsMapRenderer* canvasRender = canvas->mapRenderer();
if(canvasRender)
{
mSnapper = new QgsSnapper(canvasRender);
@@ -50,7 +50,7 @@ void QgsMapCanvasSnapper::setMapCanvas(QgsMapCanvas* canvas)
mMapCanvas = canvas;
if(mMapCanvas)
{
mSnapper = new QgsSnapper(canvas->mapRender());
mSnapper = new QgsSnapper(canvas->mapRenderer());
}
else
{
@@ -284,7 +284,7 @@ void QgsMapOverviewCanvas::projectionsEnabled(bool flag)

void QgsMapOverviewCanvas::destinationSrsChanged()
{
const QgsSpatialRefSys& srs = mMapCanvas->mapRender()->destinationSrs();
const QgsSpatialRefSys& srs = mMapCanvas->mapRenderer()->destinationSrs();
mMapRenderer->setDestinationSrs(srs);
}

@@ -48,17 +48,17 @@ QgsPoint QgsMapTool::toLayerCoords(QgsMapLayer* layer, const QPoint& point)

QgsPoint QgsMapTool::toLayerCoords(QgsMapLayer* layer, const QgsPoint& point)
{
return mCanvas->mapRender()->outputCoordsToLayerCoords(layer, point);
return mCanvas->mapRenderer()->outputCoordsToLayerCoords(layer, point);
}

QgsPoint QgsMapTool::toMapCoords(QgsMapLayer* layer, const QgsPoint& point)
{
return mCanvas->mapRender()->layerCoordsToOutputCoords(layer, point);
return mCanvas->mapRenderer()->layerCoordsToOutputCoords(layer, point);
}

QgsRect QgsMapTool::toLayerCoords(QgsMapLayer* layer, const QgsRect& rect)
{
return mCanvas->mapRender()->outputCoordsToLayerCoords(layer, rect);
return mCanvas->mapRenderer()->outputCoordsToLayerCoords(layer, rect);
}

QPoint QgsMapTool::toCanvasCoords(const QgsPoint& point)
@@ -96,7 +96,7 @@ void QgsQuickPrint::setOutputPdf(QString theFileName)
}
void QgsQuickPrint::setMapCanvas(QgsMapCanvas * thepMapCanvas)
{
mpMapRenderer=thepMapCanvas->mapRender();
mpMapRenderer=thepMapCanvas->mapRenderer();
mMapBackgroundColour = thepMapCanvas->canvasColor();
}
void QgsQuickPrint::setMapRenderer(QgsMapRenderer * thepMapRenderer)
@@ -160,7 +160,7 @@ void QgsRubberBand::setToGeometry(QgsGeometry* geom, QgsVectorLayer& layer)
}

//maprender object of canvas
QgsMapRenderer* mr = mMapCanvas->mapRender();
QgsMapRenderer* mr = mMapCanvas->mapRenderer();
if(!mr)
{
return;
@@ -1117,8 +1117,8 @@ double QgsGrassEdit::threshold ( void )
{
try
{
p1 = mCanvas->mapRender()->outputCoordsToLayerCoords(mLayer, p1);
p2 = mCanvas->mapRender()->outputCoordsToLayerCoords(mLayer, p2);
p1 = mCanvas->mapRenderer()->outputCoordsToLayerCoords(mLayer, p1);
p2 = mCanvas->mapRenderer()->outputCoordsToLayerCoords(mLayer, p2);
}
catch(QgsCsException& cse)
{
@@ -1755,13 +1755,13 @@ void QgsGrassEdit::displayNode ( int node, const QPen & pen, int size, QPainter

QgsPoint QgsGrassEdit::transformLayerToCanvas ( QgsPoint point)
{
point = mCanvas->mapRender()->layerCoordsToOutputCoords(mLayer, point);
point = mCanvas->mapRenderer()->layerCoordsToOutputCoords(mLayer, point);
return mTransform->transform(point);
}

QgsPoint QgsGrassEdit::transformLayerToMap ( QgsPoint point)
{
return mCanvas->mapRender()->layerCoordsToOutputCoords(mLayer, point);
return mCanvas->mapRenderer()->layerCoordsToOutputCoords(mLayer, point);
}

void QgsGrassEdit::displayIcon ( double x, double y, const QPen & pen,
@@ -297,7 +297,7 @@ bool QgsNorthArrowPlugin::calculateNorthDirection()

if (mapCanvas.layerCount() > 0)
{
QgsSpatialRefSys outputSRS = mapCanvas.mapRender()->destinationSrs();
QgsSpatialRefSys outputSRS = mapCanvas.mapRenderer()->destinationSrs();

if (outputSRS.isValid() && !outputSRS.geographicFlag())
{

0 comments on commit 64bf591

Please sign in to comment.