Skip to content

Commit 74b02a3

Browse files
author
timlinux
committedAug 6, 2008
Use mapRenderer() instead of mapRender() for the QgsMapCanvas map renderer accessor.
git-svn-id: http://svn.osgeo.org/qgis/trunk@9003 c8812cc2-4d05-0410-92ff-de0c093fc19c
1 parent f27a50b commit 74b02a3

File tree

6 files changed

+20
-20
lines changed

6 files changed

+20
-20
lines changed
 

‎src/app/composer/qgscomposermap.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -138,7 +138,7 @@ void QgsComposerMap::draw ( QPainter *painter, const QgsRect& extent, const QSiz
138138
return;
139139
}
140140

141-
QgsMapRenderer* canvasMapRenderer = mMapCanvas->mapRender();
141+
QgsMapRenderer* canvasMapRenderer = mMapCanvas->mapRenderer();
142142
if(!canvasMapRenderer)
143143
{
144144
return;

‎src/app/legend/qgslegend.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1754,7 +1754,7 @@ void QgsLegend::legendLayerZoom()
17541754
if (!theLayer)
17551755
continue;
17561756

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

17591759
if (!lyrExtent.isFinite())
17601760
lyrExtent = theLayer->extent();

‎src/app/qgisapp.cpp

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1297,9 +1297,9 @@ void QgisApp::setupConnections()
12971297
//signal when mouse moved over window (coords display in status bar)
12981298
connect(mMapCanvas, SIGNAL(xyCoordinates(QgsPoint &)), this, SLOT(showMouseCoordinate(QgsPoint &)));
12991299
//signal when mouse in capturePoint mode and mouse clicked on canvas
1300-
connect(mMapCanvas->mapRender(), SIGNAL(drawingProgress(int,int)), this, SLOT(showProgress(int,int)));
1301-
connect(mMapCanvas->mapRender(), SIGNAL(projectionsEnabled(bool)), this, SLOT(projectionsEnabled(bool)));
1302-
connect(mMapCanvas->mapRender(), SIGNAL(destinationSrsChanged()), this, SLOT(destinationSrsChanged()));
1300+
connect(mMapCanvas->mapRenderer(), SIGNAL(drawingProgress(int,int)), this, SLOT(showProgress(int,int)));
1301+
connect(mMapCanvas->mapRenderer(), SIGNAL(projectionsEnabled(bool)), this, SLOT(projectionsEnabled(bool)));
1302+
connect(mMapCanvas->mapRenderer(), SIGNAL(destinationSrsChanged()), this, SLOT(destinationSrsChanged()));
13031303
connect(mMapCanvas, SIGNAL(extentsChanged()),this,SLOT(showExtents()));
13041304
connect(mMapCanvas, SIGNAL(scaleChanged(double)), this, SLOT(showScale(double)));
13051305
connect(mMapCanvas, SIGNAL(scaleChanged(double)), this, SLOT(updateMouseCoordinatePrecision()));
@@ -2541,7 +2541,7 @@ void QgisApp::fileNew(bool thePromptToSaveFlag)
25412541
mMapCanvas->freeze(false);
25422542
mMapCanvas->refresh();
25432543

2544-
mMapCanvas->mapRender()->setProjectionsEnabled(FALSE);
2544+
mMapCanvas->mapRenderer()->setProjectionsEnabled(FALSE);
25452545

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

30303030
} // QgisApp::openProject
30313031

@@ -3286,7 +3286,7 @@ void QgisApp::stopRendering()
32863286
{
32873287
if(mMapCanvas)
32883288
{
3289-
QgsMapRenderer* mypMapRenderer = mMapCanvas->mapRender();
3289+
QgsMapRenderer* mypMapRenderer = mMapCanvas->mapRenderer();
32903290
if(mypMapRenderer)
32913291
{
32923292
QgsRenderContext* mypRenderContext = mypMapRenderer->renderContext();
@@ -4419,7 +4419,7 @@ void QgisApp::removePluginToolBarIcon(QAction *qAction)
44194419
void QgisApp::destinationSrsChanged()
44204420
{
44214421
// save this information to project
4422-
long srsid = mMapCanvas->mapRender()->destinationSrs().srsid();
4422+
long srsid = mMapCanvas->mapRenderer()->destinationSrs().srsid();
44234423
QgsProject::instance()->writeEntry("SpatialRefSys", "/ProjectSRSID", (int)srsid);
44244424

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

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

‎src/app/qgsmeasuredialog.cpp

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -88,15 +88,15 @@ void QgsMeasureDialog::mouseMove(QgsPoint &point)
8888
tmpPoints.append(point);
8989
if (mMeasureArea && tmpPoints.size() > 2)
9090
{
91-
double area = mTool->canvas()->mapRender()->distArea()->measurePolygon(tmpPoints);
91+
double area = mTool->canvas()->mapRenderer()->distArea()->measurePolygon(tmpPoints);
9292
editTotal->setText(formatArea(area));
9393
}
9494
else if (!mMeasureArea && tmpPoints.size() > 1)
9595
{
9696
int last = tmpPoints.size()-2;
9797
QgsPoint p1 = tmpPoints[last], p2 = tmpPoints[last+1];
9898

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

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

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

122122
mTotal += d;
123123
editTotal->setText(formatDistance(mTotal));

‎src/app/qgsmeasuretool.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,7 @@ void QgsMeasureTool::activate()
6767

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

124124
// set source SRS and projections enabled flag
125-
// QgsMapRenderer* mapRender = mCanvas->mapRender();
125+
// QgsMapRenderer* mapRender = mCanvas->mapRenderer();
126126
// mCalc->setProjectionsEnabled(mapRender->projectionsEnabled());
127127
// int srsid = mapRender->destinationSrs().srsid();
128128
// mCalc->setSourceSRS(srsid);

‎src/app/qgsprojectproperties.cpp

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ QgsProjectProperties::QgsProjectProperties(QgsMapCanvas* mapCanvas, QWidget *par
5151
// Properties stored in map canvas's QgsMapRenderer
5252
// these ones are propagated to QgsProject by a signal
5353

54-
QgsMapRenderer* myRender = mMapCanvas->mapRender();
54+
QgsMapRenderer* myRender = mMapCanvas->mapRenderer();
5555
QGis::units myUnit = myRender->mapUnits();
5656
setMapUnits(myUnit);
5757

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

180180

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

203203

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

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

240240
myRender->setMapUnits(mapUnit);
241241

0 commit comments

Comments
 (0)
Please sign in to comment.