[QGIS Commit] r14042 - in trunk/qgis: python/core src/app src/app/legend src/core/raster

svn_qgis at osgeo.org svn_qgis at osgeo.org
Tue Aug 10 12:02:27 EDT 2010


Author: timlinux
Date: 2010-08-10 16:02:27 +0000 (Tue, 10 Aug 2010)
New Revision: 14042

Modified:
   trunk/qgis/python/core/qgsrasterlayer.sip
   trunk/qgis/src/app/legend/qgslegend.cpp
   trunk/qgis/src/app/qgsrasterlayerproperties.cpp
   trunk/qgis/src/core/raster/qgsrasterlayer.cpp
   trunk/qgis/src/core/raster/qgsrasterlayer.h
Log:
Fix typo in raster enum for MultiBandsingleBandGray and kept old enum with identical value for backwards compatibility

Modified: trunk/qgis/python/core/qgsrasterlayer.sip
===================================================================
--- trunk/qgis/python/core/qgsrasterlayer.sip	2010-08-10 10:16:00 UTC (rev 14041)
+++ trunk/qgis/python/core/qgsrasterlayer.sip	2010-08-10 16:02:27 UTC (rev 14042)
@@ -72,7 +72,7 @@
       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.

Modified: trunk/qgis/src/app/legend/qgslegend.cpp
===================================================================
--- trunk/qgis/src/app/legend/qgslegend.cpp	2010-08-10 10:16:00 UTC (rev 14041)
+++ trunk/qgis/src/app/legend/qgslegend.cpp	2010-08-10 16:02:27 UTC (rev 14042)
@@ -1640,7 +1640,7 @@
     }
     else if ( layer->drawingStyle() == QgsRasterLayer::MultiBandSingleBandPseudoColor )
     {
-      layer->setDrawingStyle( QgsRasterLayer::MultiBandSingleGandGray );
+      layer->setDrawingStyle( QgsRasterLayer::MultiBandSingleBandGray );
     }
 
     if ( layer->contrastEnhancementAlgorithmAsString() == "NoEnhancement" )

Modified: trunk/qgis/src/app/qgsrasterlayerproperties.cpp
===================================================================
--- trunk/qgis/src/app/qgsrasterlayerproperties.cpp	2010-08-10 10:16:00 UTC (rev 14041)
+++ trunk/qgis/src/app/qgsrasterlayerproperties.cpp	2010-08-10 16:02:27 UTC (rev 14042)
@@ -532,7 +532,7 @@
       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 @@
       }
       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_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];

Modified: trunk/qgis/src/core/raster/qgsrasterlayer.cpp
===================================================================
--- trunk/qgis/src/core/raster/qgsrasterlayer.cpp	2010-08-10 10:16:00 UTC (rev 14041)
+++ trunk/qgis/src/core/raster/qgsrasterlayer.cpp	2010-08-10 16:02:27 UTC (rev 14042)
@@ -1766,12 +1766,12 @@
                                   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 @@
     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 @@
     //
     // 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 @@
     //
     // 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 @@
   //
   // 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 @@
   //
   // 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 @@
   {
     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::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] );

Modified: trunk/qgis/src/core/raster/qgsrasterlayer.h
===================================================================
--- trunk/qgis/src/core/raster/qgsrasterlayer.h	2010-08-10 10:16:00 UTC (rev 14041)
+++ trunk/qgis/src/core/raster/qgsrasterlayer.h	2010-08-10 16:02:27 UTC (rev 14042)
@@ -83,7 +83,7 @@
  *  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 @@
       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.



More information about the QGIS-commit mailing list