Skip to content
Permalink
Browse files
minor updates (indentation, debug output)
git-svn-id: http://svn.osgeo.org/qgis/trunk@9179 c8812cc2-4d05-0410-92ff-de0c093fc19c
  • Loading branch information
jef committed Aug 27, 2008
1 parent 5aef684 commit 17975208062daa462cb1c475120ed9355aab15ee
@@ -135,7 +135,7 @@ QgsRasterLayerProperties::QgsRasterLayerProperties( QgsMapLayer *lyr, QWidget *p
//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 @@ QgsRasterLayerProperties::QgsRasterLayerProperties( QgsMapLayer *lyr, QWidget *p

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 @@ void QgsRasterLayerProperties::on_mClassifyButton_clicked()
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 @@ void QgsRasterLayerProperties::on_pbtnExportColorMapToFile_clicked()
{
myOutputStream << "EXACT\n";
}

int myTopLevelItemCount = mColormapTreeWidget->topLevelItemCount();
QTreeWidgetItem* myCurrentItem;
QColor myColor;
@@ -2691,9 +2693,9 @@ void QgsRasterLayerProperties::on_pbtnExportColorMapToFile_clicked()
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 @@ void QgsRasterLayerProperties::on_pbtnLoadColorMapFromFile_clicked()
{
//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 @@ void QgsRasterLayerProperties::on_pbtnLoadColorMapFromFile_clicked()
{
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 @@ void QgsRasterLayerProperties::on_pbtnLoadColorMapFromFile_clicked()
}
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,7 +2781,7 @@ void QgsRasterLayerProperties::on_pbtnLoadColorMapFromFile_clicked()
}
myLineCounter++;
}


if ( myImportError )
{
@@ -252,23 +252,23 @@ void QgsComposerMap::resize( double dx, double dy )

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 )
@@ -80,7 +80,7 @@ QString QgsNumericScaleBarStyle::scaleText() const
if ( composerMap )
{
double scaleDenominator = composerMap->scale();
scaleBarText = "1:" + QString::number(scaleDenominator, 'f', 0);
scaleBarText = "1:" + QString::number( scaleDenominator, 'f', 0 );
}
}
return scaleBarText;
@@ -1773,7 +1773,7 @@ void QgsRasterLayer::drawPalettedSingleBandPseudoColor( QPainter * theQPainter,
continue;
}

if ( !mRasterShader->generateShadedValue(myPixelValue, &myRedValue, &myGreenValue, &myBlueValue ) )
if ( !mRasterShader->generateShadedValue( myPixelValue, &myRedValue, &myGreenValue, &myBlueValue ) )
{
continue;
}
@@ -512,7 +512,7 @@ void Builder::print_shpObjects()
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;
@@ -105,7 +105,7 @@ int DualEdgeTriangulation::addPoint( Point3D* p )
{
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
@@ -414,7 +414,7 @@ bool QgsShapeFile::insertLayer( QString dbname, QString schema, QString primary_
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++ )
{

0 comments on commit 1797520

Please sign in to comment.