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@9003 c8812cc2-4d05-0410-92ff-de0c093fc19c
  • Loading branch information
timlinux committed Aug 6, 2008
1 parent 64bf591 commit 2d714e42935c32fa7ffbe54fb82a470abae7a488
@@ -138,7 +138,7 @@ void QgsComposerMap::draw ( QPainter *painter, const QgsRect& extent, const QSiz
return;
}

QgsMapRenderer* canvasMapRenderer = mMapCanvas->mapRender();
QgsMapRenderer* canvasMapRenderer = mMapCanvas->mapRenderer();
if(!canvasMapRenderer)
{
return;
@@ -1754,7 +1754,7 @@ void QgsLegend::legendLayerZoom()
if (!theLayer)
continue;

QgsRect lyrExtent = mMapCanvas->mapRender()->layerExtentToOutputExtent(theLayer, theLayer->extent());
QgsRect lyrExtent = mMapCanvas->mapRenderer()->layerExtentToOutputExtent(theLayer, theLayer->extent());

if (!lyrExtent.isFinite())
lyrExtent = theLayer->extent();
@@ -1297,9 +1297,9 @@ void QgisApp::setupConnections()
//signal when mouse moved over window (coords display in status bar)
connect(mMapCanvas, SIGNAL(xyCoordinates(QgsPoint &)), this, SLOT(showMouseCoordinate(QgsPoint &)));
//signal when mouse in capturePoint mode and mouse clicked on canvas
connect(mMapCanvas->mapRender(), SIGNAL(drawingProgress(int,int)), this, SLOT(showProgress(int,int)));
connect(mMapCanvas->mapRender(), SIGNAL(projectionsEnabled(bool)), this, SLOT(projectionsEnabled(bool)));
connect(mMapCanvas->mapRender(), SIGNAL(destinationSrsChanged()), this, SLOT(destinationSrsChanged()));
connect(mMapCanvas->mapRenderer(), SIGNAL(drawingProgress(int,int)), this, SLOT(showProgress(int,int)));
connect(mMapCanvas->mapRenderer(), SIGNAL(projectionsEnabled(bool)), this, SLOT(projectionsEnabled(bool)));
connect(mMapCanvas->mapRenderer(), SIGNAL(destinationSrsChanged()), this, SLOT(destinationSrsChanged()));
connect(mMapCanvas, SIGNAL(extentsChanged()),this,SLOT(showExtents()));
connect(mMapCanvas, SIGNAL(scaleChanged(double)), this, SLOT(showScale(double)));
connect(mMapCanvas, SIGNAL(scaleChanged(double)), this, SLOT(updateMouseCoordinatePrecision()));
@@ -2541,7 +2541,7 @@ void QgisApp::fileNew(bool thePromptToSaveFlag)
mMapCanvas->freeze(false);
mMapCanvas->refresh();

mMapCanvas->mapRender()->setProjectionsEnabled(FALSE);
mMapCanvas->mapRenderer()->setProjectionsEnabled(FALSE);

// set the initial map tool
mMapCanvas->setMapTool(mMapTools.mPan);
@@ -3025,7 +3025,7 @@ void QgisApp::openProject(QAction *action)
//set the projections enabled icon in the status bar
int myProjectionEnabledFlag =
QgsProject::instance()->readNumEntry("SpatialRefSys","/ProjectionsEnabled",0);
mMapCanvas->mapRender()->setProjectionsEnabled(myProjectionEnabledFlag);
mMapCanvas->mapRenderer()->setProjectionsEnabled(myProjectionEnabledFlag);

} // QgisApp::openProject

@@ -3286,7 +3286,7 @@ void QgisApp::stopRendering()
{
if(mMapCanvas)
{
QgsMapRenderer* mypMapRenderer = mMapCanvas->mapRender();
QgsMapRenderer* mypMapRenderer = mMapCanvas->mapRenderer();
if(mypMapRenderer)
{
QgsRenderContext* mypRenderContext = mypMapRenderer->renderContext();
@@ -4419,7 +4419,7 @@ void QgisApp::removePluginToolBarIcon(QAction *qAction)
void QgisApp::destinationSrsChanged()
{
// save this information to project
long srsid = mMapCanvas->mapRender()->destinationSrs().srsid();
long srsid = mMapCanvas->mapRenderer()->destinationSrs().srsid();
QgsProject::instance()->writeEntry("SpatialRefSys", "/ProjectSRSID", (int)srsid);

}
@@ -4582,7 +4582,7 @@ void QgisApp::projectProperties()
//pass any refresg signals off to canvases
//connect (pp,SIGNAL(refresh()), mMapCanvas, SLOT(refresh()));

QgsMapRenderer* myRender = mMapCanvas->mapRender();
QgsMapRenderer* myRender = mMapCanvas->mapRenderer();
bool wasProjected = myRender->projectionsEnabled();
long oldSRSID = myRender->destinationSrs().srsid();

@@ -88,15 +88,15 @@ void QgsMeasureDialog::mouseMove(QgsPoint &point)
tmpPoints.append(point);
if (mMeasureArea && tmpPoints.size() > 2)
{
double area = mTool->canvas()->mapRender()->distArea()->measurePolygon(tmpPoints);
double area = mTool->canvas()->mapRenderer()->distArea()->measurePolygon(tmpPoints);
editTotal->setText(formatArea(area));
}
else if (!mMeasureArea && tmpPoints.size() > 1)
{
int last = tmpPoints.size()-2;
QgsPoint p1 = tmpPoints[last], p2 = tmpPoints[last+1];

double d = mTool->canvas()->mapRender()->distArea()->measureLine(p1,p2);
double d = mTool->canvas()->mapRenderer()->distArea()->measureLine(p1,p2);
QTreeWidgetItem *item = mTable->topLevelItem(mTable->topLevelItemCount()-1);
item->setText(0, QLocale::system().toString(d, 'f', 2));
editTotal->setText(formatDistance(mTotal + d));
@@ -108,7 +108,7 @@ void QgsMeasureDialog::addPoint(QgsPoint &point)
int numPoints = mTool->points().size();
if (mMeasureArea && numPoints > 2)
{
double area = mTool->canvas()->mapRender()->distArea()->measurePolygon(mTool->points());
double area = mTool->canvas()->mapRenderer()->distArea()->measurePolygon(mTool->points());
editTotal->setText(formatArea(area));
}
else if (!mMeasureArea && numPoints > 1)
@@ -117,7 +117,7 @@ void QgsMeasureDialog::addPoint(QgsPoint &point)

QgsPoint p1 = mTool->points()[last], p2 = mTool->points()[last+1];

double d = mTool->canvas()->mapRender()->distArea()->measureLine(p1,p2);
double d = mTool->canvas()->mapRenderer()->distArea()->measureLine(p1,p2);

mTotal += d;
editTotal->setText(formatDistance(mTotal));
@@ -67,7 +67,7 @@ void QgsMeasureTool::activate()

// If we suspect that they have data that is projected, yet the
// map SRS is set to a geographic one, warn them.
if (mCanvas->mapRender()->distArea()->geographic() &&
if (mCanvas->mapRenderer()->distArea()->geographic() &&
(mCanvas->extent().height() > 360 ||
mCanvas->extent().width() > 720))
{
@@ -122,7 +122,7 @@ void QgsMeasureTool::updateProjection()
// mCalc->setEllipsoid(ellipsoid);

// set source SRS and projections enabled flag
// QgsMapRenderer* mapRender = mCanvas->mapRender();
// QgsMapRenderer* mapRender = mCanvas->mapRenderer();
// mCalc->setProjectionsEnabled(mapRender->projectionsEnabled());
// int srsid = mapRender->destinationSrs().srsid();
// mCalc->setSourceSRS(srsid);
@@ -51,7 +51,7 @@ QgsProjectProperties::QgsProjectProperties(QgsMapCanvas* mapCanvas, QWidget *par
// Properties stored in map canvas's QgsMapRenderer
// these ones are propagated to QgsProject by a signal

QgsMapRenderer* myRender = mMapCanvas->mapRender();
QgsMapRenderer* myRender = mMapCanvas->mapRenderer();
QGis::units myUnit = myRender->mapUnits();
setMapUnits(myUnit);

@@ -174,7 +174,7 @@ QgsProjectProperties::~QgsProjectProperties()
// return the map units
QGis::units QgsProjectProperties::mapUnits() const
{
return mMapCanvas->mapRender()->mapUnits();
return mMapCanvas->mapRenderer()->mapUnits();
}


@@ -197,7 +197,7 @@ void QgsProjectProperties::setMapUnits(QGis::units unit)
{
radDecimalDegrees->setChecked(true);
}
mMapCanvas->mapRender()->setMapUnits(unit);
mMapCanvas->mapRenderer()->setMapUnits(unit);
}


@@ -235,7 +235,7 @@ void QgsProjectProperties::apply()
mapUnit=QGis::DEGREES;
}

QgsMapRenderer* myRender = mMapCanvas->mapRender();
QgsMapRenderer* myRender = mMapCanvas->mapRenderer();

myRender->setMapUnits(mapUnit);

0 comments on commit 2d714e4

Please sign in to comment.