Skip to content
Permalink
Browse files
Fix typo in raster enum for MultiBandsingleBandGray and kept old enum…
… with identical value for backwards compatibility

git-svn-id: http://svn.osgeo.org/qgis/trunk/qgis@14042 c8812cc2-4d05-0410-92ff-de0c093fc19c
  • Loading branch information
timlinux committed Aug 10, 2010
1 parent ab2a7a8 commit 8f45a0857becc9871479dae171967acbb46fc81c
Showing with 21 additions and 19 deletions.
  1. +1 −1 python/core/qgsrasterlayer.sip
  2. +1 −1 src/app/legend/qgslegend.cpp
  3. +4 −4 src/app/qgsrasterlayerproperties.cpp
  4. +12 −12 src/core/raster/qgsrasterlayer.cpp
  5. +3 −1 src/core/raster/qgsrasterlayer.h
@@ -72,7 +72,7 @@ public:
PalettedSingleBandGray, // a "Palette" layer drawn in gray scale
PalettedSingleBandPseudoColor, // a "Palette" layerdrawn using a pseudocolor algorithm
PalettedMultiBandColor, // currently not supported
MultiBandSingleGandGray, // a layer containing 2 or more bands, but a single band drawn as a range of gray colors
MultiBandSingleBandGray, // a layer containing 2 or more bands, but a single band drawn as a range of gray colors
MultiBandSingleBandPseudoColor, //a layer containing 2 or more bands, but a single band drawn using a pseudocolor algorithm
MultiBandColor //a layer containing 2 or more bands, mapped to RGB color space.
//In the case of a multiband with only two bands, one band will be mapped to more than one color.
@@ -1640,7 +1640,7 @@ void QgsLegend::legendLayerStretchUsingCurrentExtent()
}
else if ( layer->drawingStyle() == QgsRasterLayer::MultiBandSingleBandPseudoColor )
{
layer->setDrawingStyle( QgsRasterLayer::MultiBandSingleGandGray );
layer->setDrawingStyle( QgsRasterLayer::MultiBandSingleBandGray );
}

if ( layer->contrastEnhancementAlgorithmAsString() == "NoEnhancement" )
@@ -532,7 +532,7 @@ void QgsRasterLayerProperties::sync()
cboxContrastEnhancementAlgorithm->setEnabled( false );
labelContrastEnhancement->setEnabled( false );
break;
case QgsRasterLayer::MultiBandSingleGandGray:
case QgsRasterLayer::MultiBandSingleBandGray:
rbtnThreeBand->setEnabled( true );
rbtnSingleBand->setEnabled( true );
rbtnSingleBand->setChecked( true );
@@ -1049,11 +1049,11 @@ void QgsRasterLayerProperties::apply()
}
else
{
QgsDebugMsg( "Setting Raster Drawing Style to :: MultiBandSingleGandGray" );
QgsDebugMsg( "Setting Raster Drawing Style to :: MultiBandSingleBandGray" );
QgsDebugMsg( QString( "Combo value : %1 GrayBand Mapping : %2" ).arg( cboGray->currentText() ).arg( mRasterLayer->
grayBandName() ) );

mRasterLayer->setDrawingStyle( QgsRasterLayer::MultiBandSingleGandGray );
mRasterLayer->setDrawingStyle( QgsRasterLayer::MultiBandSingleBandGray );

}
}
@@ -2886,7 +2886,7 @@ void QgsRasterLayerProperties::on_pbtnLoadColorMapFromFile_clicked()

void QgsRasterLayerProperties::on_pbtnLoadMinMax_clicked()
{
if ( mRasterLayerIsGdal && ( mRasterLayer->drawingStyle() == QgsRasterLayer::SingleBandGray || mRasterLayer->drawingStyle() == QgsRasterLayer::MultiBandSingleGandGray || mRasterLayer->drawingStyle() == QgsRasterLayer::MultiBandColor ) )
if ( mRasterLayerIsGdal && ( mRasterLayer->drawingStyle() == QgsRasterLayer::SingleBandGray || mRasterLayer->drawingStyle() == QgsRasterLayer::MultiBandSingleBandGray || mRasterLayer->drawingStyle() == QgsRasterLayer::MultiBandColor ) )
{
QgsRasterBandStats myRasterBandStats;
double myMinimumMaximum[2];
@@ -1766,12 +1766,12 @@ void QgsRasterLayer::draw( QPainter * theQPainter,
theQgsMapToPixel, 1 );
break;
// a layer containing 2 or more bands, but using only one band to produce a grayscale image
case MultiBandSingleGandGray:
QgsDebugMsg( "MultiBandSingleGandGray drawing type detected..." );
case MultiBandSingleBandGray:
QgsDebugMsg( "MultiBandSingleBandGray drawing type detected..." );
//check the band is set!
if ( mGrayBandName == TRSTRING_NOT_SET )
{
QgsDebugMsg( "MultiBandSingleGandGray Not Set detected..." + mGrayBandName );
QgsDebugMsg( "MultiBandSingleBandGray Not Set detected..." + mGrayBandName );
break;
}
else
@@ -1842,8 +1842,8 @@ QString QgsRasterLayer::drawingStyleAsString() const
case PalettedMultiBandColor:
return QString( "PalettedMultiBandColor" );//no need to tr() this its not shown in ui
break;
case MultiBandSingleGandGray:
return QString( "MultiBandSingleGandGray" );//no need to tr() this its not shown in ui
case MultiBandSingleBandGray:
return QString( "MultiBandSingleBandGray" );//no need to tr() this its not shown in ui
break;
case MultiBandSingleBandPseudoColor:
return QString( "MultiBandSingleBandPseudoColor" );//no need to tr() this its not shown in ui
@@ -2078,7 +2078,7 @@ QPixmap QgsRasterLayer::legendAsPixmap( bool theWithNameFlag )
//
// Create the legend pixmap - note it is generated on the preadjusted stats
//
if ( mDrawingStyle == MultiBandSingleGandGray || mDrawingStyle == PalettedSingleBandGray || mDrawingStyle == SingleBandGray )
if ( mDrawingStyle == MultiBandSingleBandGray || mDrawingStyle == PalettedSingleBandGray || mDrawingStyle == SingleBandGray )
{

myLegendQPixmap = QPixmap( 100, 1 );
@@ -2284,7 +2284,7 @@ QPixmap QgsRasterLayer::legendAsPixmap( bool theWithNameFlag )
//
// Overlay the layer name
//
if ( mDrawingStyle == MultiBandSingleGandGray || mDrawingStyle == PalettedSingleBandGray || mDrawingStyle == SingleBandGray )
if ( mDrawingStyle == MultiBandSingleBandGray || mDrawingStyle == PalettedSingleBandGray || mDrawingStyle == SingleBandGray )
{
myQPainter.setPen( Qt::white );
}
@@ -2333,7 +2333,7 @@ QPixmap QgsRasterLayer::legendAsPixmap( int theLabelCount )
//
// Create the legend pixmap - note it is generated on the preadjusted stats
//
if ( mDrawingStyle == MultiBandSingleGandGray || mDrawingStyle == PalettedSingleBandGray || mDrawingStyle == SingleBandGray )
if ( mDrawingStyle == MultiBandSingleBandGray || mDrawingStyle == PalettedSingleBandGray || mDrawingStyle == SingleBandGray )
{

myLegendQPixmap = QPixmap( 1, myImageHeight );
@@ -2516,7 +2516,7 @@ QPixmap QgsRasterLayer::legendAsPixmap( int theLabelCount )
//
// Overlay the layer name
//
if ( mDrawingStyle == MultiBandSingleGandGray || mDrawingStyle == PalettedSingleBandGray || mDrawingStyle == SingleBandGray )
if ( mDrawingStyle == MultiBandSingleBandGray || mDrawingStyle == PalettedSingleBandGray || mDrawingStyle == SingleBandGray )
{
myQPainter2.setPen( Qt::white );
}
@@ -3434,9 +3434,9 @@ void QgsRasterLayer::setDrawingStyle( QString const & theDrawingStyleQString )
{
mDrawingStyle = PalettedMultiBandColor;
}
else if ( theDrawingStyleQString == "MultiBandSingleGandGray" )//no need to tr() this its not shown in ui
else if ( theDrawingStyleQString == "MultiBandSingleBandGray" )//no need to tr() this its not shown in ui
{
mDrawingStyle = MultiBandSingleGandGray;
mDrawingStyle = MultiBandSingleBandGray;
}
else if ( theDrawingStyleQString == "MultiBandSingleBandPseudoColor" )//no need to tr() this its not shown in ui
{
@@ -3493,7 +3493,7 @@ void QgsRasterLayer::setMaximumValue( QString theBand, double theValue, bool the
void QgsRasterLayer::setMinimumMaximumUsingLastExtent()
{
double myMinMax[2];
if ( rasterType() == QgsRasterLayer::GrayOrUndefined || drawingStyle() == QgsRasterLayer::SingleBandGray || drawingStyle() == QgsRasterLayer::MultiBandSingleGandGray )
if ( rasterType() == QgsRasterLayer::GrayOrUndefined || drawingStyle() == QgsRasterLayer::SingleBandGray || drawingStyle() == QgsRasterLayer::MultiBandSingleBandGray )
{
computeMinimumMaximumFromLastExtent( grayBandName(), myMinMax );
setMinimumValue( grayBandName(), myMinMax[0] );
@@ -83,7 +83,7 @@ class QLibrary;
* PalettedSingleBandGray -> a PaletteD layer drawn in gray scale (using only one of the color components)
* PalettedSingleBandPseudoColor -> a PaletteD layer having only one of its color components rendered as psuedo color
* PalettedMultiBandColor -> a PaletteD image where the bands contains 24bit color info and 8 bits is pulled out per color
* MultiBandSingleGandGray -> a layer containing 2 or more bands, but using only one band to produce a grayscale image
* MultiBandSingleBandGray -> a layer containing 2 or more bands, but using only one band to produce a grayscale image
* MultiBandSingleBandPseudoColor -> a layer containing 2 or more bands, but using only one band to produce a pseudocolor image
* MultiBandColor -> a layer containing 2 or more bands, mapped to the three RGBcolors. In the case of a multiband with only two bands, one band will have to be mapped to more than one color
*
@@ -239,6 +239,8 @@ class CORE_EXPORT QgsRasterLayer : public QgsMapLayer
PalettedSingleBandPseudoColor, // a "Palette" layerdrawn using a pseudocolor algorithm
PalettedMultiBandColor, // currently not supported
MultiBandSingleGandGray, // a layer containing 2 or more bands, but a single band drawn as a range of gray colors
//added in 1.6 to fix naming glitch
MultiBandSingleBandGray=MultiBandSingleGandGray, // a layer containing 2 or more bands, but a single band drawn as a range of gray colors
MultiBandSingleBandPseudoColor, //a layer containing 2 or more bands, but a single band drawn using a pseudocolor algorithm
MultiBandColor //a layer containing 2 or more bands, mapped to RGB color space.
//In the case of a multiband with only two bands, one band will be mapped to more than one color.

0 comments on commit 8f45a08

Please sign in to comment.