Skip to content

Commit

Permalink
Use mapRenderer() instead of mapRender() for the QgsMapCanvas map ren…
Browse files Browse the repository at this point in the history
…derer accessor.

git-svn-id: http://svn.osgeo.org/qgis/trunk@9003 c8812cc2-4d05-0410-92ff-de0c093fc19c
  • Loading branch information
timlinux committed Aug 6, 2008
1 parent f27a50b commit 74b02a3
Show file tree
Hide file tree
Showing 6 changed files with 20 additions and 20 deletions.
2 changes: 1 addition & 1 deletion src/app/composer/qgscomposermap.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
2 changes: 1 addition & 1 deletion src/app/legend/qgslegend.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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();
Expand Down
16 changes: 8 additions & 8 deletions src/app/qgisapp.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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()));
Expand Down Expand Up @@ -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);
Expand Down Expand Up @@ -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

Expand Down Expand Up @@ -3286,7 +3286,7 @@ void QgisApp::stopRendering()
{
if(mMapCanvas)
{
QgsMapRenderer* mypMapRenderer = mMapCanvas->mapRender();
QgsMapRenderer* mypMapRenderer = mMapCanvas->mapRenderer();
if(mypMapRenderer)
{
QgsRenderContext* mypRenderContext = mypMapRenderer->renderContext();
Expand Down Expand Up @@ -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);

}
Expand Down Expand Up @@ -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();

Expand Down
8 changes: 4 additions & 4 deletions src/app/qgsmeasuredialog.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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));
Expand All @@ -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)
Expand All @@ -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));
Expand Down
4 changes: 2 additions & 2 deletions src/app/qgsmeasuretool.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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))
{
Expand Down Expand Up @@ -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);
Expand Down
8 changes: 4 additions & 4 deletions src/app/qgsprojectproperties.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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);

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


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


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

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

myRender->setMapUnits(mapUnit);

Expand Down

0 comments on commit 74b02a3

Please sign in to comment.