Skip to content
Permalink
Browse files

fix some tests and some doxygen warnings

  • Loading branch information
jef-n committed May 19, 2013
1 parent dd5e1b5 commit 4109a1015a98034ed3783fef8726d8c2a0dfe668
@@ -37,12 +37,13 @@ QgsRasterShader::~QgsRasterShader()
}

/**
Generates and new RGB value based on one input value
Generates and new RGBA value based on one input value
@param theValue The original value to base a new RGB value on
@param theReturnRedValue The red component of the new RGB value
@param theReturnGreenValue The green component of the new RGB value
@param theReturnBlueValue The blue component of the new RGB value
@param theValue The original value to base a new RGBA value on
@param theReturnRedValue The red component of the new RGBA value
@param theReturnGreenValue The green component of the new RGBA value
@param theReturnBlueValue The blue component of the new RGBA value
@param theReturnAlpha The alpha component of the new RGBA value
@return True if the return values are valid otherwise false
*/
bool QgsRasterShader::shade( double theValue, int* theReturnRedValue, int* theReturnGreenValue, int* theReturnBlueValue , int *theReturnAlpha )
@@ -55,15 +56,17 @@ bool QgsRasterShader::shade( double theValue, int* theReturnRedValue, int* theRe
return false;
}
/**
Generates and new RGB value based on an original RGB value
Generates and new RGBA value based on an original RGBA value
@param theRedValue The red component of the original value to base a new RGB value on
@param theGreenValue The green component of the original value to base a new RGB value on
@param theBlueValue The blue component of the original value to base a new RGB value on
@param theReturnRedValue The red component of the new RGB value
@param theReturnGreenValue The green component of the new RGB value
@param theReturnBlueValue The blue component of the new RGB value
@param theRedValue The red component of the original value to base a new RGBA value on
@param theGreenValue The green component of the original value to base a new RGBA value on
@param theBlueValue The blue component of the original value to base a new RGBA value on
@param theAlphaValue The alpha component of the original value to base a new RGBA value on
@param theReturnRedValue The red component of the new RGBA value
@param theReturnGreenValue The green component of the new RGBA value
@param theReturnBlueValue The blue component of the new RGBA value
@param theReturnAlphaValue The alpha component of the new RGBA value
@return True if the return values are valid otherwise false
*/
bool QgsRasterShader::shade( double theRedValue, double theGreenValue, double theBlueValue, double theAlphaValue, int* theReturnRedValue, int* theReturnGreenValue, int* theReturnBlueValue, int* theReturnAlphaValue )
@@ -55,12 +55,13 @@ void QgsRasterShaderFunction::setMinimumValue( double theValue )
}

/**
Generates and new RGB value based on one input value
Generates and new RGBA value based on one input value
@param theValue The original value to base a new RGB value on
@param theReturnRedValue The red component of the new RGB value
@param theReturnGreenValue The green component of the new RGB value
@param theReturnBlueValue The blue component of the new RGB value
@param theValue The original value to base a new RGBA value on
@param theReturnRedValue The red component of the new RGBA value
@param theReturnGreenValue The green component of the new RGBA value
@param theReturnBlueValue The blue component of the new RGBA value
@param theReturnAlphaValue The blue component of the new RGBA value
@return True if the return values are valid otherwise false
*/
bool QgsRasterShaderFunction::shade( double theValue, int* theReturnRedValue, int* theReturnGreenValue, int* theReturnBlueValue, int* theReturnAlphaValue )
@@ -76,15 +77,17 @@ bool QgsRasterShaderFunction::shade( double theValue, int* theReturnRedValue, in
}

/**
Generates and new RGB value based on an original RGB value
Generates and new RGBA value based on an original RGBA value
@param theRedValue The red component of the original value to base a new RGB value on
@param theGreenValue The green component of the original value to base a new RGB value on
@param theBlueValue The blue component of the original value to base a new RGB value on
@param theReturnRedValue The red component of the new RGB value
@param theReturnGreenValue The green component of the new RGB value
@param theReturnBlueValue The blue component of the new RGB value
@param theRedValue The red component of the original value to base a new RGBA value on
@param theGreenValue The green component of the original value to base a new RGBA value on
@param theBlueValue The blue component of the original value to base a new RGBA value on
@param theAlphaValue The alpha component of the original value to base a new RGBA value on
@param theReturnRedValue The red component of the new RGBA value
@param theReturnGreenValue The green component of the new RGBA value
@param theReturnBlueValue The blue component of the new RGBA value
@param theReturnAlphaValue The alpha component of the new RGBA value
@return True if the return values are valid otherwise false
*/
bool QgsRasterShaderFunction::shade( double theRedValue, double theGreenValue, double theBlueValue, double theAlphaValue, int* theReturnRedValue, int* theReturnGreenValue, int* theReturnBlueValue , int *theReturnAlphaValue )
@@ -103,7 +103,7 @@ class CORE_EXPORT QgsSimpleMarkerSymbolLayerV2 : public QgsMarkerSymbolLayerV2

//////////

#define DEFAULT_SVGMARKER_NAME "/symbol/Star1.svg"
#define DEFAULT_SVGMARKER_NAME "/crosses/Star1.svg"
#define DEFAULT_SVGMARKER_SIZE 2*DEFAULT_POINT_SIZE
#define DEFAULT_SVGMARKER_ANGLE 0

@@ -1179,14 +1179,14 @@ bool QgsSymbolLayerV2Utils::needLinePatternFill( QDomElement &element )
QString name;
QColor fillColor, borderColor;
double size, borderWidth;
if ( !QgsSymbolLayerV2Utils::wellKnownMarkerFromSld( graphicElem, name, fillColor, borderColor, borderWidth, size ) )
if ( !wellKnownMarkerFromSld( graphicElem, name, fillColor, borderColor, borderWidth, size ) )
return false;

if ( name != "horline" )
return false;

QString angleFunc;
if ( !QgsSymbolLayerV2Utils::rotationFromSldElement( graphicElem, angleFunc ) )
if ( !rotationFromSldElement( graphicElem, angleFunc ) )
return false;

bool ok;
@@ -1197,7 +1197,11 @@ bool QgsSymbolLayerV2Utils::needLinePatternFill( QDomElement &element )
return true;
}

bool QgsSymbolLayerV2Utils::needPointPatternFill( QDomElement &element ) { Q_UNUSED( element ); return false; }
bool QgsSymbolLayerV2Utils::needPointPatternFill( QDomElement &element )
{
Q_UNUSED( element );
return false;
}

bool QgsSymbolLayerV2Utils::needSvgFill( QDomElement &element )
{
@@ -1256,11 +1260,11 @@ bool QgsSymbolLayerV2Utils::convertPolygonSymbolizerToPointMarker( QDomElement &
{
QgsStringMap map;
map["name"] = "square";
map["color"] = QgsSymbolLayerV2Utils::encodeColor( validFill ? fillColor : Qt::transparent );
map["color_border"] = QgsSymbolLayerV2Utils::encodeColor( validBorder ? borderColor : Qt::transparent );
map["color"] = encodeColor( validFill ? fillColor : Qt::transparent );
map["color_border"] = encodeColor( validBorder ? borderColor : Qt::transparent );
map["size"] = QString::number( 6 );
map["angle"] = QString::number( 0 );
map["offset"] = QgsSymbolLayerV2Utils::encodePoint( QPointF( 0, 0 ) );
map["offset"] = encodePoint( QPointF( 0, 0 ) );
layers.append( QgsSymbolLayerV2Registry::instance()->createSymbolLayer( "SimpleMarker", map ) );
}
}
@@ -1439,21 +1443,21 @@ bool QgsSymbolLayerV2Utils::convertPolygonSymbolizerToPointMarker( QDomElement &
if ( !qgsDoubleNear( angle, 0.0 ) )
map["angle"] = QString::number( angle );
if ( !offset.isNull() )
map["offset"] = QgsSymbolLayerV2Utils::encodePoint( offset );
map["offset"] = encodePoint( offset );
layers.append( QgsSymbolLayerV2Registry::instance()->createSymbolLayer( "SvgMarker", map ) );
}
else if ( format == "ttf" )
{
QgsStringMap map;
map["font"] = name;
map["chr"] = markIndex;
map["color"] = QgsSymbolLayerV2Utils::encodeColor( validFill ? fillColor : Qt::transparent );
map["color"] = encodeColor( validFill ? fillColor : Qt::transparent );
if ( size > 0 )
map["size"] = QString::number( size );
if ( !qgsDoubleNear( angle, 0.0 ) )
map["angle"] = QString::number( angle );
if ( !offset.isNull() )
map["offset"] = QgsSymbolLayerV2Utils::encodePoint( offset );
map["offset"] = encodePoint( offset );
layers.append( QgsSymbolLayerV2Registry::instance()->createSymbolLayer( "FontMarker", map ) );
}
}
@@ -2254,7 +2258,7 @@ bool QgsSymbolLayerV2Utils::functionFromSldElement( QDomElement &element, QStrin
}
else
{
function = expr->expression();
function = expr->dump();
}

delete expr;
@@ -351,14 +351,14 @@ class TestQgsExpression: public QObject
QTest::newRow( "negative age" ) << "age('2012-06-28','2012-06-30')" << false << QVariant::fromValue( QgsExpression::Interval( -172800 ) );

// Color functions
QTest::newRow( "ramp color" ) << "ramp_color('Spectral',0.3)" << false << QVariant( "#fdbe73" );
QTest::newRow( "color rgb" ) << "color_rgb(255,127,0)" << false << QVariant( "#ff7f00" );
QTest::newRow( "ramp color" ) << "ramp_color('Spectral',0.3)" << false << QVariant( "253,190,115,255" );
QTest::newRow( "color rgb" ) << "color_rgb(255,127,0)" << false << QVariant( "255,127,0" );
QTest::newRow( "color rgba" ) << "color_rgba(255,127,0,200)" << false << QVariant( "255,127,0,200" );
QTest::newRow( "color hsl" ) << "color_hsl(100,50,70)" << false << QVariant( "#a6d98c" );
QTest::newRow( "color hsl" ) << "color_hsl(100,50,70)" << false << QVariant( "166,217,140" );
QTest::newRow( "color hsla" ) << "color_hsla(100,50,70,200)" << false << QVariant( "166,217,140,200" );
QTest::newRow( "color hsv" ) << "color_hsv(40,100,100)" << false << QVariant( "#ffaa00" );
QTest::newRow( "color hsv" ) << "color_hsv(40,100,100)" << false << QVariant( "255,170,0" );
QTest::newRow( "color hsva" ) << "color_hsva(40,100,100,200)" << false << QVariant( "255,170,0,200" );
QTest::newRow( "color cmyk" ) << "color_cmyk(100,50,33,10)" << false << QVariant( "#00739a" );
QTest::newRow( "color cmyk" ) << "color_cmyk(100,50,33,10)" << false << QVariant( "0,115,154" );
QTest::newRow( "color cmyka" ) << "color_cmyka(50,25,90,60,200)" << false << QVariant( "51,76,10,200" );
}

@@ -12,14 +12,14 @@
<se:GraphicFill>
<se:Graphic>
<se:ExternalGraphic>
<OnlineResource xlink:type="simple" xlink:href="C:/Program Files/qgis1.8.0/./svg/accommodation/accommodation_camping.svg"/>
<OnlineResource xlink:type="simple" xlink:href="file:accommodation/accommodation_camping.svg"/>
<Format>image/svg+xml</Format>
</se:ExternalGraphic>
<se:Size>6</se:Size>
<se:SvgParameter name="stroke">#000000</se:SvgParameter>
<se:SvgParameter name="stroke-width">3</se:SvgParameter>
<se:Rotation>
<ogc:Literal>4</ogc:Literal>
<ogc:Literal>3</ogc:Literal>
</se:Rotation>
</se:Graphic>
</se:GraphicFill>
@@ -10,7 +10,7 @@
<se:PointSymbolizer>
<se:Graphic>
<se:ExternalGraphic>
<OnlineResource xlink:type="simple" xlink:href="C:/Program Files/qgis1.8.0/svg/gpsicons/skull.svg"/>
<OnlineResource xlink:type="simple" xlink:href="file:gpsicons/skull.svg"/>
<Format>image/svg+xml</Format>
</se:ExternalGraphic>
<se:Size>12</se:Size>

0 comments on commit 4109a10

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