Skip to content
Permalink
Browse files

Symbol items for pseudo color shader

  • Loading branch information
mhugent committed Jun 14, 2011
1 parent ed6df31 commit 992be14152464657dbe224692d9fc68bf89b7e83
@@ -44,6 +44,12 @@ class CORE_EXPORT QgsPseudoColorShader : public QgsRasterShaderFunction
/** \brief Return the minimum value */
void setMinimumValue( double );

double classBreakMin1() const { return mClassBreakMin1; }
double classBreakMax1() const { return mClassBreakMax1; }
double classBreakMin2() const { return mClassBreakMin2; }
double classBreakMax2() const { return mClassBreakMax2; }
double classBreakMin3() const { return mClassBreakMin3; }

private:
void setClassBreaks();

@@ -1229,6 +1229,19 @@ QList< QPair< QString, QColor > > QgsRasterLayer::legendSymbologyItems() const
}
break;
}
case PseudoColorShader:
{
//class breaks have fixed color for the pseudo color shader
const QgsPseudoColorShader* pcShader = dynamic_cast<QgsPseudoColorShader*>( mRasterShader->rasterShaderFunction() );
if( pcShader )
{
symbolList.push_back( qMakePair( QString::number( pcShader->classBreakMin1() ), QColor( 0, 0, 255 ) ) );
symbolList.push_back( qMakePair( QString::number( pcShader->classBreakMax1() ), QColor( 0, 255, 255 ) ) );
symbolList.push_back( qMakePair( QString::number( pcShader->classBreakMax2() ), QColor(255, 255, 0 ) ) );
symbolList.push_back( qMakePair( QString::number( pcShader->classBreakMin2() ), QColor( 255, 0, 0 ) ) );
}
break;
}
default:
break;
}
@@ -43,6 +43,8 @@ class CORE_EXPORT QgsRasterShaderFunction
/** \brief generates and new RGB value based on original RGB value */
virtual bool shade( double, double, double, int*, int*, int* );

double minimumMaximumRange() const { return mMinimumMaximumRange; }

protected:
/** \brief User defineable maximum value for the shading function */
double mMaximumValue;

0 comments on commit 992be14

Please sign in to comment.
You can’t perform that action at this time.