[SCM] qgis branch, master, updated. a2ee769957385f4e084c5e8b6ba178a8c877d1db

Tim Sutton tim at linfiniti.com
Tue Mar 20 13:43:32 UTC 2012


The following commit has been merged in the master branch:
commit 8acbea9d6a9df1c949321bce08cf39fe2a4b07d5
Author: Tim Sutton <tim at linfiniti.com>
Date:   Mon Mar 12 06:22:55 2012 +0200

    [BACKPORT] Formatting changes only for raster color ramp shader class

diff --git a/src/core/raster/qgscolorrampshader.cpp b/src/core/raster/qgscolorrampshader.cpp
index 7cb18c3..70e773e 100644
--- a/src/core/raster/qgscolorrampshader.cpp
+++ b/src/core/raster/qgscolorrampshader.cpp
@@ -65,7 +65,8 @@ bool QgsColorRampShader::discreteColor( double theValue, int* theReturnRedValue,
     myColorRampItem = mColorRampItemList.value( mCurrentColorRampItemIndex );
     myTinyDiff = qAbs( theValue - myColorRampItem.value );
     //If the previous entry is less, then search closer to the top of the list (assumes mColorRampItemList is sorted)
-    if ( mCurrentColorRampItemIndex != 0 && theValue <= mColorRampItemList.at( mCurrentColorRampItemIndex - 1 ).value )
+    if ( mCurrentColorRampItemIndex != 0 && 
+         theValue <= mColorRampItemList.at( mCurrentColorRampItemIndex - 1 ).value )
     {
       mCurrentColorRampItemIndex--;
     }
@@ -119,7 +120,9 @@ bool QgsColorRampShader::exactColor( double theValue, int* theReturnRedValue, in
       return true;
     }
     //pixel value sits between ramp entries so bail
-    else if ( mCurrentColorRampItemIndex != myColorRampItemCount - 1 && theValue > myColorRampItem.value && theValue < mColorRampItemList.at( mCurrentColorRampItemIndex + 1 ).value )
+    else if ( mCurrentColorRampItemIndex != myColorRampItemCount - 1 &&
+        theValue > myColorRampItem.value && theValue < mColorRampItemList.at(
+          mCurrentColorRampItemIndex + 1 ).value )
     {
       return false;
     }
@@ -138,7 +141,8 @@ bool QgsColorRampShader::exactColor( double theValue, int* theReturnRedValue, in
   return false; // value not found
 }
 
-bool QgsColorRampShader::interpolatedColor( double theValue, int* theReturnRedValue, int* theReturnGreenValue, int* theReturnBlueValue )
+bool QgsColorRampShader::interpolatedColor( double theValue, int*
+    theReturnRedValue, int* theReturnGreenValue, int* theReturnBlueValue )
 {
   int myColorRampItemCount = mColorRampItemList.count();
   if ( myColorRampItemCount <= 0 )
@@ -275,7 +279,9 @@ bool QgsColorRampShader::shade( double theValue, int* theReturnRedValue, int* th
   return discreteColor( theValue, theReturnRedValue, theReturnGreenValue, theReturnBlueValue );
 }
 
-bool QgsColorRampShader::shade( double theRedValue, double theGreenValue, double theBlueValue, int* theReturnRedValue, int* theReturnGreenValue, int* theReturnBlueValue )
+bool QgsColorRampShader::shade( double theRedValue, double theGreenValue,
+    double theBlueValue, int* theReturnRedValue, int* theReturnGreenValue, int*
+    theReturnBlueValue )
 {
   Q_UNUSED( theRedValue );
   Q_UNUSED( theGreenValue );
diff --git a/src/core/raster/qgscolorrampshader.h b/src/core/raster/qgscolorrampshader.h
index 90cb863..d6f30aa 100644
--- a/src/core/raster/qgscolorrampshader.h
+++ b/src/core/raster/qgscolorrampshader.h
@@ -96,7 +96,11 @@ class CORE_EXPORT QgsColorRampShader : public QgsRasterShaderFunction
     int mCurrentColorRampItemIndex;
 
     //TODO: Consider pulling this out as a separate class and internally storing as a QMap rather than a QList
-    /** This vector holds the information for classification based on values. Each item holds a value, a label and a color. The member mDiscreteClassification holds if one color is applied for all values between two class breaks (true) or if the item values are (linearly) interpolated for values between the item values (false)*/
+    /** This vector holds the information for classification based on values.
+     * Each item holds a value, a label and a color. The member
+     * mDiscreteClassification holds if one color is applied for all values
+     * between two class breaks (true) or if the item values are (linearly)
+     * interpolated for values between the item values (false)*/
     QList<QgsColorRampShader::ColorRampItem> mColorRampItemList;
 
     /** \brief The color ramp type */
@@ -105,18 +109,23 @@ class CORE_EXPORT QgsColorRampShader : public QgsRasterShaderFunction
     /** \brief Cache of values that have already been looked up */
     QMap<double, QColor> mColorCache;
 
-    /** Maximum size of the color cache. The color cache could eat a ton of memory if you have 32-bit data */
+    /** Maximum size of the color cache. The color cache could eat a ton of
+     * memory if you have 32-bit data */
     int mMaximumColorCacheSize;
 
-
-
-    /** Gets the color for a pixel value from the classification vector mValueClassification. Assigns the color of the lower class for every pixel between two class breaks.*/
+    /** Gets the color for a pixel value from the classification vector
+     * mValueClassification. Assigns the color of the lower class for every
+     * pixel between two class breaks.*/
     bool discreteColor( double, int*, int*, int* );
 
-    /** Gets the color for a pixel value from the classification vector mValueClassification. Assigns the color of the exact matching value in the color ramp item list */
+    /** Gets the color for a pixel value from the classification vector
+     * mValueClassification. Assigns the color of the exact matching value in
+     * the color ramp item list */
     bool exactColor( double, int*, int*, int* );
 
-    /** Gets the color for a pixel value from the classification vector mValueClassification. Interpolates the color between two class breaks linearly.*/
+    /** Gets the color for a pixel value from the classification vector
+     * mValueClassification. Interpolates the color between two class breaks
+     * linearly.*/
     bool interpolatedColor( double, int*, int*, int* );
 };
 

-- 
The Quantum GIS in Debian project



More information about the Pkg-grass-devel mailing list