[QGIS Commit] r9134 - in trunk/qgis: python/core python/gui src/app
src/app/legend src/core src/core/composer src/gui
src/plugins/georeferencer src/plugins/scale_bar
tests/algorithms/qgsproject
svn_qgis at osgeo.org
svn_qgis at osgeo.org
Sat Aug 23 15:15:03 EDT 2008
Author: timlinux
Date: 2008-08-23 15:15:03 -0400 (Sat, 23 Aug 2008)
New Revision: 9134
Modified:
trunk/qgis/python/core/qgsmaprenderer.sip
trunk/qgis/python/core/qgsmaptopixel.sip
trunk/qgis/python/core/qgsproject.sip
trunk/qgis/python/gui/qgsmapcanvas.sip
trunk/qgis/src/app/legend/qgslegend.cpp
trunk/qgis/src/app/qgisapp.cpp
trunk/qgis/src/app/qgsmaptoolidentify.cpp
trunk/qgis/src/core/composer/qgscomposermap.cpp
trunk/qgis/src/core/composer/qgscomposermap.h
trunk/qgis/src/core/qgscoordinatereferencesystem.h
trunk/qgis/src/core/qgsmaplayer.cpp
trunk/qgis/src/core/qgsmaprenderer.cpp
trunk/qgis/src/core/qgsmaprenderer.h
trunk/qgis/src/core/qgsmaptopixel.cpp
trunk/qgis/src/core/qgsmaptopixel.h
trunk/qgis/src/core/qgsproject.cpp
trunk/qgis/src/core/qgsproject.h
trunk/qgis/src/core/qgsvectorlayer.cpp
trunk/qgis/src/gui/qgsmapcanvas.cpp
trunk/qgis/src/gui/qgsmapcanvas.h
trunk/qgis/src/gui/qgsquickprint.cpp
trunk/qgis/src/plugins/georeferencer/qgspointdialog.cpp
trunk/qgis/src/plugins/scale_bar/plugin.cpp
trunk/qgis/tests/algorithms/qgsproject/projecttest.h
Log:
Further api consistency cleanups
Modified: trunk/qgis/python/core/qgsmaprenderer.sip
===================================================================
--- trunk/qgis/python/core/qgsmaprenderer.sip 2008-08-23 14:06:01 UTC (rev 9133)
+++ trunk/qgis/python/core/qgsmaprenderer.sip 2008-08-23 19:15:03 UTC (rev 9134)
@@ -31,7 +31,7 @@
const QgsMapToPixel* coordinateTransform();
double scale() const;
- double mupp() const;
+ double mapUnitsPerPixel() const;
int width() const;
int height() const;
Modified: trunk/qgis/python/core/qgsmaptopixel.sip
===================================================================
--- trunk/qgis/python/core/qgsmaptopixel.sip 2008-08-23 14:06:01 UTC (rev 9133)
+++ trunk/qgis/python/core/qgsmaptopixel.sip 2008-08-23 19:15:03 UTC (rev 9134)
@@ -12,12 +12,12 @@
public:
/* Constructor
- * @param mupp Map units per pixel
+ * @param mapUnitsPerPixel Map units per pixel
* @param ymax Maximum y value of the map canvas
* @param ymin Minimum y value of the map canvas
* @param xmin Minimum x value of the map canvas
*/
- QgsMapToPixel(double mupp=0, double ymax = 0, double ymin=0,
+ QgsMapToPixel(double mapUnitsPerPixel=0, double ymax = 0, double ymin=0,
double xmin = 0);
//! destructor
~QgsMapToPixel();
@@ -61,9 +61,9 @@
QgsPoint toMapPoint(int x, int y);
/*! Set map units per pixel
- * @param mupp Map units per pixel
+ * @param mapUnitsPerPixel Map units per pixel
*/
- void setMapUnitsPerPixel(double mupp);
+ void setMapUnitsPerPixel(double mapUnitsPerPixel);
//! Return current map units per pixel
double mapUnitsPerPixel();
@@ -75,12 +75,12 @@
//! set minimum x value
void setXMinimum(double xmin);
/*! Set parameters for use in tranfsorming coordinates
- * @param mupp Map units per pixel
+ * @param mapUnitsPerPixel Map units per pixel
* @param xmin Minimum x value
* @param ymin Minimum y value
* @param ymax Maximum y value
*/
- void setParameters(double mupp, double xmin, double ymin, double ymax);
+ void setParameters(double mapUnitsPerPixel, double xmin, double ymin, double ymax);
//! String representation of the parameters used in the transform
QString showParameters();
Modified: trunk/qgis/python/core/qgsproject.sip
===================================================================
--- trunk/qgis/python/core/qgsproject.sip 2008-08-23 14:06:01 UTC (rev 9133)
+++ trunk/qgis/python/core/qgsproject.sip 2008-08-23 19:15:03 UTC (rev 9134)
@@ -62,7 +62,7 @@
void setFilename( const QString & name );
/** returns file name */
- QString filename() const;
+ QString setFilename() const;
//@}
Modified: trunk/qgis/python/gui/qgsmapcanvas.sip
===================================================================
--- trunk/qgis/python/gui/qgsmapcanvas.sip 2008-08-23 14:06:01 UTC (rev 9133)
+++ trunk/qgis/python/gui/qgsmapcanvas.sip 2008-08-23 19:15:03 UTC (rev 9134)
@@ -73,8 +73,8 @@
//! Clear the map canvas
void clear();
- //! Returns the mupp (map units per pixel) for the canvas
- double mupp() const;
+ //! Returns the mapUnitsPerPixel (map units per pixel) for the canvas
+ double mapUnitsPerPixel() const;
//! Returns the current zoom exent of the map canvas
QgsRect extent() const;
Modified: trunk/qgis/src/app/legend/qgslegend.cpp
===================================================================
--- trunk/qgis/src/app/legend/qgslegend.cpp 2008-08-23 14:06:01 UTC (rev 9133)
+++ trunk/qgis/src/app/legend/qgslegend.cpp 2008-08-23 19:15:03 UTC (rev 9134)
@@ -1795,12 +1795,12 @@
if(layer)
{
QgsDebugMsg("Raster units per pixel : " + QString::number(layer->rasterUnitsPerPixel()));
- QgsDebugMsg("Mupp before : " + QString::number(mMapCanvas->mupp()));
+ QgsDebugMsg("MapUnitsPerPixel before : " + QString::number(mMapCanvas->mapUnitsPerPixel()));
- mMapCanvas->zoom(fabs( layer->rasterUnitsPerPixel() / mMapCanvas->mupp()));
+ mMapCanvas->zoom(fabs( layer->rasterUnitsPerPixel() / mMapCanvas->mapUnitsPerPixel()));
mMapCanvas->refresh();
- QgsDebugMsg("Mupp after : " + QString::number(mMapCanvas->mupp()));
+ QgsDebugMsg("MapUnitsPerPixel after : " + QString::number(mMapCanvas->mapUnitsPerPixel()));
// notify the project we've made a change
QgsProject::instance()->dirty(true);
Modified: trunk/qgis/src/app/qgisapp.cpp
===================================================================
--- trunk/qgis/src/app/qgisapp.cpp 2008-08-23 14:06:01 UTC (rev 9133)
+++ trunk/qgis/src/app/qgisapp.cpp 2008-08-23 19:15:03 UTC (rev 9134)
@@ -224,14 +224,14 @@
if ( QgsProject::instance()->title().isEmpty() )
{
- if ( QgsProject::instance()->filename().isEmpty() )
+ if ( QgsProject::instance()->setFilename().isEmpty() )
{
// no project title nor file name, so just leave caption with
// application name and version
}
else
{
- QFileInfo projectFileInfo( QgsProject::instance()->filename() );
+ QFileInfo projectFileInfo( QgsProject::instance()->setFilename() );
caption += projectFileInfo.baseName();
}
}
@@ -2882,7 +2882,7 @@
// the current project file name is empty
bool isNewProject = false;
- if ( QgsProject::instance()->filename().isNull() )
+ if ( QgsProject::instance()->setFilename().isNull() )
{
isNewProject = true;
@@ -2925,7 +2925,7 @@
if ( QgsProject::instance()->write() )
{
setTitleBarText_(*this); // update title bar
- statusBar()->showMessage(tr("Saved project to:") + " " + QgsProject::instance()->filename() );
+ statusBar()->showMessage(tr("Saved project to:") + " " + QgsProject::instance()->setFilename() );
if (isNewProject)
{
@@ -2938,13 +2938,13 @@
{
QMessageBox::critical(this,
tr("Unable to save project"),
- tr("Unable to save project to ") + QgsProject::instance()->filename() );
+ tr("Unable to save project to ") + QgsProject::instance()->setFilename() );
}
}
catch ( std::exception & e )
{
QMessageBox::critical( this,
- tr("Unable to save project ") + QgsProject::instance()->filename(),
+ tr("Unable to save project ") + QgsProject::instance()->setFilename(),
QString::fromLocal8Bit( e.what() ) );
}
return true;
@@ -3008,7 +3008,7 @@
if ( QgsProject::instance()->write() )
{
setTitleBarText_(*this); // update title bar
- statusBar()->showMessage(tr("Saved project to:") + " " + QgsProject::instance()->filename() );
+ statusBar()->showMessage(tr("Saved project to:") + " " + QgsProject::instance()->setFilename() );
// add this to the list of recently used project files
saveRecentProjectPath(fullPath.filePath(), settings);
}
@@ -3016,13 +3016,13 @@
{
QMessageBox::critical(this,
tr("Unable to save project"),
- tr("Unable to save project to ") + QgsProject::instance()->filename() );
+ tr("Unable to save project to ") + QgsProject::instance()->setFilename() );
}
}
catch ( std::exception & e )
{
QMessageBox::critical( 0x0,
- tr("Unable to save project ") + QgsProject::instance()->filename(),
+ tr("Unable to save project ") + QgsProject::instance()->setFilename(),
QString::fromLocal8Bit( e.what() ),
QMessageBox::Ok,
Qt::NoButton );
@@ -4618,8 +4618,8 @@
// coordinates with the aim of always having enough decimal places
// to show the difference in position between adjacent pixels.
// Also avoid taking the log of 0.
- if (getMapCanvas()->mupp() != 0.0)
- dp = static_cast<int> (ceil(-1.0*log10(getMapCanvas()->mupp())));
+ if (getMapCanvas()->mapUnitsPerPixel() != 0.0)
+ dp = static_cast<int> (ceil(-1.0*log10(getMapCanvas()->mapUnitsPerPixel())));
}
else
dp = QgsProject::instance()->readNumEntry("PositionPrecision","/DecimalPlaces");
Modified: trunk/qgis/src/app/qgsmaptoolidentify.cpp
===================================================================
--- trunk/qgis/src/app/qgsmaptoolidentify.cpp 2008-08-23 14:06:01 UTC (rev 9133)
+++ trunk/qgis/src/app/qgsmaptoolidentify.cpp 2008-08-23 19:15:03 UTC (rev 9134)
@@ -180,8 +180,8 @@
//we need to map the view pixel coordinates
//to WMS layer pixel coordinates
QgsRect viewExtent = mCanvas->extent();
- double mupp = mCanvas->mupp();
- if(mupp == 0)
+ double mapUnitsPerPixel = mCanvas->mapUnitsPerPixel();
+ if(mapUnitsPerPixel == 0)
{
return;
}
@@ -196,7 +196,7 @@
if(xMinView < xMinLayer)
{
- i = (int)(point.x() - (xMinLayer - xMinView) / mupp);
+ i = (int)(point.x() - (xMinLayer - xMinView) / mapUnitsPerPixel);
}
else
{
@@ -205,7 +205,7 @@
if(yMaxView > yMaxLayer)
{
- j = (int)(point.y() - (yMaxView - yMaxLayer) / mupp);
+ j = (int)(point.y() - (yMaxView - yMaxLayer) / mapUnitsPerPixel);
}
else
{
Modified: trunk/qgis/src/core/composer/qgscomposermap.cpp
===================================================================
--- trunk/qgis/src/core/composer/qgscomposermap.cpp 2008-08-23 14:06:01 UTC (rev 9133)
+++ trunk/qgis/src/core/composer/qgscomposermap.cpp 2008-08-23 19:15:03 UTC (rev 9134)
@@ -147,10 +147,10 @@
}
mCachePixmap = QPixmap( w, h );
- double mupp = mExtent.width() / w;
+ double mapUnitsPerPixel = mExtent.width() / w;
// WARNING: ymax in QgsMapToPixel is device height!!!
- QgsMapToPixel transform(mupp, h, mExtent.yMin(), mExtent.xMin() );
+ QgsMapToPixel transform(mapUnitsPerPixel, h, mExtent.yMin(), mExtent.xMin() );
mCachePixmap.fill(QColor(255,255,255));
Modified: trunk/qgis/src/core/composer/qgscomposermap.h
===================================================================
--- trunk/qgis/src/core/composer/qgscomposermap.h 2008-08-23 14:06:01 UTC (rev 9133)
+++ trunk/qgis/src/core/composer/qgscomposermap.h 2008-08-23 19:15:03 UTC (rev 9134)
@@ -111,14 +111,14 @@
/**Sets offset values to shift image (useful for live updates when moving item content)*/
void setOffset(double xOffset, double yOffset);
- /** stores state in DOM node
- * @param elem is DOM element corresponding to 'Composer' tag
+ /** stores state in Dom node
+ * @param elem is Dom element corresponding to 'Composer' tag
* @param temp write template file
*/
bool writeXML(QDomElement& elem, QDomDocument & doc);
- /** sets state from DOM document
- * @param itemElem is DOM node corresponding to 'ComposerMap' tag
+ /** sets state from Dom document
+ * @param itemElem is Dom node corresponding to 'ComposerMap' tag
*/
bool readXML(const QDomElement& itemElem, const QDomDocument& doc);
Modified: trunk/qgis/src/core/qgscoordinatereferencesystem.h
===================================================================
--- trunk/qgis/src/core/qgscoordinatereferencesystem.h 2008-08-23 14:06:01 UTC (rev 9133)
+++ trunk/qgis/src/core/qgscoordinatereferencesystem.h 2008-08-23 19:15:03 UTC (rev 9134)
@@ -214,12 +214,12 @@
*/
QString toWkt() const;
- /*! Restores state from the given DOM node.
+ /*! Restores state from the given Dom node.
* @param theNode The node from which state will be restored
* @return bool True on success, False on failure
*/
bool readXML( QDomNode & theNode );
- /*! Stores state to the given DOM node in the given document.
+ /*! Stores state to the given Dom node in the given document.
* Below is an example of the generated tag.
* <spatialrefsys>
* <proj4>+proj=longlat +ellps=WGS84 +datum=WGS84 +no_defs </proj4>
Modified: trunk/qgis/src/core/qgsmaplayer.cpp
===================================================================
--- trunk/qgis/src/core/qgsmaplayer.cpp 2008-08-23 14:06:01 UTC (rev 9133)
+++ trunk/qgis/src/core/qgsmaplayer.cpp 2008-08-23 19:15:03 UTC (rev 9134)
@@ -481,7 +481,7 @@
}
else
{
- QFileInfo project( QgsProject::instance()->filename() );
+ QFileInfo project( QgsProject::instance()->setFilename() );
QgsDebugMsg( QString("project filename: %1").arg( project.absoluteFilePath() ) );
QString qml;
Modified: trunk/qgis/src/core/qgsmaprenderer.cpp
===================================================================
--- trunk/qgis/src/core/qgsmaprenderer.cpp 2008-08-23 14:06:01 UTC (rev 9133)
+++ trunk/qgis/src/core/qgsmaprenderer.cpp 2008-08-23 19:15:03 UTC (rev 9134)
@@ -140,21 +140,21 @@
}
// calculate the translation and scaling parameters
- // mupp = map units per pixel
- double muppY = static_cast<double>(mExtent.height())
+ // mapUnitsPerPixel = map units per pixel
+ double mapUnitsPerPixelY = static_cast<double>(mExtent.height())
/ static_cast<double>(myHeight);
- double muppX = static_cast<double>(mExtent.width())
+ double mapUnitsPerPixelX = static_cast<double>(mExtent.width())
/ static_cast<double>(myWidth);
- mMupp = muppY > muppX ? muppY : muppX;
+ mMapUnitsPerPixel = mapUnitsPerPixelY > mapUnitsPerPixelX ? mapUnitsPerPixelY : mapUnitsPerPixelX;
// calculate the actual extent of the mapCanvas
double dxmin, dxmax, dymin, dymax, whitespace;
- if (muppY > muppX)
+ if (mapUnitsPerPixelY > mapUnitsPerPixelX)
{
dymin = mExtent.yMin();
dymax = mExtent.yMax();
- whitespace = ((myWidth * mMupp) - mExtent.width()) * 0.5;
+ whitespace = ((myWidth * mMapUnitsPerPixel) - mExtent.width()) * 0.5;
dxmin = mExtent.xMin() - whitespace;
dxmax = mExtent.xMax() + whitespace;
}
@@ -162,14 +162,14 @@
{
dxmin = mExtent.xMin();
dxmax = mExtent.xMax();
- whitespace = ((myHeight * mMupp) - mExtent.height()) * 0.5;
+ whitespace = ((myHeight * mMapUnitsPerPixel) - mExtent.height()) * 0.5;
dymin = mExtent.yMin() - whitespace;
dymax = mExtent.yMax() + whitespace;
}
#ifdef QGISDEBUG
QString myMessage = "+-------------------MapRenderer--------------------------------+\n";
- myMessage += QString("Map units per pixel (x,y) : %1, %2\n").arg(muppX).arg(muppY);
+ myMessage += QString("Map units per pixel (x,y) : %1, %2\n").arg(mapUnitsPerPixelX).arg(mapUnitsPerPixelY);
myMessage += QString("Pixmap dimensions (x,y) : %1, %2\n").arg(myWidth).arg(myHeight);
myMessage += QString("Extent dimensions (x,y) : %1, %2\n").arg(mExtent.width()).arg(mExtent.height());
myMessage += mExtent.toString();
@@ -191,7 +191,7 @@
QgsLogger::debug("Scale (assuming meters as map units) = 1", mScale, 1, __FILE__, __FUNCTION__, __LINE__);
#endif
- newCoordXForm.setParameters(mMupp, dxmin, dymin, myHeight);
+ newCoordXForm.setParameters(mMapUnitsPerPixel, dxmin, dymin, myHeight);
mRenderContext.setMapToPixel(newCoordXForm);
mRenderContext.setExtent(mExtent);
}
Modified: trunk/qgis/src/core/qgsmaprenderer.h
===================================================================
--- trunk/qgis/src/core/qgsmaprenderer.h 2008-08-23 14:06:01 UTC (rev 9133)
+++ trunk/qgis/src/core/qgsmaprenderer.h 2008-08-23 19:15:03 UTC (rev 9134)
@@ -65,7 +65,7 @@
/**Sets scale for scale based visibility. Normally, the scale is calculated automatically. This
function is only used to force a preview scale (e.g. for print composer)*/
void setScale(double scale) {mScale = scale;}
- double mupp() const { return mMupp; }
+ double mapUnitsPerPixel() const { return mMapUnitsPerPixel; }
int width() const { return mSize.width(); };
int height() const { return mSize.height(); };
@@ -172,7 +172,7 @@
bool mDrawing;
//! map units per pixel
- double mMupp;
+ double mMapUnitsPerPixel;
//! Map scale at its current zool level
double mScale;
Modified: trunk/qgis/src/core/qgsmaptopixel.cpp
===================================================================
--- trunk/qgis/src/core/qgsmaptopixel.cpp 2008-08-23 14:06:01 UTC (rev 9133)
+++ trunk/qgis/src/core/qgsmaptopixel.cpp 2008-08-23 19:15:03 UTC (rev 9134)
@@ -19,11 +19,11 @@
#include <QPoint>
#include <QTextStream>
-QgsMapToPixel::QgsMapToPixel(double mupp,
+QgsMapToPixel::QgsMapToPixel(double mapUnitsPerPixel,
double ymax,
double ymin,
double xmin)
- : mMapUnitsPerPixel(mupp),
+ : mMapUnitsPerPixel(mapUnitsPerPixel),
yMax(ymax),
yMin(ymin),
xMin(xmin),
@@ -53,9 +53,9 @@
return toMapPoint(x, y);
}
-void QgsMapToPixel::setMapUnitsPerPixel(double mupp)
+void QgsMapToPixel::setMapUnitsPerPixel(double mapUnitsPerPixel)
{
- mMapUnitsPerPixel = mupp;
+ mMapUnitsPerPixel = mapUnitsPerPixel;
}
double QgsMapToPixel::mapUnitsPerPixel() const
@@ -78,9 +78,9 @@
xMin = xmin;
}
-void QgsMapToPixel::setParameters(double mupp, double xmin, double ymin, double ymax)
+void QgsMapToPixel::setParameters(double mapUnitsPerPixel, double xmin, double ymin, double ymax)
{
- mMapUnitsPerPixel = mupp;
+ mMapUnitsPerPixel = mapUnitsPerPixel;
xMin = xmin;
yMin = ymin;
yMax = ymax;
Modified: trunk/qgis/src/core/qgsmaptopixel.h
===================================================================
--- trunk/qgis/src/core/qgsmaptopixel.h 2008-08-23 14:06:01 UTC (rev 9133)
+++ trunk/qgis/src/core/qgsmaptopixel.h 2008-08-23 19:15:03 UTC (rev 9134)
@@ -34,12 +34,12 @@
class CORE_EXPORT QgsMapToPixel{
public:
/* Constructor
- * @param mupp Map units per pixel
+ * @param mapUnitsPerPixel Map units per pixel
* @param ymax Maximum y value of the map canvas
* @param ymin Minimum y value of the map canvas
* @param xmin Minimum x value of the map canvas
*/
- QgsMapToPixel(double mupp=0, double ymax = 0, double ymin=0,
+ QgsMapToPixel(double mapUnitsPerPixel=0, double ymax = 0, double ymin=0,
double xmin = 0);
//! destructor
~QgsMapToPixel();
@@ -82,9 +82,9 @@
QgsPoint toMapPoint(int x, int y) const;
/*! Set map units per pixel
- * @param mupp Map units per pixel
+ * @param mapUnitsPerPixel Map units per pixel
*/
- void setMapUnitsPerPixel(double mupp);
+ void setMapUnitsPerPixel(double mapUnitsPerPixel);
//! Return current map units per pixel
double mapUnitsPerPixel() const;
@@ -96,12 +96,12 @@
//! set minimum x value
void setXMinimum(double xmin);
/*! Set parameters for use in tranfsorming coordinates
- * @param mupp Map units per pixel
+ * @param mapUnitsPerPixel Map units per pixel
* @param xmin Minimum x value
* @param ymin Minimum y value
* @param ymax Maximum y value
*/
- void setParameters(double mupp, double xmin, double ymin, double ymax);
+ void setParameters(double mapUnitsPerPixel, double xmin, double ymin, double ymax);
//! String representation of the parameters used in the transform
QString showParameters();
Modified: trunk/qgis/src/core/qgsproject.cpp
===================================================================
--- trunk/qgis/src/core/qgsproject.cpp 2008-08-23 14:06:01 UTC (rev 9133)
+++ trunk/qgis/src/core/qgsproject.cpp 2008-08-23 19:15:03 UTC (rev 9134)
@@ -411,7 +411,7 @@
- QString QgsProject::filename() const
+ QString QgsProject::setFilename() const
{
return imp_->file.fileName();
} // QString QgsProject::setFilename() const
Modified: trunk/qgis/src/core/qgsproject.h
===================================================================
--- trunk/qgis/src/core/qgsproject.h 2008-08-23 14:06:01 UTC (rev 9133)
+++ trunk/qgis/src/core/qgsproject.h 2008-08-23 19:15:03 UTC (rev 9134)
@@ -95,7 +95,7 @@
void setFilename( QString const & name );
/** returns file name */
- QString filename() const;
+ QString setFilename() const;
//@}
Modified: trunk/qgis/src/core/qgsvectorlayer.cpp
===================================================================
--- trunk/qgis/src/core/qgsvectorlayer.cpp 2008-08-23 14:06:01 UTC (rev 9133)
+++ trunk/qgis/src/core/qgsvectorlayer.cpp 2008-08-23 19:15:03 UTC (rev 9134)
@@ -762,7 +762,7 @@
// markerScalerFactore now reflects the actual scaling of the marker that the render performed.
//QgsDebugMsg(QString("markerScale after renderFeature(): %1").arg(markerScaleFactor));
- //double scale = renderContext.scaleFactor() / markerScaleFactor;
+ //double scale = rendererContext.scaleFactor() / markerScaleFactor;
drawFeature(
rendererContext.painter(),
fet,
Modified: trunk/qgis/src/gui/qgsmapcanvas.cpp
===================================================================
--- trunk/qgis/src/gui/qgsmapcanvas.cpp 2008-08-23 14:06:01 UTC (rev 9133)
+++ trunk/qgis/src/gui/qgsmapcanvas.cpp 2008-08-23 19:15:03 UTC (rev 9134)
@@ -1039,10 +1039,10 @@
-double QgsMapCanvas::mupp() const
+double QgsMapCanvas::mapUnitsPerPixel() const
{
- return mMapRenderer->mupp();
-} // mupp
+ return mMapRenderer->mapUnitsPerPixel();
+} // mapUnitsPerPixel
void QgsMapCanvas::setMapUnits(QGis::units u)
Modified: trunk/qgis/src/gui/qgsmapcanvas.h
===================================================================
--- trunk/qgis/src/gui/qgsmapcanvas.h 2008-08-23 14:06:01 UTC (rev 9133)
+++ trunk/qgis/src/gui/qgsmapcanvas.h 2008-08-23 19:15:03 UTC (rev 9134)
@@ -124,8 +124,8 @@
//! Clear the map canvas
void clear();
- //! Returns the mupp (map units per pixel) for the canvas
- double mupp() const;
+ //! Returns the mapUnitsPerPixel (map units per pixel) for the canvas
+ double mapUnitsPerPixel() const;
//! Returns the current zoom exent of the map canvas
QgsRect extent() const;
Modified: trunk/qgis/src/gui/qgsquickprint.cpp
===================================================================
--- trunk/qgis/src/gui/qgsquickprint.cpp 2008-08-23 14:06:01 UTC (rev 9133)
+++ trunk/qgis/src/gui/qgsquickprint.cpp 2008-08-23 19:15:03 UTC (rev 9134)
@@ -808,15 +808,15 @@
//Get map units per pixel. This can be negative at times (to do with
//projections) and that just confuses the rest of the code in this
//function, so force to a positive number.
- double myMuppDouble = std::abs(thepMapRenderer->mupp());
+ double myMapUnitsPerPixelDouble = std::abs(thepMapRenderer->mapUnitsPerPixel());
//
// Exit if the canvas width is 0 or layercount is 0 or QGIS will freeze
int myLayerCount=thepMapRenderer->layerSet().count();
- if (!myLayerCount || !myMuppDouble) return;
+ if (!myLayerCount || !myMapUnitsPerPixelDouble) return;
//Calculate size of scale bar for preferred number of map units
double myScaleBarWidth = myPreferredSize;
- myActualSize = myScaleBarWidth * myMuppDouble;
+ myActualSize = myScaleBarWidth * myMapUnitsPerPixelDouble;
// Work out the exponent for the number - e.g, 1234 will give 3,
@@ -828,7 +828,7 @@
{
double scaler = pow(10.0, myPowerOf10);
myActualSize = round(myActualSize / scaler) * scaler;
- myScaleBarWidth = myActualSize / myMuppDouble;
+ myScaleBarWidth = myActualSize / myMapUnitsPerPixelDouble;
}
//Get type of map units and set scale bar unit label text
Modified: trunk/qgis/src/plugins/georeferencer/qgspointdialog.cpp
===================================================================
--- trunk/qgis/src/plugins/georeferencer/qgspointdialog.cpp 2008-08-23 14:06:01 UTC (rev 9133)
+++ trunk/qgis/src/plugins/georeferencer/qgspointdialog.cpp 2008-08-23 19:15:03 UTC (rev 9134)
@@ -409,7 +409,7 @@
{
std::vector<QgsGeorefDataPoint*>::iterator it = mPoints.begin();
- double maxDistSqr = (5 * mCanvas->mupp())*(5 * mCanvas->mupp());
+ double maxDistSqr = (5 * mCanvas->mapUnitsPerPixel())*(5 * mCanvas->mapUnitsPerPixel());
#ifdef QGISDEBUG
std::cout << "deleteDataPoint! maxDistSqr: " << maxDistSqr << std::endl;
#endif
Modified: trunk/qgis/src/plugins/scale_bar/plugin.cpp
===================================================================
--- trunk/qgis/src/plugins/scale_bar/plugin.cpp 2008-08-23 14:06:01 UTC (rev 9133)
+++ trunk/qgis/src/plugins/scale_bar/plugin.cpp 2008-08-23 19:15:03 UTC (rev 9134)
@@ -186,11 +186,11 @@
//Get map units per pixel. This can be negative at times (to do with
//projections) and that just confuses the rest of the code in this
//function, so force to a positive number.
- double myMuppDouble = std::abs(qGisInterface->getMapCanvas()->mupp());
+ double myMapUnitsPerPixelDouble = std::abs(qGisInterface->getMapCanvas()->mapUnitsPerPixel());
// Exit if the canvas width is 0 or layercount is 0 or QGIS will freeze
int myLayerCount=qGisInterface->getMapCanvas()->layerCount();
- if (!myLayerCount || !myCanvasWidth || !myMuppDouble) return;
+ if (!myLayerCount || !myCanvasWidth || !myMapUnitsPerPixelDouble) return;
//Large if statement which determines whether to render the scale bar
if (mEnabled)
@@ -202,13 +202,13 @@
int myMargin=20;
//Calculate size of scale bar for preferred number of map units
- double myScaleBarWidth = mPreferredSize / myMuppDouble;
+ double myScaleBarWidth = mPreferredSize / myMapUnitsPerPixelDouble;
//If scale bar is very small reset to 1/4 of the canvas wide
if (myScaleBarWidth < 30)
{
myScaleBarWidth = myCanvasWidth / 4; // pixels
- myActualSize = myScaleBarWidth * myMuppDouble; // map units
+ myActualSize = myScaleBarWidth * myMapUnitsPerPixelDouble; // map units
};
//if scale bar is more than half the canvas wide keep halving until not
@@ -216,7 +216,7 @@
{
myScaleBarWidth = myScaleBarWidth /3;
};
- myActualSize = myScaleBarWidth * myMuppDouble;
+ myActualSize = myScaleBarWidth * myMapUnitsPerPixelDouble;
// Work out the exponent for the number - e.g, 1234 will give 3,
// and .001234 will give -3
@@ -227,7 +227,7 @@
{
double scaler = pow(10.0, myPowerOf10);
myActualSize = round(myActualSize / scaler) * scaler;
- myScaleBarWidth = myActualSize / myMuppDouble;
+ myScaleBarWidth = myActualSize / myMapUnitsPerPixelDouble;
}
//Get type of map units and set scale bar unit label text
Modified: trunk/qgis/tests/algorithms/qgsproject/projecttest.h
===================================================================
--- trunk/qgis/tests/algorithms/qgsproject/projecttest.h 2008-08-23 14:06:01 UTC (rev 9133)
+++ trunk/qgis/tests/algorithms/qgsproject/projecttest.h 2008-08-23 19:15:03 UTC (rev 9134)
@@ -103,7 +103,7 @@
QgsProject::instance()->dirty( false );
QgsProject::instance()->setFilename( mFile );
- CPPUNIT_ASSERT( mFile == QgsProject::instance()->filename() );
+ CPPUNIT_ASSERT( mFile == QgsProject::instance()->setFilename() );
CPPUNIT_ASSERT( QgsProject::instance()->isDirty() );
} // testFileName
More information about the QGIS-commit
mailing list