[QGIS Commit] r9566 - in trunk/qgis: python/core src/app src/core/raster tests/src/core

svn_qgis at osgeo.org svn_qgis at osgeo.org
Thu Nov 6 10:16:08 EST 2008


Author: ersts
Date: 2008-11-06 10:16:08 -0500 (Thu, 06 Nov 2008)
New Revision: 9566

Modified:
   trunk/qgis/python/core/qgscontrastenhancement.sip
   trunk/qgis/python/core/qgsrasterlayer.sip
   trunk/qgis/src/app/qgsrasterlayerproperties.cpp
   trunk/qgis/src/core/raster/qgscontrastenhancement.cpp
   trunk/qgis/src/core/raster/qgscontrastenhancement.h
   trunk/qgis/src/core/raster/qgsrasterlayer.cpp
   trunk/qgis/src/core/raster/qgsrasterlayer.h
   trunk/qgis/tests/src/core/testqgsrasterlayer.cpp
Log:
-some adjustments to the raster API as suggested by Timlinux

Modified: trunk/qgis/python/core/qgscontrastenhancement.sip
===================================================================
--- trunk/qgis/python/core/qgscontrastenhancement.sip	2008-11-06 10:51:48 UTC (rev 9565)
+++ trunk/qgis/python/core/qgscontrastenhancement.sip	2008-11-06 15:16:08 UTC (rev 9566)
@@ -14,7 +14,7 @@
     StretchToMinimumMaximum, //linear histogram enhanceContrast
     StretchAndClipToMinimumMaximum,
     ClipToMinimumMaximum,
-    UserDefined
+    UserDefinedEnhancement
   };
     
   /*! These are exactly the same as GDAL pixel data types */

Modified: trunk/qgis/python/core/qgsrasterlayer.sip
===================================================================
--- trunk/qgis/python/core/qgsrasterlayer.sip	2008-11-06 10:51:48 UTC (rev 9565)
+++ trunk/qgis/python/core/qgsrasterlayer.sip	2008-11-06 15:16:08 UTC (rev 9566)
@@ -55,11 +55,11 @@
     /** \brief This enumerator describes the types of shading that can be used */
     enum ColorShadingAlgorithm
     {
-      UndefinedShadingAlgorithm,
-      PseudoColor,
-      FreakOut,
-      ColorRamp,
-      UserDefined
+      UndefinedShader,
+      PseudoColorShader,
+      FreakOutShader,
+      ColorRampShader,
+      UserDefinedShader
     };
 
     /** \brief This enumerator describes the different kinds of drawing we can do */
@@ -214,7 +214,7 @@
     void setRGBMinimumMaximumEstimated( bool theBool );
 
     /** \brief Mutator to alter the number of standard deviations that should be plotted */
-    void setStandardDeviationsToPlot( double theStdDevsToPlot );
+    void setStandardDeviations( double theStdDevsToPlot );
 
     /** \brief Mutator for mUserDefinedGrayMinimumMaximum */
     void setUserDefinedGrayMinimumMaximum( bool theBool );
@@ -223,7 +223,7 @@
     void setUserDefinedRGBMinimumMaximum( bool theBool );
 
     /** \brief Accessor to find out how many standard deviations are being plotted */
-    double standardDeviationsToPlot() const;
+    double standardDeviations() const;
 
     /** \brief  Accessor for transparent band name mapping */
     QString transparentBandName() const;

Modified: trunk/qgis/src/app/qgsrasterlayerproperties.cpp
===================================================================
--- trunk/qgis/src/app/qgsrasterlayerproperties.cpp	2008-11-06 10:51:48 UTC (rev 9565)
+++ trunk/qgis/src/app/qgsrasterlayerproperties.cpp	2008-11-06 15:16:08 UTC (rev 9566)
@@ -588,19 +588,19 @@
        mRasterLayer->drawingStyle() == QgsRasterLayer::PalettedSingleBandPseudoColor ||
        mRasterLayer->drawingStyle() == QgsRasterLayer::MultiBandSingleBandPseudoColor )
   {
-    if ( mRasterLayer->colorShadingAlgorithm() == QgsRasterLayer::PseudoColor )
+    if ( mRasterLayer->colorShadingAlgorithm() == QgsRasterLayer::PseudoColorShader )
     {
       cboxColorMap->setCurrentIndex( cboxColorMap->findText( tr( "Pseudocolor" ) ) );
     }
-    else if ( mRasterLayer->colorShadingAlgorithm() == QgsRasterLayer::FreakOut )
+    else if ( mRasterLayer->colorShadingAlgorithm() == QgsRasterLayer::FreakOutShader )
     {
       cboxColorMap->setCurrentIndex( cboxColorMap->findText( tr( "Freak Out" ) ) );
     }
-    else if ( mRasterLayer->colorShadingAlgorithm() == QgsRasterLayer::ColorRamp )
+    else if ( mRasterLayer->colorShadingAlgorithm() == QgsRasterLayer::ColorRampShader )
     {
       cboxColorMap->setCurrentIndex( cboxColorMap->findText( tr( "Colormap" ) ) );
     }
-    else if ( mRasterLayer->colorShadingAlgorithm() == QgsRasterLayer::UserDefined )
+    else if ( mRasterLayer->colorShadingAlgorithm() == QgsRasterLayer::UserDefinedShader )
     {
       cboxColorMap->setCurrentIndex( cboxColorMap->findText( tr( "User Defined" ) ) );
     }
@@ -638,7 +638,7 @@
     }
     else
     {
-      sboxThreeBandStdDev->setValue( mRasterLayer->standardDeviationsToPlot() );
+      sboxThreeBandStdDev->setValue( mRasterLayer->standardDeviations() );
       rbtnThreeBandStdDev->setChecked( true );
       rbtnThreeBandMinMax->setChecked( false );
     }
@@ -677,7 +677,7 @@
     }
     else
     {
-      sboxSingleBandStdDev->setValue( mRasterLayer->standardDeviationsToPlot() );
+      sboxSingleBandStdDev->setValue( mRasterLayer->standardDeviations() );
       rbtnSingleBandStdDev->setChecked( true );
       rbtnSingleBandMinMax->setChecked( false );
     }
@@ -709,7 +709,7 @@
   {
     cboxContrastEnhancementAlgorithm->setCurrentIndex( cboxContrastEnhancementAlgorithm->findText( tr( "Clip To MinMax" ) ) );
   }
-  else if ( QgsContrastEnhancement::UserDefined == mRasterLayer->contrastEnhancementAlgorithm() )
+  else if ( QgsContrastEnhancement::UserDefinedEnhancement == mRasterLayer->contrastEnhancementAlgorithm() )
   {
     cboxContrastEnhancementAlgorithm->setCurrentIndex( cboxContrastEnhancementAlgorithm->findText( tr( "User Defined" ) ) );
   }
@@ -851,7 +851,7 @@
     return;
   }
 
-  if ( QgsRasterLayer::ColorRamp != mRasterLayer->colorShadingAlgorithm() )
+  if ( QgsRasterLayer::ColorRampShader != mRasterLayer->colorShadingAlgorithm() )
   {
     return;
   }
@@ -1059,15 +1059,15 @@
   //If UserDefined do nothing, user defined can only be set programatically
   if ( cboxColorMap->currentText() == tr( "Pseudocolor" ) )
   {
-    mRasterLayer->setColorShadingAlgorithm( QgsRasterLayer::PseudoColor );
+    mRasterLayer->setColorShadingAlgorithm( QgsRasterLayer::PseudoColorShader );
   }
   else if ( cboxColorMap->currentText() == tr( "Freak Out" ) )
   {
-    mRasterLayer->setColorShadingAlgorithm( QgsRasterLayer::FreakOut );
+    mRasterLayer->setColorShadingAlgorithm( QgsRasterLayer::FreakOutShader );
   }
   else if ( cboxColorMap->currentText() == tr( "Colormap" ) )
   {
-    mRasterLayer->setColorShadingAlgorithm( QgsRasterLayer::ColorRamp );
+    mRasterLayer->setColorShadingAlgorithm( QgsRasterLayer::ColorRampShader );
   }
 
   //set the color scaling algorithm
@@ -1086,7 +1086,7 @@
   {
     mRasterLayer->setContrastEnhancementAlgorithm( QgsContrastEnhancement::ClipToMinimumMaximum, false );
   }
-  else if ( QgsContrastEnhancement::UserDefined == mRasterLayer->contrastEnhancementAlgorithm() )
+  else if ( QgsContrastEnhancement::UserDefinedEnhancement == mRasterLayer->contrastEnhancementAlgorithm() )
   {
     //do nothing
   }
@@ -1117,17 +1117,17 @@
         mRasterLayer->setMinimumValue( cboBlue->currentText(), leBlueMin->text().toDouble(), false );
         mRasterLayer->setMaximumValue( cboBlue->currentText(), leBlueMax->text().toDouble() );
       }
-      mRasterLayer->setStandardDeviationsToPlot( 0.0 );
+      mRasterLayer->setStandardDeviations( 0.0 );
       mRasterLayer->setUserDefinedRGBMinimumMaximum( true );
     }
     else if ( rbtnThreeBandStdDev->isEnabled() && rbtnThreeBandStdDev->isChecked() )
     {
-      mRasterLayer->setStandardDeviationsToPlot( sboxThreeBandStdDev->value() );
+      mRasterLayer->setStandardDeviations( sboxThreeBandStdDev->value() );
       mRasterLayer->setUserDefinedRGBMinimumMaximum( false );
     }
     else
     {
-      mRasterLayer->setStandardDeviationsToPlot( 0.0 );
+      mRasterLayer->setStandardDeviations( 0.0 );
       mRasterLayer->setUserDefinedRGBMinimumMaximum( false );
     }
   }
@@ -1142,17 +1142,17 @@
         mRasterLayer->setMinimumValue( cboGray->currentText(), leGrayMin->text().toDouble(), false );
         mRasterLayer->setMaximumValue( cboGray->currentText(), leGrayMax->text().toDouble() );
       }
-      mRasterLayer->setStandardDeviationsToPlot( 0.0 );
+      mRasterLayer->setStandardDeviations( 0.0 );
       mRasterLayer->setUserDefinedGrayMinimumMaximum( true );
     }
     else if ( rbtnSingleBandStdDev->isEnabled() && rbtnSingleBandStdDev->isChecked() )
     {
-      mRasterLayer->setStandardDeviationsToPlot( sboxSingleBandStdDev->value() );
+      mRasterLayer->setStandardDeviations( sboxSingleBandStdDev->value() );
       mRasterLayer->setUserDefinedGrayMinimumMaximum( false );
     }
     else
     {
-      mRasterLayer->setStandardDeviationsToPlot( 0.0 );
+      mRasterLayer->setStandardDeviations( 0.0 );
       mRasterLayer->setUserDefinedGrayMinimumMaximum( false );
     }
   }
@@ -1468,7 +1468,7 @@
     {
       if ( rbtnThreeBandStdDev->isEnabled() )
       {
-        sboxThreeBandStdDev->setValue( mRasterLayer->standardDeviationsToPlot() );
+        sboxThreeBandStdDev->setValue( mRasterLayer->standardDeviations() );
       }
 
       if ( rbtnThreeBandMinMax->isEnabled() )
@@ -1496,7 +1496,7 @@
     {
       if ( rbtnSingleBandStdDev->isEnabled() )
       {
-        sboxSingleBandStdDev->setValue( mRasterLayer->standardDeviationsToPlot() );
+        sboxSingleBandStdDev->setValue( mRasterLayer->standardDeviations() );
       }
 
       if ( rbtnSingleBandMinMax->isEnabled() )
@@ -2390,7 +2390,7 @@
     }
     else
     {
-      sboxSingleBandStdDev->setValue( mRasterLayer->standardDeviationsToPlot() );
+      sboxSingleBandStdDev->setValue( mRasterLayer->standardDeviations() );
       rbtnSingleBandStdDev->setChecked( true );
     }
 
@@ -2471,7 +2471,7 @@
     }
     else
     {
-      sboxThreeBandStdDev->setValue( mRasterLayer->standardDeviationsToPlot() );
+      sboxThreeBandStdDev->setValue( mRasterLayer->standardDeviations() );
       rbtnThreeBandStdDev->setChecked( true );
     }
 

Modified: trunk/qgis/src/core/raster/qgscontrastenhancement.cpp
===================================================================
--- trunk/qgis/src/core/raster/qgscontrastenhancement.cpp	2008-11-06 10:51:48 UTC (rev 9565)
+++ trunk/qgis/src/core/raster/qgscontrastenhancement.cpp	2008-11-06 15:16:08 UTC (rev 9566)
@@ -251,7 +251,7 @@
       case ClipToMinimumMaximum :
         mContrastEnhancementFunction = new QgsClipToMinMaxEnhancement( mRasterDataType, mMinimumValue, mMaximumValue );
         break;
-      case UserDefined :
+      case UserDefinedEnhancement :
         //Do nothing
         break;
       default:
@@ -281,7 +281,7 @@
   if ( 0 != theFunction )
   {
     mContrastEnhancementFunction = theFunction;
-    mContrastEnhancementAlgorithm = UserDefined;
+    mContrastEnhancementAlgorithm = UserDefinedEnhancement;
     generateLookupTable();
   }
 }

Modified: trunk/qgis/src/core/raster/qgscontrastenhancement.h
===================================================================
--- trunk/qgis/src/core/raster/qgscontrastenhancement.h	2008-11-06 10:51:48 UTC (rev 9565)
+++ trunk/qgis/src/core/raster/qgscontrastenhancement.h	2008-11-06 15:16:08 UTC (rev 9566)
@@ -42,7 +42,7 @@
       StretchToMinimumMaximum,        //linear histogram enhanceContrast
       StretchAndClipToMinimumMaximum,
       ClipToMinimumMaximum,
-      UserDefined
+      UserDefinedEnhancement
     };
 
     /** These are exactly the same as GDAL pixel data types

Modified: trunk/qgis/src/core/raster/qgsrasterlayer.cpp
===================================================================
--- trunk/qgis/src/core/raster/qgsrasterlayer.cpp	2008-11-06 10:51:48 UTC (rev 9565)
+++ trunk/qgis/src/core/raster/qgsrasterlayer.cpp	2008-11-06 15:16:08 UTC (rev 9566)
@@ -1179,23 +1179,23 @@
 {
   switch ( mColorShadingAlgorithm )
   {
-    case PseudoColor:
-      return QString( "PseudoColor" );
+    case PseudoColorShader:
+      return QString( "PseudoColorShader" );
       break;
-    case FreakOut:
-      return QString( "FreakOut" );
+    case FreakOutShader:
+      return QString( "FreakOutShader" );
       break;
-    case ColorRamp:
-      return QString( "ColorRamp" );
+    case ColorRampShader:
+      return QString( "ColorRampShader" );
       break;
-    case UserDefined:
-      return QString( "UserDefined" );
+    case UserDefinedShader:
+      return QString( "UserDefinedShader" );
       break;
     default:
       break;
   }
 
-  return QString( "UndefinedShadingAlgorithm" );
+  return QString( "UndefinedShader" );
 }
 
 /**
@@ -1252,7 +1252,7 @@
     case QgsContrastEnhancement::ClipToMinimumMaximum:
       return QString( "ClipToMinimumMaximum" );
       break;
-    case QgsContrastEnhancement::UserDefined:
+    case QgsContrastEnhancement::UserDefinedEnhancement:
       return QString( "UserDefined" );
       break;
   }
@@ -1980,7 +1980,7 @@
             int myBlue = 255;
             int myGreen = static_cast < int >((( 255 / myRangeSize ) * ( my - myClassBreakMin1 ) ) * 3 );
             // testing this stuff still ...
-            if ( mColorShadingAlgorithm == FreakOut )
+            if ( mColorShadingAlgorithm == FreakOutShader )
             {
               myRed = 255 - myGreen;
             }
@@ -1993,7 +1993,7 @@
             int myBlue = static_cast < int >( 255 - ((( 255 / myRangeSize ) * (( my - myClassBreakMin2 ) / 1 ) ) * 3 ) );
             int myGreen = 255;
             // testing this stuff still ...
-            if ( mColorShadingAlgorithm == FreakOut )
+            if ( mColorShadingAlgorithm == FreakOutShader )
             {
               myGreen = myBlue;
             }
@@ -2006,7 +2006,7 @@
             int myBlue = 0;
             int myGreen = static_cast < int >( 255 - ((( 255 / myRangeSize ) * (( my - myClassBreakMin3 ) / 1 ) * 3 ) ) );
             // testing this stuff still ...
-            if ( mColorShadingAlgorithm == FreakOut )
+            if ( mColorShadingAlgorithm == FreakOutShader )
             {
               myRed = myGreen;
               myGreen = 255 - myGreen;
@@ -2023,7 +2023,7 @@
             int myBlue = 0;
             int myGreen = static_cast < int >((( 255 / myRangeSize ) * (( my - myClassBreakMin1 ) / 1 ) * 3 ) );
             // testing this stuff still ...
-            if ( mColorShadingAlgorithm == FreakOut )
+            if ( mColorShadingAlgorithm == FreakOutShader )
             {
               myRed = 255 - myGreen;
             }
@@ -2036,7 +2036,7 @@
             int myBlue = static_cast < int >((( 255 / myRangeSize ) * (( my - myClassBreakMin2 ) / 1 ) ) * 3 );
             int myGreen = 255;
             // testing this stuff still ...
-            if ( mColorShadingAlgorithm == FreakOut )
+            if ( mColorShadingAlgorithm == FreakOutShader )
             {
               myGreen = myBlue;
             }
@@ -2049,7 +2049,7 @@
             int myBlue = 255;
             int myGreen = static_cast < int >( 255 - ((( 255 / myRangeSize ) * ( my - myClassBreakMin3 ) ) * 3 ) );
             // testing this stuff still ...
-            if ( mColorShadingAlgorithm == FreakOut )
+            if ( mColorShadingAlgorithm == FreakOutShader )
             {
               myRed = 255 - myGreen;
             }
@@ -2238,7 +2238,7 @@
             int myBlue = 255;
             int myGreen = static_cast < int >((( 255 / myRangeSize ) * ( my - myClassBreakMin1 ) ) * 3 );
             // testing this stuff still ...
-            if ( mColorShadingAlgorithm == FreakOut )
+            if ( mColorShadingAlgorithm == FreakOutShader )
             {
               myRed = 255 - myGreen;
             }
@@ -2251,7 +2251,7 @@
             int myBlue = static_cast < int >( 255 - ((( 255 / myRangeSize ) * (( my - myClassBreakMin2 ) / 1 ) ) * 3 ) );
             int myGreen = 255;
             // testing this stuff still ...
-            if ( mColorShadingAlgorithm == FreakOut )
+            if ( mColorShadingAlgorithm == FreakOutShader )
             {
               myGreen = myBlue;
             }
@@ -2264,7 +2264,7 @@
             int myBlue = 0;
             int myGreen = static_cast < int >( 255 - ((( 255 / myRangeSize ) * (( my - myClassBreakMin3 ) / 1 ) * 3 ) ) );
             // testing this stuff still ...
-            if ( mColorShadingAlgorithm == FreakOut )
+            if ( mColorShadingAlgorithm == FreakOutShader )
             {
               myRed = myGreen;
               myGreen = 255 - myGreen;
@@ -2281,7 +2281,7 @@
             int myBlue = 0;
             int myGreen = static_cast < int >((( 255 / myRangeSize ) * (( my - myClassBreakMin1 ) / 1 ) * 3 ) );
             // testing this stuff still ...
-            if ( mColorShadingAlgorithm == FreakOut )
+            if ( mColorShadingAlgorithm == FreakOutShader )
             {
               myRed = 255 - myGreen;
             }
@@ -2294,7 +2294,7 @@
             int myBlue = static_cast < int >((( 255 / myRangeSize ) * (( my - myClassBreakMin2 ) / 1 ) ) * 3 );
             int myGreen = 255;
             // testing this stuff still ...
-            if ( mColorShadingAlgorithm == FreakOut )
+            if ( mColorShadingAlgorithm == FreakOutShader )
             {
               myGreen = myBlue;
             }
@@ -2307,7 +2307,7 @@
             int myBlue = 255;
             int myGreen = static_cast < int >( 255 - ((( 255 / myRangeSize ) * ( my - myClassBreakMin3 ) ) * 3 ) );
             // testing this stuff still ...
-            if ( mColorShadingAlgorithm == FreakOut )
+            if ( mColorShadingAlgorithm == FreakOutShader )
             {
               myRed = 255 - myGreen;
             }
@@ -3150,16 +3150,16 @@
 
     switch ( theShadingAlgorithm )
     {
-      case PseudoColor:
+      case PseudoColorShader:
         mRasterShader->setRasterShaderFunction( new QgsPseudoColorShader() );
         break;
-      case FreakOut:
-        mRasterShader->setRasterShaderFunction( new QgsFreakOutShader() );
+      case FreakOutShader:
+        mRasterShader->setRasterShaderFunction( new QgsFreakOutShaderShader() );
         break;
-      case ColorRamp:
+      case ColorRampShader:
         mRasterShader->setRasterShaderFunction( new QgsColorRampShader() );
         break;
-      case UserDefined:
+      case UserDefinedShader:
         //do nothing
         break;
       default:
@@ -3174,16 +3174,16 @@
 {
   QgsDebugMsg( "called with [" + theShaderAlgorithm + "]" );
 
-  if ( theShaderAlgorithm == "PseudoColor" )
-    setColorShadingAlgorithm( PseudoColor );
-  else if ( theShaderAlgorithm == "FreakOut" )
-    setColorShadingAlgorithm( FreakOut );
-  else if ( theShaderAlgorithm == "ColorRamp" )
-    setColorShadingAlgorithm( ColorRamp );
-  else if ( theShaderAlgorithm == "UserDefined" )
-    setColorShadingAlgorithm( UserDefined );
+  if ( theShaderAlgorithm == "PseudoColorShader" )
+    setColorShadingAlgorithm( PseudoColorShader );
+  else if ( theShaderAlgorithm == "FreakOutShader" )
+    setColorShadingAlgorithm( FreakOutShader );
+  else if ( theShaderAlgorithm == "ColorRampShader" )
+    setColorShadingAlgorithm( ColorRampShader );
+  else if ( theShaderAlgorithm == "UserDefinedShader" )
+    setColorShadingAlgorithm( UserDefinedShader );
   else
-    setColorShadingAlgorithm( UndefinedShadingAlgorithm );
+    setColorShadingAlgorithm( UndefinedShader );
 }
 
 void QgsRasterLayer::setContrastEnhancementAlgorithm( QgsContrastEnhancement::ContrastEnhancementAlgorithm theAlgorithm, bool theGenerateLookupTableFlag)
@@ -3219,7 +3219,7 @@
   }
   else if ( theAlgorithm == "UserDefined" )
   {
-    setContrastEnhancementAlgorithm( QgsContrastEnhancement::UserDefined, theGenerateLookupTableFlag );
+    setContrastEnhancementAlgorithm( QgsContrastEnhancement::UserDefinedEnhancement, theGenerateLookupTableFlag );
   }
   else
   {
@@ -3365,13 +3365,13 @@
   if ( theFunction )
   {
     mRasterShader->setRasterShaderFunction( theFunction );
-    mColorShadingAlgorithm = QgsRasterLayer::UserDefined;
+    mColorShadingAlgorithm = QgsRasterLayer::UserDefinedShader;
   }
   else
   {
     //If NULL as passed in, set a default shader function to prevent segfaults
     mRasterShader->setRasterShaderFunction( new QgsRasterShaderFunction() );
-    mColorShadingAlgorithm = QgsRasterLayer::UserDefined;
+    mColorShadingAlgorithm = QgsRasterLayer::UserDefinedShader;
   }
 }
 
@@ -3518,7 +3518,7 @@
 
   snode = mnl.namedItem( "mStandardDeviations" );
   myElement = snode.toElement();
-  setStandardDeviationsToPlot( myElement.text().toDouble() );
+  setStandardDeviations( myElement.text().toDouble() );
 
   snode = mnl.namedItem( "mUserDefinedRGBMinimumMaximum" );
   myElement = snode.toElement();
@@ -3918,7 +3918,7 @@
 
   // <mStandardDeviations>
   QDomElement mStandardDeviationsElement = document.createElement( "mStandardDeviations" );
-  QDomText    mStandardDeviationsText    = document.createTextNode( QString::number( standardDeviationsToPlot() ) );
+  QDomText    mStandardDeviationsText    = document.createTextNode( QString::number( standardDeviations() ) );
 
   mStandardDeviationsElement.appendChild( mStandardDeviationsText );
 
@@ -4074,7 +4074,7 @@
   /*
    * Color Ramp tab
    */
-  if ( QgsRasterLayer::ColorRamp ==  colorShadingAlgorithm() )
+  if ( QgsRasterLayer::ColorRampShader ==  colorShadingAlgorithm() )
   {
     QDomElement customColorRampElement = document.createElement( "customColorRamp" );
 
@@ -5157,7 +5157,7 @@
     mDrawingStyle = PalettedColor; //sensible default
 
     //Set up a new color ramp shader
-    setColorShadingAlgorithm( ColorRamp );
+    setColorShadingAlgorithm( ColorRampShader );
     QgsColorRampShader* myColorRampShader = ( QgsColorRampShader* ) mRasterShader->rasterShaderFunction();
     myColorRampShader->setColorRampType( QgsColorRampShader::INTERPOLATED );
     myColorRampShader->setColorRampItemList( *colorTable( 1 ) );

Modified: trunk/qgis/src/core/raster/qgsrasterlayer.h
===================================================================
--- trunk/qgis/src/core/raster/qgsrasterlayer.h	2008-11-06 10:51:48 UTC (rev 9565)
+++ trunk/qgis/src/core/raster/qgsrasterlayer.h	2008-11-06 15:16:08 UTC (rev 9566)
@@ -165,7 +165,7 @@
  *  color palettes inverted using the setTransparency and setInvertHistogram methods.
  *
  *  Pseudocolor images can have their output adjusted to a given number of standard
- *  deviations using the setStandardDeviationsToPlot method.
+ *  deviations using the setStandardDeviations method.
  *
  *  The final area of functionality you may be interested in is band mapping. Band mapping
  *  allows you to choose arbitrary band -> color mappings and is applicable only to Palette
@@ -221,11 +221,11 @@
     /** \brief This enumerator describes the types of shading that can be used */
     enum ColorShadingAlgorithm
     {
-      UndefinedShadingAlgorithm,
-      PseudoColor,
-      FreakOut,
-      ColorRamp,
-      UserDefined
+      UndefinedShader,
+      PseudoColorShader,
+      FreakOutShader,
+      ColorRampShader,
+      UserDefinedShader
     };
 
     /** \brief This enumerator describes the different kinds of drawing we can do */
@@ -380,7 +380,7 @@
     void setRGBMinimumMaximumEstimated( bool theBool ) { mRGBMinimumMaximumEstimated = theBool; }
 
     /** \brief Mutator to alter the number of standard deviations that should be plotted */
-    void setStandardDeviationsToPlot( double theStdDevsToPlot ) { mStandardDeviations = theStdDevsToPlot; }
+    void setStandardDeviations( double theStandardDeviations ) { mStandardDeviations = theStandardDeviations; }
 
     /** \brief Mutator for mUserDefinedGrayMinimumMaximum */
     void setUserDefinedGrayMinimumMaximum( bool theBool ) { mUserDefinedGrayMinimumMaximum = theBool; }
@@ -389,7 +389,7 @@
     void setUserDefinedRGBMinimumMaximum( bool theBool ) { mUserDefinedRGBMinimumMaximum = theBool; }
 
     /** \brief Accessor to find out how many standard deviations are being plotted */
-    double standardDeviationsToPlot() const { return mStandardDeviations; }
+    double standardDeviations() const { return mStandardDeviations; }
 
     /** \brief  Accessor for transparent band name mapping */
     QString transparentBandName() const { return mTransparencyBandName; }

Modified: trunk/qgis/tests/src/core/testqgsrasterlayer.cpp
===================================================================
--- trunk/qgis/tests/src/core/testqgsrasterlayer.cpp	2008-11-06 10:51:48 UTC (rev 9565)
+++ trunk/qgis/tests/src/core/testqgsrasterlayer.cpp	2008-11-06 15:16:08 UTC (rev 9566)
@@ -120,7 +120,7 @@
 void TestQgsRasterLayer::pseudoColor()
 {
   mpRasterLayer->setDrawingStyle( QgsRasterLayer::SingleBandPseudoColor );
-  mpRasterLayer->setColorShadingAlgorithm( QgsRasterLayer::PseudoColor );
+  mpRasterLayer->setColorShadingAlgorithm( QgsRasterLayer::PseudoColorShader );
   mpRasterLayer->setContrastEnhancementAlgorithm(
     QgsContrastEnhancement::StretchToMinimumMaximum, false );
   mpRasterLayer->setMinimumValue( mpRasterLayer->grayBandName(), 0.0, false );



More information about the QGIS-commit mailing list