[QGIS Commit] r8549 -
branches/advanced_printing_branch/src/app/composer
svn_qgis at osgeo.org
svn_qgis at osgeo.org
Fri May 30 11:48:52 EDT 2008
Author: mhugent
Date: 2008-05-30 11:48:52 -0400 (Fri, 30 May 2008)
New Revision: 8549
Modified:
branches/advanced_printing_branch/src/app/composer/qgscomposermap.cpp
branches/advanced_printing_branch/src/app/composer/qgscomposermap.h
Log:
More cleanups in composer map
Modified: branches/advanced_printing_branch/src/app/composer/qgscomposermap.cpp
===================================================================
--- branches/advanced_printing_branch/src/app/composer/qgscomposermap.cpp 2008-05-30 15:46:41 UTC (rev 8548)
+++ branches/advanced_printing_branch/src/app/composer/qgscomposermap.cpp 2008-05-30 15:48:52 UTC (rev 8549)
@@ -227,56 +227,12 @@
mDrawing = false;
}
-double QgsComposerMap::scaleFromUserScale ( double us )
-{
- double s=0;
-
- switch ( mComposition->mapCanvas()->mapUnits() ) {
- case QGis::METERS :
- s = 1000. * mComposition->scale() / us;
- break;
- case QGis::FEET :
- s = 304.8 * mComposition->scale() / us;
- break;
- case QGis::UNKNOWN :
- case QGis::DEGREES :
- s = mComposition->scale() / us;
- break;
- }
- return s;
-}
-
-double QgsComposerMap::userScaleFromScale ( double s )
-{
- double us=0;
-
- switch ( mComposition->mapCanvas()->mapUnits() ) {
- case QGis::METERS :
- us = 1000. * mComposition->scale() / s;
- break;
- case QGis::FEET :
- us = 304.8 * mComposition->scale() / s;
- break;
- case QGis::DEGREES :
- case QGis::UNKNOWN :
- us = mComposition->scale() / s;
- break;
- }
-
- return us;
-}
-
-
void QgsComposerMap::mapCanvasChanged ( void )
{
mCacheUpdated = false;
QGraphicsRectItem::update();
}
-
-
-
-
bool QgsComposerMap::selected( void )
{
return mSelected;
@@ -324,14 +280,7 @@
} else {
QgsProject::instance()->writeEntry( "Compositions", path+"calculate", QString("extent") );
}
-
- QgsProject::instance()->writeEntry( "Compositions", path+"north", mUserExtent.yMax() );
- QgsProject::instance()->writeEntry( "Compositions", path+"south", mUserExtent.yMin() );
- QgsProject::instance()->writeEntry( "Compositions", path+"east", mUserExtent.xMax() );
- QgsProject::instance()->writeEntry( "Compositions", path+"west", mUserExtent.xMin() );
- QgsProject::instance()->writeEntry( "Compositions", path+"scale", mUserScale );
-
QgsProject::instance()->writeEntry( "Compositions", path+"frame", mFrame );
QgsProject::instance()->writeEntry( "Compositions", path+"previewmode", mPreviewMode );
@@ -360,14 +309,6 @@
{
mCalculate = Scale;
}
-
- mUserExtent.setYmax ( QgsProject::instance()->readDoubleEntry( "Compositions", path+"north", 100, &ok) );
- mUserExtent.setYmin ( QgsProject::instance()->readDoubleEntry( "Compositions", path+"south", 0, &ok) );
- mUserExtent.setXmax ( QgsProject::instance()->readDoubleEntry( "Compositions", path+"east", 100, &ok) );
- mUserExtent.setXmin ( QgsProject::instance()->readDoubleEntry( "Compositions", path+"west", 0, &ok) );
-
- mUserScale = QgsProject::instance()->readDoubleEntry( "Compositions", path+"scale", 1000., &ok);
- mScale = scaleFromUserScale ( mUserScale );
mFrame = QgsProject::instance()->readBoolEntry("Compositions", path+"frame", true, &ok);
Modified: branches/advanced_printing_branch/src/app/composer/qgscomposermap.h
===================================================================
--- branches/advanced_printing_branch/src/app/composer/qgscomposermap.h 2008-05-30 15:46:41 UTC (rev 8548)
+++ branches/advanced_printing_branch/src/app/composer/qgscomposermap.h 2008-05-30 15:48:52 UTC (rev 8549)
@@ -141,9 +141,6 @@
/** \brief Map name, used in legend combobox etc. */
QString mName;
- // Map region in map units specified by user
- QgsRect mUserExtent;
-
// Map region in map units realy used for rendering
// It can be the same as mUserExtent, but it can be bigger in on dimension if mCalculate==Scale,
// so that full rectangle in paper is used.
@@ -152,10 +149,6 @@
// Cache extent (it can be bigger for example than mExtent)
QgsRect mCacheExtent;
- // Size of of the map rectangle in the composition in paper units
- //double mWidth;
- //double mHeight;
-
// Number of paper units in map per paper unit on paper, this is the xxx part of 1:xxx
double mUserScale;
@@ -189,12 +182,6 @@
/**Store last scale factor to avoid unnecessary repaints in case preview mode is 'Render'*/
double mLastScaleFactorX;
- /** \brief calculate mScale from mUserScale */
- double scaleFromUserScale ( double us );
-
- /** \brief calculate mUserScale from mScale */
- double userScaleFromScale ( double s );
-
/**Sets new Extent and changes only width and height*/
void setNewExtent(const QgsRect& extent);
/**Sets new scale and changes only mExtent*/
More information about the QGIS-commit
mailing list