[QGIS Commit] r9179 - in trunk/qgis/src: app core/composer
core/raster plugins/dxf2shp_converter plugins/interpolation
plugins/spit
svn_qgis at osgeo.org
svn_qgis at osgeo.org
Wed Aug 27 03:28:12 EDT 2008
Author: jef
Date: 2008-08-27 03:28:12 -0400 (Wed, 27 Aug 2008)
New Revision: 9179
Modified:
trunk/qgis/src/app/qgsrasterlayerproperties.cpp
trunk/qgis/src/core/composer/qgscomposermap.cpp
trunk/qgis/src/core/composer/qgsnumericscalebarstyle.cpp
trunk/qgis/src/core/raster/qgsrasterlayer.cpp
trunk/qgis/src/plugins/dxf2shp_converter/builder.cpp
trunk/qgis/src/plugins/interpolation/DualEdgeTriangulation.cc
trunk/qgis/src/plugins/spit/qgsshapefile.cpp
Log:
minor updates (indentation, debug output)
Modified: trunk/qgis/src/app/qgsrasterlayerproperties.cpp
===================================================================
--- trunk/qgis/src/app/qgsrasterlayerproperties.cpp 2008-08-26 21:08:57 UTC (rev 9178)
+++ trunk/qgis/src/app/qgsrasterlayerproperties.cpp 2008-08-27 07:28:12 UTC (rev 9179)
@@ -135,7 +135,7 @@
//setup custom colormap tab
cboxColorInterpolation->addItem( tr( "Discrete" ) );
cboxColorInterpolation->addItem( tr( "Linear" ) );
- cboxColorInterpolation->addItem( tr( "Exact") );
+ cboxColorInterpolation->addItem( tr( "Exact" ) );
cboxClassificationMode->addItem( tr( "Equal interval" ) );
//cboxClassificationMode->addItem( tr( "Quantiles" ) );
@@ -294,7 +294,7 @@
pbtnExportColorMapToFile->setIcon( QgisApp::getThemeIcon( "/mActionFileSave.png" ) );
pbtnLoadColorMapFromFile->setIcon( QgisApp::getThemeIcon( "/mActionFileOpen.png" ) );
-
+
// Only do pyramids if dealing directly with GDAL.
if ( mRasterLayerIsGdal )
{
@@ -2587,10 +2587,12 @@
currentValue += intervalDiff;
}
}
- //else if ( cboxClassificationMode->currentText() == tr( "Quantiles" ) )
- //{
+#if 0
+ else if ( cboxClassificationMode->currentText() == tr( "Quantiles" ) )
+ {
//todo
- //}
+ }
+#endif
//hard code color range from blue -> red for now. Allow choice of ramps in future
int colorDiff = 0;
@@ -2677,7 +2679,7 @@
{
myOutputStream << "EXACT\n";
}
-
+
int myTopLevelItemCount = mColormapTreeWidget->topLevelItemCount();
QTreeWidgetItem* myCurrentItem;
QColor myColor;
@@ -2691,9 +2693,9 @@
myColor = myCurrentItem->background( 1 ).color();
myOutputStream << myCurrentItem->text( 0 ).toDouble() << ",";
myOutputStream << myColor.red() << "," << myColor.green() << "," << myColor.blue() << "," << myColor.alpha() << ",";
- if(myCurrentItem->text(2) == "")
+ if ( myCurrentItem->text( 2 ) == "" )
{
- myOutputStream << "Color entry " << i+1 << "\n";
+ myOutputStream << "Color entry " << i + 1 << "\n";
}
else
{
@@ -2721,11 +2723,11 @@
{
//clear the current tree
mColormapTreeWidget->clear();
-
+
QTextStream myInputStream( &myInputFile );
QString myInputLine;
QStringList myInputStringComponents;
-
+
//read through the input looking for valid data
while ( !myInputStream.atEnd() )
{
@@ -2735,16 +2737,16 @@
{
if ( !myInputLine.simplified().startsWith( "#" ) )
{
- if(myInputLine.contains("INTERPOLATION", Qt::CaseInsensitive))
+ if ( myInputLine.contains( "INTERPOLATION", Qt::CaseInsensitive ) )
{
- myInputStringComponents = myInputLine.split(":");
- if(myInputStringComponents.size() == 2)
+ myInputStringComponents = myInputLine.split( ":" );
+ if ( myInputStringComponents.size() == 2 )
{
- if(myInputStringComponents[1].trimmed().toUpper().compare ("INTERPOLATED", Qt::CaseInsensitive) == 0)
+ if ( myInputStringComponents[1].trimmed().toUpper().compare( "INTERPOLATED", Qt::CaseInsensitive ) == 0 )
{
cboxColorInterpolation->setCurrentIndex( cboxColorInterpolation->findText( tr( "Linear" ) ) );
}
- else if(myInputStringComponents[1].trimmed().toUpper().compare ("DISCRETE", Qt::CaseInsensitive) == 0)
+ else if ( myInputStringComponents[1].trimmed().toUpper().compare( "DISCRETE", Qt::CaseInsensitive ) == 0 )
{
cboxColorInterpolation->setCurrentIndex( cboxColorInterpolation->findText( tr( "Discrete" ) ) );
}
@@ -2761,12 +2763,12 @@
}
else
{
- myInputStringComponents = myInputLine.split(",");
- if(myInputStringComponents.size() == 6)
+ myInputStringComponents = myInputLine.split( "," );
+ if ( myInputStringComponents.size() == 6 )
{
QTreeWidgetItem* newItem = new QTreeWidgetItem( mColormapTreeWidget );
newItem->setText( 0, myInputStringComponents[0] );
- newItem->setBackground( 1, QBrush( QColor::fromRgb(myInputStringComponents[1].toInt(), myInputStringComponents[2].toInt(), myInputStringComponents[3].toInt(), myInputStringComponents[4].toInt()) ) );
+ newItem->setBackground( 1, QBrush( QColor::fromRgb( myInputStringComponents[1].toInt(), myInputStringComponents[2].toInt(), myInputStringComponents[3].toInt(), myInputStringComponents[4].toInt() ) ) );
newItem->setText( 2, myInputStringComponents[5] );
}
else
@@ -2779,8 +2781,8 @@
}
myLineCounter++;
}
-
+
if ( myImportError )
{
QMessageBox::warning( this, tr( "Import Error" ), tr( "The following lines contained errors\n\n" ) + myBadLines );
Modified: trunk/qgis/src/core/composer/qgscomposermap.cpp
===================================================================
--- trunk/qgis/src/core/composer/qgscomposermap.cpp 2008-08-26 21:08:57 UTC (rev 9178)
+++ trunk/qgis/src/core/composer/qgscomposermap.cpp 2008-08-27 07:28:12 UTC (rev 9179)
@@ -252,23 +252,23 @@
void QgsComposerMap::moveContent( double dx, double dy )
{
- if(!mDrawing)
- {
- QRectF itemRect = rect();
- double xRatio = dx / itemRect.width();
- double yRatio = dy / itemRect.height();
-
- double xMoveMapCoord = mExtent.width() * xRatio;
- double yMoveMapCoord = -( mExtent.height() * yRatio );
-
- mExtent.setXMinimum( mExtent.xMin() + xMoveMapCoord );
- mExtent.setXMaximum( mExtent.xMax() + xMoveMapCoord );
- mExtent.setYMinimum( mExtent.yMin() + yMoveMapCoord );
- mExtent.setYMaximum( mExtent.yMax() + yMoveMapCoord );
- emit extentChanged();
- cache();
- update();
- }
+ if ( !mDrawing )
+ {
+ QRectF itemRect = rect();
+ double xRatio = dx / itemRect.width();
+ double yRatio = dy / itemRect.height();
+
+ double xMoveMapCoord = mExtent.width() * xRatio;
+ double yMoveMapCoord = -( mExtent.height() * yRatio );
+
+ mExtent.setXMinimum( mExtent.xMin() + xMoveMapCoord );
+ mExtent.setXMaximum( mExtent.xMax() + xMoveMapCoord );
+ mExtent.setYMinimum( mExtent.yMin() + yMoveMapCoord );
+ mExtent.setYMaximum( mExtent.yMax() + yMoveMapCoord );
+ emit extentChanged();
+ cache();
+ update();
+ }
}
void QgsComposerMap::setSceneRect( const QRectF& rectangle )
Modified: trunk/qgis/src/core/composer/qgsnumericscalebarstyle.cpp
===================================================================
--- trunk/qgis/src/core/composer/qgsnumericscalebarstyle.cpp 2008-08-26 21:08:57 UTC (rev 9178)
+++ trunk/qgis/src/core/composer/qgsnumericscalebarstyle.cpp 2008-08-27 07:28:12 UTC (rev 9179)
@@ -80,7 +80,7 @@
if ( composerMap )
{
double scaleDenominator = composerMap->scale();
- scaleBarText = "1:" + QString::number(scaleDenominator, 'f', 0);
+ scaleBarText = "1:" + QString::number( scaleDenominator, 'f', 0 );
}
}
return scaleBarText;
Modified: trunk/qgis/src/core/raster/qgsrasterlayer.cpp
===================================================================
--- trunk/qgis/src/core/raster/qgsrasterlayer.cpp 2008-08-26 21:08:57 UTC (rev 9178)
+++ trunk/qgis/src/core/raster/qgsrasterlayer.cpp 2008-08-27 07:28:12 UTC (rev 9179)
@@ -1773,7 +1773,7 @@
continue;
}
- if ( !mRasterShader->generateShadedValue(myPixelValue, &myRedValue, &myGreenValue, &myBlueValue ) )
+ if ( !mRasterShader->generateShadedValue( myPixelValue, &myRedValue, &myGreenValue, &myBlueValue ) )
{
continue;
}
Modified: trunk/qgis/src/plugins/dxf2shp_converter/builder.cpp
===================================================================
--- trunk/qgis/src/plugins/dxf2shp_converter/builder.cpp 2008-08-26 21:08:57 UTC (rev 9178)
+++ trunk/qgis/src/plugins/dxf2shp_converter/builder.cpp 2008-08-27 07:28:12 UTC (rev 9179)
@@ -512,7 +512,7 @@
int dim = shpObjects.size();
int dimTexts = textObjects.size();
- QgsDebugMsg( QString( "Number pf primitives: %1" ).arg( dim ) );
+ QgsDebugMsg( QString( "Number of primitives: %1" ).arg( dim ) );
QgsDebugMsg( QString( "Number of text fields: %1" ).arg( dimTexts ) );
SHPHandle hSHP;
Modified: trunk/qgis/src/plugins/interpolation/DualEdgeTriangulation.cc
===================================================================
--- trunk/qgis/src/plugins/interpolation/DualEdgeTriangulation.cc 2008-08-26 21:08:57 UTC (rev 9178)
+++ trunk/qgis/src/plugins/interpolation/DualEdgeTriangulation.cc 2008-08-27 07:28:12 UTC (rev 9179)
@@ -105,7 +105,7 @@
{
if ( p )
{
-// QgsDebugMsg( QString("inserting point %1,%2//%3//").arg(mPointVector.count()).arg(p->getX()).arg(p->getY()));
+// QgsDebugMsg( QString("inserting point %1,%2//%3//%4").arg(mPointVector.count()).arg(p->getX()).arg(p->getY()).arg(p->getZ()));
//first update the bounding box
if ( mPointVector.count() == 0 )//update bounding box when the first point is inserted
Modified: trunk/qgis/src/plugins/spit/qgsshapefile.cpp
===================================================================
--- trunk/qgis/src/plugins/spit/qgsshapefile.cpp 2008-08-26 21:08:57 UTC (rev 9178)
+++ trunk/qgis/src/plugins/spit/qgsshapefile.cpp 2008-08-27 07:28:12 UTC (rev 9179)
@@ -414,7 +414,7 @@
OGR_G_SetCoordinateDimension( geom, 2 );
OGR_G_ExportToWkt( geom, &geo_temp );
QString geometry( geo_temp );
- CPLFree(geo_temp);
+ CPLFree( geo_temp );
for ( uint n = 0; n < column_types.size(); n++ )
{
More information about the QGIS-commit
mailing list